Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using GTA; // This is a reference that is needed! do not edit this
- using GTA.Native; // This is a reference that is needed! do not edit this
- using System; // This is a reference that is needed! do not edit this
- using System.Windows.Forms; // This is a reference that is needed! do not edit this
- namespace SlomoBT
- {
- public class SlomoBT : Script // declare Modname as a script
- {
- bool toggle = false;
- bool toggle2 = false;
- public SlomoBT() // main function
- {
- Tick += this.OnTick;
- KeyDown += this.OnKeyDown;
- KeyUp += this.OnKeyUp;
- Interval = 1;
- }
- void OnTick(object sender, EventArgs e) // This is where most of your script goes
- {
- Ped player = Game.Player.Character; // player variable
- Vehicle veh = Game.Player.Character.CurrentVehicle; // vehicle variable
- bool invehicle = Function.Call<bool>(Hash.IS_PED_SITTING_IN_ANY_VEHICLE, player);
- //In the next line, change "Menu" to any other key you want to use.
- //Available Keys: https://msdn.microsoft.com/en-us/library/system.windows.forms.keys(v=vs.110).aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1
- //Default is "Menu", which is the ALT key.
- if (Game.IsKeyPressed(Keys.Menu) && Game.CurrentInputMode == InputMode.MouseAndKeyboard)
- {
- if (toggle)
- {
- toggle = false;
- UI.ShowSubtitle("Bullet Time OFF");
- GTA.Native.Function.Call(Hash.SET_TIME_SCALE, 1.0f); //return to normal speed when script is OFF
- Wait(300);
- }
- else if (!toggle)
- {
- toggle = true;
- UI.ShowSubtitle("Bullet Time ON");
- 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)
- Wait(300);
- }
- }
- if (toggle)
- {
- if (invehicle)
- {
- if (Game.Player.IsAiming)
- {
- 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)
- }
- else
- {
- 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
- }
- }
- else
- {
- if (Game.Player.IsAiming)
- {
- 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)
- }
- else
- {
- GTA.Native.Function.Call(Hash.SET_TIME_SCALE, 1.0f); //return to normal speed when script is ON and you are NOT aiming
- }
- }
- }
- }
- void OnKeyDown(object sender, KeyEventArgs e)
- {
- }
- void OnKeyUp(object sender, KeyEventArgs e)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement