Advertisement
Guest User

main class

a guest
Apr 26th, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. //keys
  7. using System.Windows.Forms;
  8. using System.Drawing;
  9. //gta stuff
  10. using GTA;
  11. using GTA.Native;
  12. using GTA.Math;
  13. using NativeUI;
  14.  
  15.  
  16. namespace TyronZombies
  17. {
  18. public class Warmup : Script
  19. {
  20. public Warmup()
  21. {
  22. LoadSettings();
  23. Tick += OnTick; // CallEveryFrame
  24. KeyDown += OnKeyDown; // CallOnKeyPress
  25.  
  26. }
  27.  
  28. private void LoadSettings()
  29. {
  30. UI.Notify(" Mod Installed!");
  31. RemoveAllPeds();
  32. }
  33.  
  34. private void OnTick(object sender, EventArgs e)
  35. {
  36. if (Game.Player.WantedLevel != 0)
  37. {
  38. Game.Player.WantedLevel = 0;
  39. }
  40. }
  41.  
  42. private void OnKeyDown(object sender, KeyEventArgs e)
  43. {
  44. if (e.KeyCode == Keys.J)
  45. {
  46. Vector3 spawnpos = Game.Player.Character.GetOffsetInWorldCoords(new Vector3(0,5,0));
  47. Vehicle Zombie = World.CreateVehicle(VehicleHash.Turismor, spawnpos);
  48. UI.Notify("Spawned car");
  49.  
  50. try
  51. {
  52. Vector3 spawnpos1 = Game.Player.Character.GetOffsetInWorldCoords(new Vector3(0, 5, 0));
  53. Ped Zambie = World.CreatePed(PedHash.Bodybuild01AFM, spawnpos1);
  54. UI.Notify("Spawned zombie");
  55.  
  56. }
  57. catch (Exception er)
  58. {
  59. UI.Notify(er.Message);
  60. }
  61. }
  62. }
  63.  
  64. private void RemoveAllPeds()
  65. {
  66. //STREAMING::SET_PED_POPULATION_BUDGET(false);
  67. //STREAMING::SET_VEHICLE_POPULATION_BUDGET(false);
  68. //GAMEPLAY::CLEAR_AREA_OF_PEDS(0, 0, 0, 10000, true);
  69. //GAMEPLAY::CLEAR_AREA_OF_VEHICLES(0, 0, 0, 10000, true, true, true, true, true);
  70.  
  71. UI.Notify("Attempting to Remove All Peds and Ped Vehicles!");
  72. Function.Call(Hash.SET_PED_POPULATION_BUDGET, false);
  73. Function.Call(Hash.SET_VEHICLE_POPULATION_BUDGET, false);
  74. Function.Call(Hash.CLEAR_AREA_OF_PEDS, 0, 0, 0, 10000, true);
  75. Function.Call(Hash.CLEAR_AREA_OF_VEHICLES, 0, 0, 0, 10000, true, true, true, true, true);
  76. //Function.Call(Hash.pol);
  77. }
  78. }
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement