public void SpawnTerrorist() { Vector3 spawnPos; if (_SpawnOnStreet) { spawnPos = World.GetNextPositionOnStreet(ZonePos.Around(_SpawnRadius)); } else { spawnPos = World.GetNextPositionOnSidewalk(ZonePos.Around(_SpawnRadius)); } var terrorist = new Terrorist(FighterCfg, CurrentSoldierBlipColor); terrorist.Spawn(spawnPos); terrorist.Configure(); Terrorists.Add(terrorist); }
public void DeleteTerrorist(Terrorist terrorist) { Terrorists.Remove(terrorist); terrorist.Delete(); }
private void SpawnReinforcements() { WipeGTAMemory(); for (int i = 0; i < 1; i++) { var fighters = new List <Terrorist>(); foreach (VehicleHash hash in new VehicleHash[2] { VehicleHash.Technical, VehicleHash.Technical, //VehicleHash.Defiler }) { // Configure vehicule Vector3 vehiclePos = World.GetNextPositionOnStreet(ZonePos.Around(550)); while (World.CalculateTravelDistance(ZonePos, vehiclePos) > 650) { vehiclePos = World.GetNextPositionOnStreet(ZonePos.Around(550)); } Vehicle vehicle = World.CreateVehicle(hash, vehiclePos); Function.Call(Hash.SET_VEHICLE_DOORS_LOCKED, vehicle, 4); vehicle.IsPersistent = true; vehicle.Heading = (Game.Player.Character.Position - vehicle.Position).ToHeading(); Vehicles.Add(vehicle); // Spawn driver var driver = new Terrorist(FighterCfg, CurrentSoldierBlipColor); driver.Ped = vehicle.CreatePedOnSeat(VehicleSeat.Driver, FighterCfg.PedHash); driver.Configure(false); // Spawn passengers if (hash != VehicleHash.Defiler) { foreach (VehicleSeat seat in new VehicleSeat[2] { VehicleSeat.RightFront, VehicleSeat.LeftRear }) { var passenger = new Terrorist(FighterCfg, CurrentSoldierBlipColor); passenger.Ped = vehicle.CreatePedOnSeat(seat, FighterCfg.PedHash); passenger.Configure(); Terrorists.Add(passenger); fighters.Add(passenger); } } //if (Game.Player.Character.IsInVehicle() || // Game.Player.Character.Position.DistanceTo(vehicle.Position) > 50) //{ driver.Ped.Task.DriveTo(vehicle, ZonePos, 5, 10, DrivingStyle.Rushed); foreach (Terrorist fighter in fighters) { fighter.Ped.Task.VehicleShootAtPed(Game.Player.Character); } //} /*else // TODO * { * driver.Ped.Task.FightAgainst(Game.Player.Character); * foreach (Terrorist fighter in fighters) * fighter.Ped.Task.FightAgainst(Game.Player.Character); * }*/ Terrorists.Add(driver); } } ReinforcementsSent = true; }