Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* This is the sourcecode of https://www.gta5-mods.com/scripts/burnout-wheelie
- 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*/
- using GTA;
- using GTA.Native;
- using System;
- using System.Windows.Forms;
- public class Wheelies : Script
- {
- int wheeliepoints;
- float height;
- public Wheelies()
- {
- Tick += OnTick;
- KeyDown += OnKeyDown;
- KeyUp += OnKeyUp;
- }
- bool CanWeUse(Entity entity)
- {
- return entity != null && entity.Exists();
- }
- void OnTick(object sender, EventArgs e)
- {
- if (CanWeUse(Game.Player.Character.CurrentVehicle) && Game.Player.Character.CurrentVehicle.IsInBurnout())
- {
- height = Function.Call<float>(Hash.GET_ENTITY_HEIGHT_ABOVE_GROUND, Game.Player.Character.CurrentVehicle);
- wheeliepoints++;
- }
- if (Game.Player.Character.IsOnFoot && wheeliepoints>0)
- {
- wheeliepoints = 0;
- }
- 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))
- {
- wheeliepoints--;
- switch (Function.Call<int>(GTA.Native.Hash.GET_VEHICLE_CLASS, Game.Player.Character.CurrentVehicle))
- {
- case 10:
- {
- Function.Call(Hash.APPLY_FORCE_TO_ENTITY, Game.Player.Character.CurrentVehicle, 3, 0f, 0.5f, 0f, 0f, 0f, -2f, 0, true, true, true, true);
- return;
- }
- default:
- {
- Function.Call(Hash.APPLY_FORCE_TO_ENTITY, Game.Player.Character.CurrentVehicle, 3, 0f, 0.5f, 0f, 0f, 0f, -1f, 0, true, true, true, true);
- return;
- }
- }
- }
- if (wheeliepoints > 0 && (Game.IsControlPressed(2, GTA.Control.VehicleHandbrake) || Game.IsControlPressed(2, GTA.Control.VehicleBrake)) && Game.Player.Character.CurrentVehicle.Speed > 2f)
- {
- wheeliepoints = 0;
- }
- }
- void OnKeyDown(object sender, KeyEventArgs e)
- {
- }
- void OnKeyUp(object sender, KeyEventArgs e)
- {
- }
- b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement