Advertisement
Eddlm

Burnout Wheelie sourcecode

Oct 27th, 2015
1,458
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.54 KB | None | 0 0
  1. /* This is the sourcecode of https://www.gta5-mods.com/scripts/burnout-wheelie
  2. It uses APPLY_FORCE_TO_ENTITY to rotate the vehicle backwards when it's on ground, making the vehicle lift it's front, doing a wheelie*/
  3.  
  4.  
  5.  
  6.  
  7. using GTA;
  8. using GTA.Native;
  9. using System;
  10. using System.Windows.Forms;
  11.  
  12.  
  13.  
  14. public class Wheelies : Script
  15. {
  16.     int wheeliepoints;
  17.     float height;
  18.     public Wheelies()
  19.     {
  20.         Tick += OnTick;
  21.         KeyDown += OnKeyDown;
  22.         KeyUp += OnKeyUp;
  23.     }
  24.     bool CanWeUse(Entity entity)
  25.     {
  26.         return entity != null && entity.Exists();
  27.     }
  28.     void OnTick(object sender, EventArgs e)
  29.     {
  30.         if (CanWeUse(Game.Player.Character.CurrentVehicle) && Game.Player.Character.CurrentVehicle.IsInBurnout())
  31.         {
  32.             height = Function.Call<float>(Hash.GET_ENTITY_HEIGHT_ABOVE_GROUND, Game.Player.Character.CurrentVehicle);
  33.             wheeliepoints++;
  34.         }
  35.  
  36.         if (Game.Player.Character.IsOnFoot && wheeliepoints>0)
  37.         {
  38.             wheeliepoints = 0;
  39.         }
  40.  
  41.         if (Game.IsControlPressed(2, GTA.Control.VehicleAccelerate) && CanWeUse(Game.Player.Character.CurrentVehicle) && wheeliepoints > 0 && !Game.Player.Character.CurrentVehicle.IsInBurnout() && Function.Call<float>(Hash.GET_ENTITY_HEIGHT_ABOVE_GROUND, Game.Player.Character.CurrentVehicle) < height+0.5f && Function.Call<bool>(GTA.Native.Hash.IS_ENTITY_UPRIGHT, Game.Player.Character.CurrentVehicle,20f))
  42.         {
  43.             wheeliepoints--;
  44.             switch (Function.Call<int>(GTA.Native.Hash.GET_VEHICLE_CLASS, Game.Player.Character.CurrentVehicle))
  45.             {
  46.                 case 10:
  47.                     {
  48.                         Function.Call(Hash.APPLY_FORCE_TO_ENTITY, Game.Player.Character.CurrentVehicle, 3, 0f, 0.5f, 0f, 0f, 0f, -2f, 0, true, true, true, true);
  49.                         return;
  50.                     }
  51.                 default:
  52.                     {
  53.                         Function.Call(Hash.APPLY_FORCE_TO_ENTITY, Game.Player.Character.CurrentVehicle, 3, 0f, 0.5f, 0f, 0f, 0f, -1f, 0, true, true, true, true);
  54.                         return;
  55.                     }
  56.             }
  57.  
  58.         }
  59.  
  60.  
  61.  
  62.         if (wheeliepoints > 0 && (Game.IsControlPressed(2, GTA.Control.VehicleHandbrake) || Game.IsControlPressed(2, GTA.Control.VehicleBrake)) && Game.Player.Character.CurrentVehicle.Speed > 2f)
  63.         {
  64.             wheeliepoints = 0;
  65.         }
  66.     }
  67.     void OnKeyDown(object sender, KeyEventArgs e)
  68.     {
  69.  
  70.     }
  71.     void OnKeyUp(object sender, KeyEventArgs e)
  72.     {
  73.  
  74.     }
  75.  
  76. b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement