Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using GTA;
- using System;
- using System.Windows.Forms;
- using GTA.Math;
- using GTA.Native;
- public class sprsr_onOff : Script
- {
- ScriptSettings config;
- string text;
- private bool supp;
- private Keys SuppressorOn;
- private bool supp2;
- private Keys SuppressorOff;
- public sprsr_onOff()
- {
- KeyUp += OnKeyUp;
- Interval = 10;
- config = ScriptSettings.Load("scripts\\SupressorOn_Off.ini"); //For the config
- SuppressorOn = config.GetValue<Keys>("Options", "SuppressorOn", Keys.O); //For the config
- config = ScriptSettings.Load("scripts\\SupressorOn_Off.ini"); //For the config
- SuppressorOff = config.GetValue<Keys>("Options", "SuppressorOff", Keys.I); //For the config
- }
- void OnKeyUp(object sender, KeyEventArgs e)
- {
- Ped p = Game.Player.Character; //Define variable for the player's character
- if (e.KeyCode == SuppressorOn) //To turn suppressor on
- {
- p.Weapons.Current.SetComponent(WeaponComponent.AtArSupp, true);
- p.Weapons.Current.SetComponent(WeaponComponent.AtArSupp02, true);
- p.Weapons.Current.SetComponent(WeaponComponent.AtPiSupp, true);
- p.Weapons.Current.SetComponent(WeaponComponent.AtPiSupp02, true);
- p.Weapons.Current.SetComponent(WeaponComponent.AtSrSupp, true);
- }
- if (e.KeyCode == SuppressorOff) //To turn suppressor off
- {
- p.Weapons.Current.SetComponent(WeaponComponent.AtArSupp, false);
- p.Weapons.Current.SetComponent(WeaponComponent.AtArSupp02, false);
- p.Weapons.Current.SetComponent(WeaponComponent.AtPiSupp, false);
- p.Weapons.Current.SetComponent(WeaponComponent.AtPiSupp02, false);
- p.Weapons.Current.SetComponent(WeaponComponent.AtSrSupp, false);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement