public void OnEndMission() { foreach (var badGuy in CleanupBag) { badGuy.Delete(); } CleanupBag.Clear(); foreach (var entry in rappelUpdates) { entry?.Clean(); } foreach (var rappelEntry in rappelStarted) { rappelEntry?.Clean(); } planeEntry?.Clean(); Function.Call(Hash.REMOVE_IPL, "hei_carrier"); Function.Call(Hash.REMOVE_IPL, "hei_carrier_DistantLights"); Function.Call(Hash.REMOVE_IPL, "hei_Carrier_int1"); Function.Call(Hash.REMOVE_IPL, "hei_Carrier_int2"); Function.Call(Hash.REMOVE_IPL, "hei_Carrier_int3"); Function.Call(Hash.REMOVE_IPL, "hei_Carrier_int4"); Function.Call(Hash.REMOVE_IPL, "hei_Carrier_int5"); Function.Call(Hash.REMOVE_IPL, "hei_Carrier_int6"); Function.Call(Hash.REMOVE_IPL, "hei_carrier_LODLights"); }
public void OnEndMission() { foreach (var badGuy in CleanupBag) { badGuy.Delete(); } CleanupBag.Clear(); foreach (var badGuy in CleanupBag) { badGuy.Delete(); } CleanupBag.Clear(); foreach (var entry in rappelUpdates) { entry?.Clean(); } foreach (var rappelEntry in rappelStarted) { rappelEntry?.Clean(); } Function.Call(Hash.REMOVE_IPL, "hei_yacht_heist"); Function.Call(Hash.REMOVE_IPL, "hei_yacht_heist_Bar"); Function.Call(Hash.REMOVE_IPL, "hei_yacht_heist_Bedrm"); Function.Call(Hash.REMOVE_IPL, "hei_yacht_heist_Bridge"); Function.Call(Hash.REMOVE_IPL, "hei_yacht_heist_DistantLights"); Function.Call(Hash.REMOVE_IPL, "hei_yacht_heist_enginrm"); Function.Call(Hash.REMOVE_IPL, "hei_yacht_heist_LODLights"); Function.Call(Hash.REMOVE_IPL, "hei_yacht_heist_Lounge"); }
public void StartEntry(int entryPoint, Ped[] team) { var entry = _entryData[entryPoint]; switch (entry.Type) { case EntryTypes.Teleport: foreach (var ped in team) { ped.Position = entry.Position; ped.Heading = entry.Heading; } break; case EntryTypes.Rappel: if (team.Length == 1) { var rappel = new RappelEntry(entry.Helipads[0], entry.Position); rappel.AddPassenger(team[0]); _rappelUpdates.Add(rappel); } else { var rappel = new RappelEntry(entry.Helipads[0], entry.Position); foreach (Ped ped in team) { rappel.AddPassenger(ped); } _rappelUpdates.Add(rappel); } break; case EntryTypes.Plane: _planeEntry = new PlaneEntry(entry.PlaneSpawn, entry.PlaneSpawnHeading, entry.Approach, entry.RunwayStart, entry.RunwayEnd); foreach (Ped ped in team) { _planeEntry.AddPassenger(ped); } _planeEntry.Start(); break; } foreach (var source in _decorativeVehicles.Where(x => x.EntryPoint == entryPoint)) { var tmpMod = new Model(source.Model); int counter = 0; do { tmpMod.Request(); Script.Yield(); counter++; } while (!tmpMod.IsLoaded && counter < 10000); var tmpVeh = Function.Call <Vehicle>(Hash.CREATE_VEHICLE, tmpMod.Hash, source.Position.X, source.Position.Y, source.Position.Z, source.Heading, false, false); tmpVeh.SirenActive = source.SirenActive; foreach (VehicleDoor door in source.OpenDoors) { tmpVeh.OpenDoor(door, false, false); } CleanupBag.Add(tmpVeh); } }
public void StartEntry(int entryPoint, Ped[] team) { float heading = 0f; switch (entryPoint) { case 0: // Water var entryPos = new Vector3(3098.805f, -4801.487f, 2.037071f); heading = 14.18145f; Ped lastped = new Ped(0); for (int index = 0; index < team.Length; index++) { team[index].Position = entryPos; if (lastped.Exists()) { team[index].Position -= lastped.ForwardVector * 2; } team[index].Heading = heading; lastped = team[index]; } var enforcermodel = new Model(VehicleHash.Dinghy2); enforcermodel.Request(10); var enforcer = World.CreateVehicle(enforcermodel, new Vector3(3094.513f, -4802.502f, 0.1324978f), 15.62522f); CleanupBag.Add(enforcer); EntryComplete = true; break; case 1: // Plane planeEntry = new PlaneEntry(new Vector3(-1598.288f, -2992.517f, 14.87434f), 241.2218f, new Vector3(2541.847f, -3829.26f, 115.3642f), new Vector3(3002.718f, -4602.471f, 15.26161f), new Vector3(3049.975f, -4704.251f, 15.25679f)); foreach (Ped ped in team) { planeEntry.AddPassenger(ped); } planeEntry.Start(); break; case 2: // Rappel Vector3[] rappelpads = new[] { new Vector3(-1114.415f, -2884.573f, 14.04894f), new Vector3(-1145.432f, -2864.025f, 14.05568f), }; for (int i = 0; i < Convert.ToInt32(team.Length / 2); i++) { var rappel = new RappelEntry(rappelpads[i], new Vector3(3079.936f, -4649.66f, 23.87023f)); var team2 = team.Reverse().ToList(); for (int d = 0 + (2 * i); d < 2 + (2 * i); d++) { Ped t = team2[d]; rappel.AddPassenger(t); } rappelUpdates.Add(rappel); } break; } }
public void OnEndMission() { foreach (var badGuy in CleanupBag) { badGuy.Delete(); } CleanupBag.Clear(); Function.Call(Hash.REQUEST_IPL, "CS1_02_cf_offmission"); Function.Call(Hash.REMOVE_IPL, "CS1_02_cf_onmission1"); Function.Call(Hash.REMOVE_IPL, "CS1_02_cf_onmission2"); Function.Call(Hash.REMOVE_IPL, "CS1_02_cf_onmission3"); Function.Call(Hash.REMOVE_IPL, "CS1_02_cf_onmission4"); }
public void StartEntry(int entryPoint, Ped[] team) { switch (entryPoint) { case 0: // Rappel Vector3[] helipads = new[] { new Vector3(311.313f, -1466f, 46.9f), new Vector3(299.75f, -1453f, 46.9f), }; for (int i = 0; i < Convert.ToInt32(team.Length / 2); i++) { var rappel = new RappelEntry(helipads[i], new Vector3(-92.5652f, -2362.343f, 31.9f)); var team2 = team.Reverse().ToList(); for (int d = 0 + (2 * i); d < 2 + (2 * i); d++) { Ped t = team2[d]; rappel.AddPassenger(t); } rappelUpdates.Add(rappel); } break; case 1: //boat BadGuys[BadGuys.Count - 1].Character.Delete(); BadGuys.RemoveAt(BadGuys.Count - 1); var boatModel = new Model(VehicleHash.Dinghy2); int counter = 0; do { boatModel.Request(); Script.Yield(); counter++; } while (!boatModel.IsLoaded && counter < 2000); var boat = World.CreateVehicle(boatModel, new Vector3(-253.971f, -2367.186f, -0.89f), 185.44f); boat.MarkAsNoLongerNeeded(); CleanupBag.Add(boat); foreach (Ped t in team) { t.Position = new Vector3(-249.4635f, -2366.84f, 9.319f); t.Heading = -180f; } EntryComplete = true; break; } }
public void OnStartMission() { if (Function.Call <bool>(Hash.IS_IPL_ACTIVE, "sunkcargoship")) { Function.Call(Hash.REMOVE_IPL, "sunkcargoship"); } Function.Call(Hash.REQUEST_IPL, "cargoship"); for (int i = 0; i < _positions.Length; i++) { var tmp = new Enemy(_positions[i].Item1, _positions[i].Item2); tmp.Character.Task.GuardCurrentPosition(); BadGuys.Add(tmp); CleanupBag.Add(tmp.Character); } }
public void OnStartMission() { Function.Call(Hash.REMOVE_IPL, "CS1_02_cf_offmission"); Function.Call(Hash.REQUEST_IPL, "CS1_02_cf_onmission1"); Function.Call(Hash.REQUEST_IPL, "CS1_02_cf_onmission2"); Function.Call(Hash.REQUEST_IPL, "CS1_02_cf_onmission3"); Function.Call(Hash.REQUEST_IPL, "CS1_02_cf_onmission4"); for (int i = 0; i < _positions.Length; i++) { var tmp = new Enemy(_positions[i].Item1, _positions[i].Item2); tmp.Character.Task.GuardCurrentPosition(); BadGuys.Add(tmp); CleanupBag.Add(tmp.Character); } }
public void OnEndMission() { foreach (var badGuy in CleanupBag) { badGuy.Delete(); } CleanupBag.Clear(); foreach (var entry in rappelUpdates) { entry?.Clean(); } foreach (var rappelEntry in rappelStarted) { rappelEntry?.Clean(); } }
public void OnStartMission() { Function.Call(Hash.REQUEST_IPL, "hei_yacht_heist"); Function.Call(Hash.REQUEST_IPL, "hei_yacht_heist_Bar"); Function.Call(Hash.REQUEST_IPL, "hei_yacht_heist_Bedrm"); Function.Call(Hash.REQUEST_IPL, "hei_yacht_heist_Bridge"); Function.Call(Hash.REQUEST_IPL, "hei_yacht_heist_DistantLights"); Function.Call(Hash.REQUEST_IPL, "hei_yacht_heist_enginrm"); Function.Call(Hash.REQUEST_IPL, "hei_yacht_heist_LODLights"); Function.Call(Hash.REQUEST_IPL, "hei_yacht_heist_Lounge"); for (int i = 0; i < _positions.Length; i++) { var tmp = new Enemy(_positions[i].Item1, _positions[i].Item2); tmp.Character.Task.GuardCurrentPosition(); BadGuys.Add(tmp); CleanupBag.Add(tmp.Character); } }
public void StartEntry(int entryPoint, Ped[] team) { switch (entryPoint) { case 0: //boat BadGuys[BadGuys.Count - 1].Character.Delete(); BadGuys.RemoveAt(BadGuys.Count - 1); var boatModel = new Model(VehicleHash.Dinghy2); int counter = 0; do { boatModel.Request(); //Script.Yield(); counter++; } while (!boatModel.IsLoaded && counter < 2000); var boat = World.CreateVehicle(boatModel, new Vector3(-2015.075f, -1040.253f, 0.5699487f), 341.2882f); boat.MarkAsNoLongerNeeded(); boat.FreezePosition = true; CleanupBag.Add(boat); foreach (Ped t in team) { t.Position = new Vector3(-2015.249f, -1041.006f, 2.072449f); t.Heading = 63.90365f; } EntryComplete = true; break; case 1: // Rappel for (int i = 0; i < Convert.ToInt32(team.Length / 2); i++) { var rappel = new RappelEntry(new Vector3(-1492.215f, -1230.166f, 2.87f).Around(20f), new Vector3(-2109.796f, -1009.942f, 22.83442f)); var team2 = team.Reverse().ToList(); for (int d = 0 + (2 * i); d < 2 + (2 * i); d++) { Ped t = team2[d]; rappel.AddPassenger(t); } rappelUpdates.Add(rappel); } break; } }
public void OnEndMission() { foreach (var badGuy in CleanupBag) { (badGuy as Ped)?.CurrentBlip?.Remove(); badGuy?.Delete(); } CleanupBag.Clear(); foreach (var entry in _rappelUpdates) { entry?.Clean(); } foreach (var rappelEntry in _rappelStarted) { rappelEntry?.Clean(); } _planeEntry?.Clean(); UnloadIPL(); }
public void OnStartMission() { Function.Call(Hash.REQUEST_IPL, "hei_carrier"); Function.Call(Hash.REQUEST_IPL, "hei_carrier_DistantLights"); Function.Call(Hash.REQUEST_IPL, "hei_Carrier_int1"); Function.Call(Hash.REQUEST_IPL, "hei_Carrier_int2"); Function.Call(Hash.REQUEST_IPL, "hei_Carrier_int3"); Function.Call(Hash.REQUEST_IPL, "hei_Carrier_int4"); Function.Call(Hash.REQUEST_IPL, "hei_Carrier_int5"); Function.Call(Hash.REQUEST_IPL, "hei_Carrier_int6"); Function.Call(Hash.REQUEST_IPL, "hei_carrier_LODLights"); for (int i = 0; i < _positions.Length; i++) { var tmp = new Enemy(_positions[i].Item1, _positions[i].Item2); tmp.Character.Task.GuardCurrentPosition(); BadGuys.Add(tmp); CleanupBag.Add(tmp.Character); } }
public void OnStartMission() { for (int i = 0; i < _positions.Length; i++) { var tmp = new Enemy(_positions[i].Item1, _positions[i].Item2); tmp.Character.Task.GuardCurrentPosition(); BadGuys.Add(tmp); CleanupBag.Add(tmp.Character); } var polmodel = new Model(VehicleHash.Police2); polmodel.Request(10); var polcar1 = World.CreateVehicle(polmodel, new Vector3(-1769f, -1157.036f, 12.633f), 68.7f); polcar1.SirenActive = true; var polcar2 = World.CreateVehicle(polmodel, new Vector3(-1774.87f, -1153.445f, 12.633f), 202.47f); polcar2.SirenActive = true; CleanupBag.Add(polcar1); CleanupBag.Add(polcar2); }
public void OnEndMission() { foreach (var badGuy in CleanupBag) { badGuy.Delete(); } CleanupBag.Clear(); Function.Call(Hash.REMOVE_IPL, "cargoship"); foreach (var badGuy in CleanupBag) { badGuy.Delete(); } CleanupBag.Clear(); foreach (var entry in rappelUpdates) { entry?.Clean(); } foreach (var rappelEntry in rappelStarted) { rappelEntry?.Clean(); } }
public void StartEntry(int entryPoint, Ped[] team) { float heading = 0f; switch (entryPoint) { case 0: // Front var entryPos = new Vector3(-74.42314f, 6271.079f, 31.3722f); heading = 216.744f; for (int index = 0; index < team.Length; index++) { team[index].Position = entryPos; team[index].Heading = heading; } var enforcermodel = new Model(VehicleHash.Riot); enforcermodel.Request(10); var enforcer = World.CreateVehicle(enforcermodel, new Vector3(-79.03268f, 6277.942f, 31.11718f), 32.41939f); enforcer.SirenActive = true; enforcer.OpenDoor(VehicleDoor.BackLeftDoor, false, true); enforcer.OpenDoor(VehicleDoor.BackRightDoor, false, true); CleanupBag.Add(enforcer); var polmodel2 = new Model(VehicleHash.Police2); polmodel2.Request(10); var polcar = World.CreateVehicle(polmodel2, new Vector3(-83.34383f, 6274.731f, 30.95424f), 324.9319f); var polcar3 = World.CreateVehicle(polmodel2, new Vector3(-76.00045f, 6281.345f, 31.03065f), 270.7873f); polcar.SirenActive = true; polcar3.SirenActive = true; CleanupBag.Add(polcar); CleanupBag.Add(polcar3); EntryComplete = true; break; case 1: // Back var entryPosBack = new Vector3(-133.1731f, 6133.387f, 31.43232f); heading = 43.69439f; Ped lastpedback = new Ped(0); for (int index = 0; index < team.Length; index++) { team[index].Position = entryPosBack; if (lastpedback.Exists()) { team[index].Position -= lastpedback.ForwardVector * 2; } team[index].Heading = heading; lastpedback = team[index]; } var enforcermodelb = new Model(VehicleHash.Riot); enforcermodelb.Request(10); var enforcerb = World.CreateVehicle(enforcermodelb, new Vector3(-127.5568f, 6144.007f, 31.25361f), 335.7838f); enforcerb.SirenActive = true; enforcerb.OpenDoor(VehicleDoor.BackLeftDoor, false, true); enforcerb.OpenDoor(VehicleDoor.BackRightDoor, false, true); CleanupBag.Add(enforcerb); var polmodel = new Model(VehicleHash.Police2); polmodel.Request(10); var polcar1 = World.CreateVehicle(polmodel, new Vector3(-143.3609f, 6126.71f, 31.22926f), 252.053f); polcar1.SirenActive = true; CleanupBag.Add(polcar1); EntryComplete = true; break; case 2: // Back2 var entryPos2 = new Vector3(-182.2727f, 6166.434f, 31.35259f); heading = 221.0143f; for (int index = 0; index < team.Length; index++) { team[index].Position = entryPos2; team[index].Heading = heading; } var enforcermodel2 = new Model(VehicleHash.Riot); enforcermodel2.Request(10); var enforcer2 = World.CreateVehicle(enforcermodel2, new Vector3(-187.0582f, 6171.55f, 31.13244f), 43.85089f); enforcer2.SirenActive = true; enforcer2.OpenDoor(VehicleDoor.BackLeftDoor, false, true); enforcer2.OpenDoor(VehicleDoor.BackRightDoor, false, true); CleanupBag.Add(enforcer2); EntryComplete = true; break; } }
public void StartEntry(int entryPoint, Ped[] team) { float heading = 0f; switch (entryPoint) { case 0: // Front var entryPos = new Vector3(-1793.309f, -1196.424f, 12.017f); heading = 51.61f; Ped lastped = new Ped(0); for (int index = 0; index < team.Length; index++) { team[index].Position = entryPos; if (lastped.Exists()) { team[index].Position -= lastped.ForwardVector * 2; } team[index].Heading = heading; lastped = team[index]; } var enforcermodel = new Model(VehicleHash.Riot); enforcermodel.Request(10); var enforcer = World.CreateVehicle(enforcermodel, new Vector3(-1794.152f, -1188.071f, 12.74f), 9.35f); enforcer.SirenActive = true; enforcer.OpenDoor(VehicleDoor.BackLeftDoor, false, true); enforcer.OpenDoor(VehicleDoor.BackRightDoor, false, true); CleanupBag.Add(enforcer); EntryComplete = true; break; case 1: // Water var model = new Model(VehicleHash.Predator); model.Request(10); var car = World.CreateVehicle(model, new Vector3(-1799.512f, -1230.37f, 0.568f), 139.47f ); CleanupBag.Add(car); entryPos = new Vector3(-1800.013f, -1227.414f, 1.66f); heading = 149.15f; foreach (Ped ped in team) { ped.Position = entryPos; ped.Heading = heading; } EntryComplete = true; break; case 2: // Rappel for (int i = 0; i < Convert.ToInt32(team.Length / 2); i++) { var rappel = new RappelEntry(new Vector3(-1492.215f, -1230.166f, 2.87f).Around(20f), new Vector3(-1837.12f, -1254.43f, 20.18f)); var team2 = team.Reverse().ToList(); for (int d = 0 + (2 * i); d < 2 + (2 * i); d++) { Ped t = team2[d]; rappel.AddPassenger(t); } rappelUpdates.Add(rappel); } break; } }
public void OnStartMission(Gamemodes gamemode) { Gamemode = gamemode; LoadIPL(); foreach (var veh in _decorativeVehicles.Where(x => x.EntryPoint == -1)) { var tmpMod = new Model(veh.Model); int counter = 0; do { tmpMod.Request(); counter++; Script.Yield(); } while (!tmpMod.IsLoaded && counter < 10000); if (counter >= 10000) { continue; } Vehicle tmpVeh = new Vehicle(Function.Call <int>(Hash.CREATE_VEHICLE, tmpMod.Hash, veh.Position.X, veh.Position.Y, veh.Position.Z, veh.Heading, false, false)); tmpVeh.SirenActive = veh.SirenActive; foreach (VehicleDoor door in veh.OpenDoors) { tmpVeh.OpenDoor(door, false, false); } CleanupBag.Add(tmpVeh); } var tmpposs = new List <Tuple <Vector3, float> >(_positions); var tmpMax = _maxEnemies; if (_maxEnemies == -1) { tmpMax = Enemy.Dice.Next(_positions.Count / 2, _positions.Count); } MaxEnemies = tmpMax; for (int i = 0; i < tmpMax; i++) { Enemy tmp; int ourPick = Enemy.Dice.Next(tmpposs.Count); Tuple <Vector3, float> ourTuple = tmpposs[ourPick]; tmp = new Enemy(ourTuple.Item1, ourTuple.Item2); tmpposs.RemoveAt(ourPick); tmp.Character.Task.GuardCurrentPosition(); BadGuys.Add(tmp); CleanupBag.Add(tmp.Character); } if (Gamemode == Gamemodes.BombDefusal) { BombDefused = false; _defusePercentage = 0; _defuseStart = null; IsDefusingBomb = false; var ourPick = _bombLocations[Enemy.Dice.Next(_bombLocations.Count)]; CurrentBomb = new Tuple <Vector3, float>(ourPick.Item1, ourPick.Item2); int counter = 0; var barrelM = new Model(1298403575); do { barrelM.Request(); counter++; Script.Yield(); } while (!barrelM.IsLoaded && counter < 2000); var barrel = World.CreateProp(barrelM, CurrentBomb.Item1 - new Vector3(0f, 0f, 1f), new Vector3(0f, 0f, CurrentBomb.Item2), false, false); barrel.FreezePosition = true; counter = 0; var bombM = new Model(929047740); do { bombM.Request(); counter++; Script.Yield(); } while (!bombM.IsLoaded && counter < 2000); var bomb = World.CreateProp(bombM, CurrentBomb.Item1 - new Vector3(0f, 0f, 0.2f), new Vector3(-90f, 0f, CurrentBomb.Item2), false, false); bomb.FreezePosition = true; CleanupBag.Add(barrel); CleanupBag.Add(bomb); } }