Advertisement
jedijosh920

Bulletproof Script

Feb 18th, 2017
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.99 KB | None | 0 0
  1. using GTA;
  2. using GTA.Native;
  3. using GTA.Math;
  4. using System;
  5. using System.Windows.Forms;
  6.  
  7. /*
  8. Bulletproof Script by jedijosh920 for Grand Theft Auto V PC
  9. Requested by Joe Gillian
  10. */
  11.  
  12. namespace Bulletproof
  13. {
  14.     public class Main : Script
  15.     {
  16.         private Keys toggleKey = Keys.J;  // You can change the key to toggle the mod here.
  17.         private bool isBulletProof;
  18.    
  19.         public Main()
  20.         {
  21.             KeyDown += OnKeyDown;
  22.         }
  23.  
  24.         private void OnKeyDown(object sender, KeyEventArgs e)
  25.         {
  26.             if (e.KeyCode == toggleKey)
  27.             {
  28.                 isBulletProof = !isBulletProof;
  29.            
  30.                 if (isBulletProof)
  31.                 {
  32.                     Function.Call(Hash.SET_ENTITY_PROOFS, Game.Player.Character, true, false, false, false, false, false, false, false);
  33.                 }
  34.                 else
  35.                 {
  36.                     Function.Call(Hash.SET_ENTITY_PROOFS, Game.Player.Character, false, false, false, false, false, false, false, false);
  37.                 }
  38.                
  39.                 UI.ShowSubtitle("Player is " + (isBulletProof) ? " ~g~now bulletproof!" : " ~r~not bulletproof.", 2500);
  40.             }
  41.         }
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement