Advertisement
Guest User

SlowMoBT - Gamepad - Updated

a guest
May 28th, 2017
537
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.15 KB | None | 0 0
  1. using GTA; // This is a reference that is needed! do not edit this
  2. using GTA.Native; // This is a reference that is needed! do not edit this
  3. using System; // This is a reference that is needed! do not edit this
  4. using System.Windows.Forms; // This is a reference that is needed! do not edit this
  5.  
  6. namespace SlomoBT
  7. {
  8.     public class SlomoBT : Script // declare Modname as a script
  9.     {
  10.         bool toggle = false;
  11.         bool toggle2 = false;
  12.         public SlomoBT() // main function
  13.         {
  14.             Tick += this.OnTick;
  15.             KeyDown += this.OnKeyDown;
  16.             KeyUp += this.OnKeyUp;
  17.             Interval = 1;
  18.         }
  19.  
  20.         void OnTick(object sender, EventArgs e) // This is where most of your script goes
  21.         {
  22.             Ped player = Game.Player.Character; // player variable
  23.             Vehicle veh = Game.Player.Character.CurrentVehicle; // vehicle variable
  24.             bool invehicle = Function.Call<bool>(Hash.IS_PED_SITTING_IN_ANY_VEHICLE, player);
  25.             if (Game.IsControlPressed(2, GTA.Control.Aim)) //Turn on script with Aim key + Dpad Down
  26.             {
  27.                 Game.DisableControl(2, GTA.Control.Phone);
  28.                 if (Game.IsControlPressed(2, GTA.Control.PhoneDown) && Game.CurrentInputMode == InputMode.GamePad)// || (Game.IsControlPressed(2, GTA.Control.Phone) && Game.CurrentInputMode == InputMode.MouseAndKeyboard))
  29.                 {
  30.                     if (toggle)
  31.                     {
  32.                         toggle = false;
  33.                         UI.ShowSubtitle("Bullet Time OFF");
  34.                         GTA.Native.Function.Call(Hash.SET_TIME_SCALE, 1.0f); //return to normal speed when script is OFF
  35.                         Wait(300);
  36.                     }
  37.                     else if (!toggle)
  38.                     {
  39.                         toggle = true;
  40.                         UI.ShowSubtitle("Bullet Time ON");
  41.                         GTA.Native.Function.Call(Hash.SET_TIME_SCALE, 0.25f); //How slow the game will be when the script is enabled (Default = 25% of normal speed)
  42.                         Wait(300);
  43.                     }
  44.                 }
  45.             }
  46.            
  47.             if (toggle)
  48.             {
  49.                 if (invehicle)
  50.                 {
  51.                     if (Game.Player.IsAiming)
  52.                     {
  53.                         GTA.Native.Function.Call(Hash.SET_TIME_SCALE, 0.2f); //How slow the game will be when the script is enabled and you are aiming while in a vehicle (Default = 20% of normal speed)
  54.                     }
  55.                     else
  56.                     {
  57.                         GTA.Native.Function.Call(Hash.SET_TIME_SCALE, 1.0f); //return to normal speed when script is ON while in a vehicle and you are NOT aiming
  58.                     }
  59.                 }
  60.                 else
  61.                 {
  62.                     if (Game.Player.IsAiming)
  63.                     {
  64.                         GTA.Native.Function.Call(Hash.SET_TIME_SCALE, 0.25f); //How slow the game will be when the script is enabled and you are aiming (Default = 25% of normal speed)
  65.                     }
  66.                     else
  67.                     {
  68.                         GTA.Native.Function.Call(Hash.SET_TIME_SCALE, 1.0f); //return to normal speed when script is ON and you are NOT aiming
  69.                     }
  70.                 }
  71.             }
  72.         }
  73.  
  74.         void OnKeyDown(object sender, KeyEventArgs e)
  75.         {
  76.         }
  77.  
  78.         void OnKeyUp(object sender, KeyEventArgs e)
  79.         {
  80.         }
  81.     }
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement