Advertisement
Guest User

GTAV script fixed

a guest
Apr 26th, 2017
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. //gta stuff
  9. using GTA;
  10. using GTA.Native;
  11. using GTA.Math;
  12.  
  13. namespace Mod_name_was_here
  14. {
  15.     public class AIstartUP : Script
  16.     {
  17.         public AIstartUP()
  18.         {
  19.             LoadSettings();
  20.             Tick += OnTick;
  21.             KeyDown += OnKeyDown;
  22.         }
  23.  
  24.         private void LoadSettings()
  25.         {
  26.             UI.ShowSubtitle("Custom Mod Installed!", 5000);
  27.             //call fun
  28.         }
  29.  
  30.         private void OnTick(object sender, EventArgs e)
  31.         {
  32.            
  33.         }
  34.  
  35.         private void OnKeyDown(object sender, KeyEventArgs e)
  36.         {
  37.             if (e.KeyCode == Keys.J)
  38.             {
  39.                 RemoveAllPeds();
  40.  
  41.  
  42.             }
  43.         }
  44.  
  45.         private void RemoveAllPeds()
  46.         {
  47.             Vector3 pos = Game.Player.Character.Position;
  48.  
  49.             Function.Call(Hash.SET_PED_POPULATION_BUDGET, false);
  50.             Function.Call(Hash.SET_VEHICLE_POPULATION_BUDGET, false);
  51.             Function.Call(Hash.CLEAR_AREA_OF_PEDS, pos.X, pos.Y, pos.Z, 10000, 1); //last parameter is an int, not a boolean
  52.             Function.Call(Hash.CLEAR_AREA_OF_VEHICLES, pos.X, pos.Y, pos.Z, 10000, true, true, true, true, true);
  53.  
  54.  
  55.  
  56.             UI.ShowSubtitle("Attempting to Remove All peds and cars!", 5000);
  57.         }
  58.     }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement