SHARE
TWEET

NoExplosionOnCrash

Eddlm Feb 16th, 2016 266 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using GTA;
  2. using GTA.Native;
  3. using System;
  4. using System.Windows.Forms;
  5.  
  6. public class NoExplosionOnCrash : Script
  7. {
  8.     public NoExplosionOnCrash()
  9.     {
  10.         Tick += OnTick;
  11.         Interval = 500;
  12.     }
  13.  
  14.     void OnTick(object sender, EventArgs e)
  15.     {
  16.         Vehicle veh = Game.Player.Character.CurrentVehicle;
  17.         if (CanWeUse(veh) && veh.Model.IsCar)
  18.         {
  19.             if(!veh.IsInvincible && veh.IsInAir)
  20.             {
  21.                 if (veh.Speed > 20f)
  22.                 {
  23.                     veh.IsInvincible = true;
  24.                 }
  25.             }
  26.             if (veh.IsInvincible && !veh.IsInAir)
  27.             {
  28.                 veh.IsInvincible = false;
  29.             }
  30.         }
  31.     }
  32.  
  33.     bool CanWeUse(Entity entity)
  34.     {
  35.         return entity != null && entity.Exists();
  36.     }
  37. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top