public override void SpawnEntities() { Vector3 spawn = GetSpawnPoint(); if (IsValidSpawn(spawn)) { DropType[] dropTypes = (DropType[])Enum.GetValues(typeof(DropType)); DropType randDrop = _dropType = dropTypes[Database.Random.Next(dropTypes.Length)]; string model = (_dropType == DropType.Weapons) ? "prop_mil_crate_01" : "ex_prop_crate_closed_bc"; _prop = World.CreateProp(model, spawn, Vector3.Zero, false, false); if (_prop == null) { Complete(); } else { Vector3 position = _prop.Position; _blip = World.CreateBlip(position.Around(45f), 145f); _blip.Color = GTA.BlipColor.Yellow; _blip.Alpha = 150; _dropZone = _blip.Position; position = _prop.Position; Vector3 particlePos = position.Around(5f); _particle = WorldExtended.CreateParticleEffectAtCoord(particlePos, "exp_grd_flare"); _particle.Color = Color.LightGoldenrodYellow; int rand = Database.Random.Next(3, 6); for (int i = 0; i <= rand; i++) { Vector3 pedSpawn = spawn.Around(10f); PedHash pedHash = _pedHashes[Database.Random.Next(_pedHashes.Length)]; Ped ped = World.CreatePed(pedHash, pedSpawn); if (!(ped == null)) { if (i > 0) { ped.Weapons.Give(_weapons[Database.Random.Next(_weapons.Length)], 45, true, true); } else { ped.Weapons.Give(GTA.Native.WeaponHash.SniperRifle, 15, true, true); } ped.Accuracy = 100; ped.Task.GuardCurrentPosition(); ped.RelationshipGroup = Relationships.MilitiaRelationship; _pedGroup.Add(ped, i == 0); _peds.Add(ped); EntityEventWrapper pedWrapper = new EntityEventWrapper(ped); pedWrapper.Died += PedWrapperOnDied; } } Model val = "mesa3"; position = _prop.Position; World.CreateVehicle(val, World.GetNextPositionOnStreet(position.Around(25f))); UI.Notify(string.Format("~y~Merryweather~s~ {0} drop nearby.", (_dropType == DropType.Loot) ? "loot" : "weapons")); } } }
private void OnTick(object sender, EventArgs e) { if (WorldController.Configure) { WorldExtended.ClearCops(10000f); WorldExtended.SetScenarioPedDensityThisMultiplierFrame(0.0f); WorldExtended.SetVehicleDensityMultiplierThisFrame(0.0f); WorldExtended.SetRandomVehicleDensityMultiplierThisFrame(0.0f); WorldExtended.SetParkedVehicleDensityMultiplierThisFrame(0.0f); WorldExtended.SetPedDensityThisMultiplierFrame(0.0f); WorldExtended.SetScenarioPedDensityThisMultiplierFrame(0.0f); Game.set_MaxWantedLevel(0); // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field // ISSUE: method pointer Vehicle[] array = ((IEnumerable <Vehicle>)Enumerable.Where <Vehicle>((IEnumerable <M0>)World.GetAllVehicles(), (Func <M0, bool>)(WorldController.\u003C\u003Ec.\u003C\u003E9__14_0 ?? (WorldController.\u003C\u003Ec.\u003C\u003E9__14_0 = new Func <Vehicle, bool>((object)WorldController.\u003C\u003Ec.\u003C\u003E9, __methodptr(\u003COnTick\u003Eb__14_0)))))).ToArray <Vehicle>(); Vehicle[] all1 = Array.FindAll <Vehicle>(array, (Predicate <Vehicle>)(v => v.get_ClassType() == 16)); Vehicle[] all2 = Array.FindAll <Vehicle>(array, (Predicate <Vehicle>)(v => v.get_ClassType() == 21)); Array.ForEach <Vehicle>(Array.FindAll <Vehicle>(array, (Predicate <Vehicle>)(v => { if (((Entity)v.get_Driver()).Exists()) { return(!v.get_Driver().get_IsPlayer()); } return(false); })), (Action <Vehicle>)(vehicle => ((Entity)vehicle).Delete())); Array.ForEach <Vehicle>(all1, (Action <Vehicle>)(plane => { if (!((Entity)plane.get_Driver()).Exists() || plane.get_Driver().get_IsPlayer() || ((Entity)plane.get_Driver()).get_IsDead()) { return; } plane.get_Driver().Kill(); })); Array.ForEach <Vehicle>(all2, (Action <Vehicle>)(t => Function.Call((Hash) - 6193635740946557213L, new InputArgument[2] { InputArgument.op_Implicit(((Entity)t).get_Handle()), InputArgument.op_Implicit(0.0f) }))); ScriptExtended.TerminateScriptByName("re_prison"); ScriptExtended.TerminateScriptByName("am_prison"); ScriptExtended.TerminateScriptByName("gb_biker_free_prisoner"); ScriptExtended.TerminateScriptByName("re_prisonvanbreak"); ScriptExtended.TerminateScriptByName("am_vehicle_spawn"); ScriptExtended.TerminateScriptByName("am_taxi"); ScriptExtended.TerminateScriptByName("audiotest"); ScriptExtended.TerminateScriptByName("freemode"); ScriptExtended.TerminateScriptByName("re_prisonerlift"); ScriptExtended.TerminateScriptByName("am_prison"); ScriptExtended.TerminateScriptByName("re_lossantosintl"); ScriptExtended.TerminateScriptByName("re_armybase"); ScriptExtended.TerminateScriptByName("restrictedareas"); ScriptExtended.TerminateScriptByName("stripclub"); ScriptExtended.TerminateScriptByName("re_gangfight"); ScriptExtended.TerminateScriptByName("re_gang_intimidation"); ScriptExtended.TerminateScriptByName("spawn_activities"); ScriptExtended.TerminateScriptByName("am_vehiclespawn"); ScriptExtended.TerminateScriptByName("traffick_air"); ScriptExtended.TerminateScriptByName("traffick_ground"); ScriptExtended.TerminateScriptByName("emergencycall"); ScriptExtended.TerminateScriptByName("emergencycalllauncher"); ScriptExtended.TerminateScriptByName("clothes_shop_sp"); ScriptExtended.TerminateScriptByName("gb_rob_shop"); ScriptExtended.TerminateScriptByName("gunclub_shop"); ScriptExtended.TerminateScriptByName("hairdo_shop_sp"); ScriptExtended.TerminateScriptByName("re_shoprobbery"); ScriptExtended.TerminateScriptByName("shop_controller"); ScriptExtended.TerminateScriptByName("re_crashrescue"); ScriptExtended.TerminateScriptByName("re_rescuehostage"); ScriptExtended.TerminateScriptByName("fm_mission_controller"); ScriptExtended.TerminateScriptByName("player_scene_m_shopping"); ScriptExtended.TerminateScriptByName("shoprobberies"); ScriptExtended.TerminateScriptByName("re_atmrobbery"); ScriptExtended.TerminateScriptByName("ob_vend1"); ScriptExtended.TerminateScriptByName("ob_vend2"); Function.Call((Hash) - 6788369613215147455L, new InputArgument[2] { InputArgument.op_Implicit("PRISON_ALARMS"), InputArgument.op_Implicit(0) }); Function.Call((Hash)2417821992125818111L, new InputArgument[3] { InputArgument.op_Implicit("AZ_COUNTRYSIDE_PRISON_01_ANNOUNCER_GENERAL"), InputArgument.op_Implicit(0), InputArgument.op_Implicit(0) }); Function.Call((Hash)2417821992125818111L, new InputArgument[3] { InputArgument.op_Implicit("AZ_COUNTRYSIDE_PRISON_01_ANNOUNCER_WARNING"), InputArgument.op_Implicit(0), InputArgument.op_Implicit(0) }); Function.Call((Hash) - 563637040166458307L, new InputArgument[7] { InputArgument.op_Implicit((int)Function.Call <int>((Hash) - 3292914402564945716L, new InputArgument[1] { InputArgument.op_Implicit("prop_gate_prison_01") })), InputArgument.op_Implicit(1845f), InputArgument.op_Implicit(2605f), InputArgument.op_Implicit(45f), InputArgument.op_Implicit(false), InputArgument.op_Implicit(0), InputArgument.op_Implicit(0) }); Function.Call((Hash) - 7272475972733243984L, new InputArgument[7] { InputArgument.op_Implicit((int)Function.Call <int>((Hash) - 3292914402564945716L, new InputArgument[1] { InputArgument.op_Implicit("prop_gate_prison_01") })), InputArgument.op_Implicit(1819.27f), InputArgument.op_Implicit(2608.53f), InputArgument.op_Implicit(44.61f), InputArgument.op_Implicit(false), InputArgument.op_Implicit(0), InputArgument.op_Implicit(0) }); if (!this._reset) { return; } Function.Call((Hash)6837250382999549709L, new InputArgument[1] { InputArgument.op_Implicit(false) }); Function.Call((Hash) - 8916161055282871969L, new InputArgument[1] { InputArgument.op_Implicit(false) }); Function.Call((Hash) - 9162020105814915111L, new InputArgument[1] { InputArgument.op_Implicit(false) }); Function.Call((Hash)3097765567273685773L, new InputArgument[1] { InputArgument.op_Implicit(false) }); Function.Call((Hash) - 606238161783359907L, new InputArgument[1] { InputArgument.op_Implicit(false) }); this._reset = false; } else { if (this._reset) { return; } WorldController.Reset(); this._reset = true; } }
private void ConfigureMenu() { MainMenu = new UIMenu("Simple Zombies", "SELECT AN OPTION"); MenuConrtoller.MenuPool.Add(MainMenu); UIMenuCheckboxItem infectionCheckbox = new UIMenuCheckboxItem("Infection Mode", false, "Enable/Disable zombies."); infectionCheckbox.CheckboxEvent += delegate(UIMenuCheckboxItem sender, bool @checked) { ZombieVehicleSpawner.Instance.Spawn = @checked; Loot247.Instance.Spawn = @checked; WorldController.Configure = @checked; AnimalSpawner.Instance.Spawn = @checked; if (@checked) { WorldExtended.ClearAreaOfEverything(Database.PlayerPosition, 10000f); Function.Call(GTA.Native.Hash.REQUEST_IPL, (InputArgument[])new InputArgument[1] { "cs3_07_mpgates" }); } }; UIMenuCheckboxItem fastZombiesCheckbox = new UIMenuCheckboxItem("Fast Zombies", false, "Enable/Disable running zombies."); fastZombiesCheckbox.CheckboxEvent += delegate(UIMenuCheckboxItem sender, bool @checked) { ZombieCreator.Runners = @checked; }; UIMenuCheckboxItem electricityCheckBox = new UIMenuCheckboxItem("Electricity", true, "Enables/Disable blackout mode."); electricityCheckBox.CheckboxEvent += delegate(UIMenuCheckboxItem sender, bool @checked) { World.SetBlackout(!@checked); }; UIMenuCheckboxItem survivorsCheckBox = new UIMenuCheckboxItem("Survivors", false, "Enable/Disable survivors."); survivorsCheckBox.CheckboxEvent += delegate(UIMenuCheckboxItem sender, bool @checked) { SurvivorController.Instance.Spawn = @checked; }; UIMenuCheckboxItem statsCheckbox = new UIMenuCheckboxItem("Stats", true, "Enable/Disable stats."); statsCheckbox.CheckboxEvent += delegate(UIMenuCheckboxItem sender, bool @checked) { PlayerStats.UseStats = @checked; }; UIMenuItem loadItem = new UIMenuItem("Load", "Load the map, your vehicles and your bodyguards."); loadItem.SetLeftBadge(UIMenuItem.BadgeStyle.Heart); loadItem.Activated += delegate { PlayerMap.Instance.Deserialize(); PlayerVehicles.Instance.Deserialize(); PlayerGroupManager.Instance.Deserialize(); }; UIMenuItem saveCurrentVehicleItem = new UIMenuItem("Save", "Saves the vehicle you are currently in."); saveCurrentVehicleItem.SetLeftBadge(UIMenuItem.BadgeStyle.Car); saveCurrentVehicleItem.Activated += delegate { if (Database.PlayerCurrentVehicle == null || (Database.PlayerCurrentVehicle != null && !Database.PlayerCurrentVehicle.Exists())) { UI.Notify("You're not in a vehicle."); } else { PlayerVehicles.Instance.SaveVehicle(Database.PlayerCurrentVehicle); } }; UIMenuItem saveAllVehiclesItem = new UIMenuItem("Save All", "Saves all marked vehicles, and their positions."); saveAllVehiclesItem.SetLeftBadge(UIMenuItem.BadgeStyle.Car); saveAllVehiclesItem.Activated += delegate { PlayerVehicles.Instance.Serialize(true); }; UIMenuItem saveAllGuardsItem = new UIMenuItem("Save All", "Saves the player ped group (guards)."); saveAllGuardsItem.SetLeftBadge(UIMenuItem.BadgeStyle.Mask); saveAllGuardsItem.Activated += delegate { PlayerGroupManager.Instance.SavePeds(); }; MainMenu.AddItem(infectionCheckbox); MainMenu.AddItem(fastZombiesCheckbox); MainMenu.AddItem(electricityCheckBox); MainMenu.AddItem(survivorsCheckBox); MainMenu.AddItem(statsCheckbox); MainMenu.AddItem(loadItem); MainMenu.AddItem(saveCurrentVehicleItem); MainMenu.AddItem(saveAllVehiclesItem); MainMenu.AddItem(saveAllGuardsItem); MainMenu.RefreshIndex(); }
private void OnTick(object sender, EventArgs e) { if (Configure) { WorldExtended.ClearCops(10000f); WorldExtended.SetScenarioPedDensityThisMultiplierFrame(0f); WorldExtended.SetVehicleDensityMultiplierThisFrame(0f); WorldExtended.SetRandomVehicleDensityMultiplierThisFrame(0f); WorldExtended.SetParkedVehicleDensityMultiplierThisFrame(0f); WorldExtended.SetPedDensityThisMultiplierFrame(0f); WorldExtended.SetScenarioPedDensityThisMultiplierFrame(0f); Game.MaxWantedLevel = 0; Vehicle[] allVehicles = (from v in World.GetAllVehicles() where !v.IsPersistent select v).ToArray(); Vehicle[] planes = Array.FindAll(allVehicles, (Vehicle v) => (int)v.ClassType == 16); Vehicle[] trains = Array.FindAll(allVehicles, (Vehicle v) => (int)v.ClassType == 21); Vehicle[] drivers = Array.FindAll(allVehicles, (Vehicle v) => v.Driver.Exists() && !v.Driver.IsPlayer); Array.ForEach(drivers, delegate(Vehicle vehicle) { vehicle.Delete(); }); Array.ForEach(planes, delegate(Vehicle plane) { if (plane.Driver.Exists() && !plane.Driver.IsPlayer && !plane.Driver.IsDead) { plane.Driver.Kill(); } }); Array.ForEach(trains, delegate(Vehicle t) { Function.Call(GTA.Native.Hash.SET_TRAIN_SPEED, (InputArgument[])new InputArgument[2] { t.Handle, 0f }); }); ScriptExtended.TerminateScriptByName("re_prison"); ScriptExtended.TerminateScriptByName("am_prison"); ScriptExtended.TerminateScriptByName("gb_biker_free_prisoner"); ScriptExtended.TerminateScriptByName("re_prisonvanbreak"); ScriptExtended.TerminateScriptByName("am_vehicle_spawn"); ScriptExtended.TerminateScriptByName("am_taxi"); ScriptExtended.TerminateScriptByName("audiotest"); ScriptExtended.TerminateScriptByName("freemode"); ScriptExtended.TerminateScriptByName("re_prisonerlift"); ScriptExtended.TerminateScriptByName("am_prison"); ScriptExtended.TerminateScriptByName("re_lossantosintl"); ScriptExtended.TerminateScriptByName("re_armybase"); ScriptExtended.TerminateScriptByName("restrictedareas"); ScriptExtended.TerminateScriptByName("stripclub"); ScriptExtended.TerminateScriptByName("re_gangfight"); ScriptExtended.TerminateScriptByName("re_gang_intimidation"); ScriptExtended.TerminateScriptByName("spawn_activities"); ScriptExtended.TerminateScriptByName("am_vehiclespawn"); ScriptExtended.TerminateScriptByName("traffick_air"); ScriptExtended.TerminateScriptByName("traffick_ground"); ScriptExtended.TerminateScriptByName("emergencycall"); ScriptExtended.TerminateScriptByName("emergencycalllauncher"); ScriptExtended.TerminateScriptByName("clothes_shop_sp"); ScriptExtended.TerminateScriptByName("gb_rob_shop"); ScriptExtended.TerminateScriptByName("gunclub_shop"); ScriptExtended.TerminateScriptByName("hairdo_shop_sp"); ScriptExtended.TerminateScriptByName("re_shoprobbery"); ScriptExtended.TerminateScriptByName("shop_controller"); ScriptExtended.TerminateScriptByName("re_crashrescue"); ScriptExtended.TerminateScriptByName("re_rescuehostage"); ScriptExtended.TerminateScriptByName("fm_mission_controller"); ScriptExtended.TerminateScriptByName("player_scene_m_shopping"); ScriptExtended.TerminateScriptByName("shoprobberies"); ScriptExtended.TerminateScriptByName("re_atmrobbery"); ScriptExtended.TerminateScriptByName("ob_vend1"); ScriptExtended.TerminateScriptByName("ob_vend2"); Function.Call(GTA.Native.Hash.STOP_ALARM, (InputArgument[])new InputArgument[2] { "PRISON_ALARMS", 0 }); Function.Call(GTA.Native.Hash.CLEAR_AMBIENT_ZONE_STATE, (InputArgument[])new InputArgument[3] { "AZ_COUNTRYSIDE_PRISON_01_ANNOUNCER_GENERAL", 0, 0 }); Function.Call(GTA.Native.Hash.CLEAR_AMBIENT_ZONE_STATE, (InputArgument[])new InputArgument[3] { "AZ_COUNTRYSIDE_PRISON_01_ANNOUNCER_WARNING", 0, 0 }); int t3 = Function.Call <int>(GTA.Native.Hash.GET_HASH_KEY, (InputArgument[])new InputArgument[1] { "prop_gate_prison_01" }); Function.Call(GTA.Native.Hash.SET_STATE_OF_CLOSEST_DOOR_OF_TYPE, (InputArgument[])new InputArgument[7] { t3, 1845f, 2605f, 45f, false, 0, 0 }); int t2 = Function.Call <int>(GTA.Native.Hash.GET_HASH_KEY, (InputArgument[])new InputArgument[1] { "prop_gate_prison_01" }); Function.Call(GTA.Native.Hash._DOOR_CONTROL, (InputArgument[])new InputArgument[7] { t2, 1819.27f, 2608.53f, 44.61f, false, 0, 0 }); if (_reset) { Function.Call(GTA.Native.Hash.CAN_CREATE_RANDOM_COPS, (InputArgument[])new InputArgument[1] { false }); Function.Call(GTA.Native.Hash.SET_RANDOM_BOATS, (InputArgument[])new InputArgument[1] { false }); Function.Call(GTA.Native.Hash.SET_RANDOM_TRAINS, (InputArgument[])new InputArgument[1] { false }); Function.Call(GTA.Native.Hash.SET_GARBAGE_TRUCKS, (InputArgument[])new InputArgument[1] { false }); Function.Call(GTA.Native.Hash._0xF796359A959DF65D, (InputArgument[])new InputArgument[1] { false }); _reset = false; } } else if (!_reset) { Reset(); _reset = true; } }