Exemple #1
0
 public ZombieVehicleSpawner()
 {
     VehicleClass[] obj = new VehicleClass[3];
     obj[0]           = GTA.VehicleClass.Commercial;
     obj[1]           = GTA.VehicleClass.Muscle;
     obj[2]           = GTA.VehicleClass.Compacts;
     _classes         = (VehicleClass[])obj;
     InvalidZoneNames = new string[8]
     {
         "Los Santos International Airport",
         "Fort Zancudo",
         "Bolingbroke Penitentiary",
         "Davis Quartz",
         "Palmer-Taylor Power Station",
         "RON Alternates Wind Farm",
         "Terminal",
         "Humane Labs and Research"
     };
     SpawnBlocker = new SpawnBlocker();
     //this._002Ector();
     Instance          = this;
     _minZombies       = this.Settings.GetValue <int>("spawning", "min_spawned_zombies", _minZombies);
     _maxZombies       = this.Settings.GetValue <int>("spawning", "max_spawned_zombies", _maxZombies);
     _minVehicles      = this.Settings.GetValue <int>("spawning", "min_spawned_vehicles", _minVehicles);
     _maxVehicles      = this.Settings.GetValue <int>("spawning", "max_spawned_vehicles", _maxVehicles);
     _spawnDistance    = this.Settings.GetValue <int>("spawning", "spawn_distance", _spawnDistance);
     _minSpawnDistance = this.Settings.GetValue <int>("spawning", "min_spawn_distance", _minSpawnDistance);
     _zombieHealth     = this.Settings.GetValue <int>("zombies", "zombie_health", _zombieHealth);
     this.Settings.SetValue <int>("spawning", "min_spawned_zombies", _minZombies);
     this.Settings.SetValue <int>("spawning", "max_spawned_zombies", _maxZombies);
     this.Settings.SetValue <int>("spawning", "min_spawned_vehicles", _minVehicles);
     this.Settings.SetValue <int>("spawning", "max_spawned_vehicles", _maxVehicles);
     this.Settings.SetValue <int>("spawning", "spawn_distance", _spawnDistance);
     this.Settings.SetValue <int>("spawning", "min_spawn_distance", _minSpawnDistance);
     this.Settings.SetValue <int>("zombies", "zombie_health", _zombieHealth);
     this.Settings.Save();
     this.Tick    += (EventHandler)OnTick;
     this.Aborted += (EventHandler) delegate
     {
         ClearAll();
     };
     this.Interval = 100;
 }
Exemple #2
0
        public bool IsValidSpawn(Vector3 spawnPoint)
        {
            int index = SpawnBlocker.FindIndex((Vector3 spawn) => spawn.VDist(spawnPoint) < 150f);

            return(index <= -1);
        }