Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var local = Entity.GetLocalPlayer();
- var wepList = {
- 0: "SMG",
- 1: "Heavy Pistol",
- };
- runTime = Global.Curtime();
- var secondsElapsed = 0;
- var waiting = 0;
- setup();
- function weaponType() {
- weapon = Entity.GetName(Entity.GetWeapon(local));
- weapons = {
- "r8 revolver": "Heavy Pistol",
- "desert eagle": "Heavy Pistol",
- "mp9": "SMG",
- "mac 10": "SMG",
- "ump 45": "SMG",
- "p90": "SMG",
- "pp bizon": "SMG",
- "mp7": "SMG",
- "mp5 sd": "SMG"
- };
- return weapons[weapon];
- }
- function inAir() {
- if (!UI.GetValue("Script items", "[IAHC] Enable In-Air Hitchance"))
- return;
- if (weaponType() == undefined)
- return;
- wep = weaponType().toUpperCase();
- if (wep == "SMG")
- wep = "GENERAL";
- fv = Entity.GetProp(local, "CBasePlayer", "m_flFallVelocity");
- inAirHC = UI.GetValue("Script items", "[IAHC] " + weaponType() + " In-Air Hitchance");
- baseHC = UI.GetValue("Script items", "[IAHC] " + weaponType() + " Base Hitchance");
- if (fv < 1 && fv > -1) {
- if (waiting == 1 && secondsElapsed < 10) {
- UI.SetValue("Rage", wep, "Accuracy", "Hitchance", baseHC - 30);
- } else {
- UI.SetValue("Rage", wep, "Accuracy", "Hitchance", baseHC);
- waiting = 0;
- secondsElapsed = 0;
- }
- } else {
- UI.SetValue("Rage", wep, "Accuracy", "Hitchance", baseHC);
- waiting = 1;
- }
- }
- function drawInMenu() {
- if (!UI.GetValue("Script items", "[IAHC] Enable In-Air Hitchance")) {
- UI.SetEnabled("Script items", "[IAHC] Enabled Weapons", false);
- UI.SetEnabled("Script items", "[IAHC] Weapon Config", false);
- return;
- }
- UI.SetEnabled("Script items", "[IAHC] Enabled Weapons", true);
- UI.SetEnabled("Script items", "[IAHC] Weapon Config", true);
- enabled = UI.GetValue("Script items", "[IAHC] Enabled Weapons");
- currWep = UI.GetString("Script items", "[IAHC] Weapon Config");
- showHvyPistol = ((enabled == 1 || enabled == 3) && currWep == "Heavy Pistol") ? true : false;
- showSMG = ((enabled == 2 || enabled == 3) && currWep == "SMG") ? true : false;
- UI.SetEnabled("Script items", "[IAHC] Heavy Pistol Base Hitchance", showHvyPistol);
- UI.SetEnabled("Script items", "[IAHC] Heavy Pistol In-Air Hitchance", showHvyPistol);
- UI.SetEnabled("Script items", "[IAHC] SMG Base Hitchance", showSMG);
- UI.SetEnabled("Script items", "[IAHC] SMG In-Air Hitchance", showSMG);
- }
- function setup() {
- UI.AddCheckbox("[IAHC] Enable In-Air Hitchance");
- UI.AddMultiDropdown("[IAHC] Enabled Weapons", ["Heavy Pistol", "SMG"]);
- UI.AddDropdown("[IAHC] Weapon Config", ["Heavy Pistol", "SMG"]);
- UI.SetEnabled("Script items", "[IAHC] Enabled Weapons", false);
- UI.SetEnabled("Script items", "[IAHC] Weapon Config", false);
- for (wep in wepList) {
- UI.AddSliderInt("[IAHC] " + wepList[wep] + " Base Hitchance", 0, 100);
- UI.AddSliderInt("[IAHC] " + wepList[wep] + " In-Air Hitchance", 0, 100);
- UI.SetEnabled("Script items", "[IAHC] " + wepList[wep] + " In-Air Hitchance", false);
- UI.SetEnabled("Script items", "[IAHC] " + wepList[wep] + " Base Hitchance", false);
- }
- }
- function check() {
- if (waiting == 1) {
- if (Global.Curtime() - runTime > .1) {
- runTime = Global.Curtime();
- secondsElapsed += 1;
- }
- }
- }
- Global.RegisterCallback("Draw", "drawInMenu");
- Global.RegisterCallback("Draw", "check");
- Global.RegisterCallback("Draw", "inAir");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement