Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using GTA;
- using GTA.Native;
- using System;
- using System.Windows.Forms;
- public class NoExplosionOnCrash : Script
- {
- public NoExplosionOnCrash()
- {
- Tick += OnTick;
- Interval = 500;
- }
- void OnTick(object sender, EventArgs e)
- {
- Vehicle veh = Game.Player.Character.CurrentVehicle;
- if (CanWeUse(veh) && veh.Model.IsCar)
- {
- if(!veh.IsInvincible && veh.IsInAir)
- {
- if (veh.Speed > 20f)
- {
- veh.IsInvincible = true;
- }
- }
- if (veh.IsInvincible && !veh.IsInAir)
- {
- veh.IsInvincible = false;
- }
- }
- }
- bool CanWeUse(Entity entity)
- {
- return entity != null && entity.Exists();
- }
- }
Add Comment
Please, Sign In to add comment