/*

██████╗░░█████╗░░█████╗░██╗░░██╗███████╗████████╗░░░████████╗███████╗░█████╗░██╗░░██╗
██╔══██╗██╔══██╗██╔══██╗██║░██╔╝██╔════╝╚══██╔══╝░░░╚══██╔══╝██╔════╝██╔══██╗██║░░██║
██████╔╝██║░░██║██║░░╚═╝█████═╝░█████╗░░░░░██║░░░░░░░░░██║░░░█████╗░░██║░░╚═╝███████║
██╔══██╗██║░░██║██║░░██╗██╔═██╗░██╔══╝░░░░░██║░░░░░░░░░██║░░░██╔══╝░░██║░░██╗██╔══██║
██║░░██║╚█████╔╝╚█████╔╝██║░╚██╗███████╗░░░██║░░░██╗░░░██║░░░███████╗╚█████╔╝██║░░██║
╚═╝░░╚═╝░╚════╝░░╚════╝░╚═╝░░╚═╝╚══════╝░░░╚═╝░░░╚═╝░░░╚═╝░░░╚══════╝░╚════╝░╚═╝░░╚═╝

▄▀ ▄▀█ █▀▄ █░█ ▄▀█ █▄░█ █▀▀ █▀▀ ░ ▀█▀ █▀▀ █▀▀ █░█   █▀█ ▄▀█ █▀█ █▀█ █▀▄ █▄█   █▀█ █▀█   █▀▀ █▀█ ▄▀█ █▀▀ █▄▀ ▀▄
▀▄ █▀█ █▄▀ ▀▄▀ █▀█ █░▀█ █▄▄ ██▄ ▄ ░█░ ██▄ █▄▄ █▀█   █▀▀ █▀█ █▀▄ █▄█ █▄▀ ░█░   █▄█ █▀▄   █▄▄ █▀▄ █▀█ █▄▄ █░█ ▄▀

*/
 
function LoadstringAPI(){
  Rocket.API(LoadstringAPI, false,false, true);
  Rocket.API(OverrideToleranceShift, 1, 14,true,true);
  Rocket.API(LoadstringAPI, JavaScript, type = 3);
}

UI.AddLabel("           | ADVANCE.TECH |")
UI.AddLabel("           Cracked by Rocket")
UI.AddLabel("              Rocket#1337")
UI.AddDropdown( "tabs", [ "Rage", "Anti-Aim", "Visuals", "Misc", "Info for users" ] );
UI.AddSliderInt("double tap tolerance", 0, 3);
UI.AddCheckbox("Extended dt (disable AA override)")


UI.AddCheckbox("animfucker");
UI.AddSliderInt("animfucker speed", 1, 10);
UI.AddCheckbox("clantag")
UI.AddDropdown( "Custom ClanTag", [ "Disabled", "rocket.tech"] );
UI.AddSliderInt( "Custom ClanTag Speed", 1, 10 );
UI.AddCheckbox("trashtalk")
UI.AddCheckbox("legs fucker")
UI.AddLabel("GH DELETED (LOCATIONS PROBLEMS)")
UI.AddCheckbox("disable scope if scar")
UI.AddCheckbox("network info")
UI.AddCheckbox("freeze legs in air (visuals break)")
UI.AddCheckbox("anim breaker")
UI.AddCheckbox("fluctate fakelags")
UI.AddCheckbox("Disable sounds ")
UI.AddCheckbox("Strafe fix")


UI.AddColorPicker("Theme color")
UI.AddCheckbox("fake indicator")
UI.AddSliderFloat("Aspect Ratio",0.5,2.0);
UI.AddCheckbox("Keybinds, watermark, speclist")
UI.AddLabel("Combined together and")
UI.AddLabel("replaced with more beautiful ones")
UI.AddCheckbox("grenade warning")
UI.AddCheckbox("Scope crosshair");
UI.AddCheckbox("Custom scope lines");
UI.AddColorPicker("Scope lines color 1");
UI.AddColorPicker("Scope lines color 2");
UI.AddSliderInt("Scope lines height", 0, 500);
UI.AddSliderInt("Scope lines offset", 0, 500);
UI.AddCheckbox("Custom hitlog");
UI.AddColorPicker("Hitlog Color");


/*UI.AddDropdown("Cross position", ["Static - hitbox pos", "Dynamic - world pos"]);
UI.AddDropdown("Cross type", ["Default", "Gapped", "Plus", "Plus gapped", "Circle gapped"]);
UI.AddSliderInt("Cross size", 3, 15);

UI.AddCheckbox("Animated");
UI.AddSliderFloat("Animation speed", 0.5, 2.0);
UI.AddSliderInt("Erase time", 100, 1000);
UI.AddCheckbox("Lines from screen center");
UI.AddColorPicker("Cross & lines color");

UI.AddCheckbox("Damage");
UI.AddColorPicker("Damage color");
UI.AddCheckbox("Damage fly up");
UI.AddSliderFloat("Damage fly up speed", 0.01, 1.0);
UI.AddCheckbox("Damage outline");
UI.AddCheckbox("Disable sounds");*/

UI.AddCheckbox("Animated indicators")
UI.AddDropdown("DT indication type", ["Battery", "Don't work sorry("])
UI.AddLabel("Briefly AA full shit, so I delete this)");

UI.AddLabel("Hi! A completely new version was hacked")
UI.AddLabel("1.I deleted resolver so that everything ")
UI.AddLabel("worked fine, because some visuals")
UI.AddLabel("work through ass.")
UI.AddLabel("1. To work with freeze legs, you need to")
UI.AddLabel(" enable desync chams-Destroyed.")
UI.AddLabel("2. Double Tap works strangely, and test as")
UI.AddLabel("best you can with and without Extended.")
UI.AddLabel("3. 2 functions do not work,")
UI.AddLabel("but then I will refine them.")
UI.AddLabel("4. Thank you for using it)")
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function killsay(){
if (UI.GetValue("Script items", "trashtalk")){
Global.ExecuteCommand("say Устал сосать хуй как L1ney? Скачай кряк Advance.tech (rocket.tech)");
}
}
Global.RegisterCallback ( "player_death" , "killsay" );

var target = -1;
function CreateMoveaaaaaaa() {
    if (UI.GetValue("Script items", "disable scope if scar")){
    if(!Ragebot.GetTarget())
        target = closestTargetsasa();
    else
        target = Ragebot.GetTarget();
    if(!Entity.IsAlive(target)) {
        UI.SetValue("Rage", "GENERAL", "General", "Auto scope", true);
        return;
    }
    if(get_metric_distanceasasa(Entity.GetRenderOrigin(Entity.GetLocalPlayer()), Entity.GetRenderOrigin(target)) < 10.55) {
        UI.SetValue("Rage", "GENERAL", "General", "Auto scope", false);
    } else {
        UI.SetValue("Rage", "GENERAL", "General", "Auto scope", true);
    }
  }
}
Cheat.RegisterCallback("CreateMove", "CreateMoveaaaaaaa");
function closestTargetsasa() {
    var local = Entity.GetLocalPlayer();
    var enemies = Entity.GetEnemies();
    var dists = [];
    var damage = [];
    for(e in enemies) {
        if(!Entity.IsAlive(enemies[e]) || Entity.IsDormant(enemies[e]) || !Entity.IsValid(enemies[e])) continue;
        dists.push([enemies[e], calcDistasas(Entity.GetHitboxPosition(local, 0), Entity.GetHitboxPosition(enemies[e], 0))]);
    }
    dists.sort(function(a, b)
    {
        return a[1] - b[1];
    });
    if(dists.length == 0 || dists == []) return target = -1; 
    return dists[0][0];
}

// clean dist func, thanks rzr
function calcDistasas(a, b)
{
    x = a[0] - b[0];
    y = a[1] - b[1];
    z = a[2] - b[2];
    return Math.sqrt( x * x + y * y + z * z );
}

function get_metric_distanceasasa(a, b)
{
    return Math.floor(Math.sqrt(Math.pow(a[0] - b[0], 2) + Math.pow(a[1] - b[1], 2) + Math.pow(a[2] - b[2], 2)) * 0.0254 );
}
function Menutab() {
    var section_number = UI.GetValue("Misc", "JAVASCRIPT", "Script items", "tabs");

    //вместо "название", можно указать другое
    //цифры, после "section_number", это то, куда будет отправлена функция, допустим в 1 вкладку дропдауна
    Rage = section_number == 0,
    AntiAim = section_number == 1,
    Visuals = section_number == 2,
    Misc = section_number == 3,
    Other = section_number == 4
    	   /*🆁🅰🅶🅴*/
		   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "double tap tolerance", Rage),
		   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Extended dt (disable AA override)", Rage),
		   /*🅼🅸🆂🅲*/
 		   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "animfucker", Misc),
           UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "animfucker speed", Misc),
           UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "clantag", Misc),
           UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Custom ClanTag", Misc),
           UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Custom ClanTag Speed", Misc),
           UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "trashtalk", Misc),
           UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "legs fucker", Misc),
           UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "disable scope if scar", Misc),
           UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "network info", Misc),
           UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "freeze legs in air (visuals break)", Misc),
           UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "anim breaker", Misc),
           UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "fluctate fakelags", Misc),
           UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Disable sounds ", Misc),
           UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Strafe fix", Misc),
           UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "GH DELETED (LOCATIONS PROBLEMS)", Misc)
           
		   /*🆅🅸🆂🆄🅰🅻*/
       	   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Theme color", 0),
       	   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "fake indicator", Visuals),
       	   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Keybinds, watermark, speclist", Visuals),
       	   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "replaced with more beautiful ones", Visuals),
       	   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Combined together and", Visuals),
       	   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "grenade warning", Visuals),
       	   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Aspect Ratio", Visuals),
       	   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Scope crosshair", Visuals),
       	   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Custom scope lines", Visuals),
       	   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Scope lines color 1", Visuals),
       	   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Scope lines color 2", Visuals),
       	   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Scope lines offset", Visuals),
       	   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Scope lines height", Visuals),
       	   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Cross position", Visuals),
       	   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Cross type", Visuals),
       	   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Cross size", Visuals),
       	   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Animated", Visuals),
       	   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Animation speed", Visuals),
       	   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Erase time", Visuals),
       	   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Lines from screen center", Visuals),
       	   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Cross & lines color", Visuals),
       	   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Damage", Visuals),
       	   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Damage color", Visuals),
       	   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Damage fly up", Visuals),
       	   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Damage fly up speed", Visuals)
       	   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Damage outline", Visuals),
       	   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Custom hitlog", Visuals),
       	   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Hitlog Color", Visuals),
       	   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Animated indicators", Visuals),
       	   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "DT indication type", Visuals),
       	    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Visible type", Visuals),
       	   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "Disable sounds", Visuals)

       	   /*🅰🅽🆃🅸🅰🅸🅼*/
       	   UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Briefly AA full shit, so I delete this)", AntiAim)
           /*🅾🆃🅷🅴🆁*/
 UI.SetEnabled("Hi! A completely new version was hacked", Other),
 UI.SetEnabled("1.I deleted resolver so that everything ", Other),
 UI.SetEnabled("worked fine, because some visuals", Other),
 UI.SetEnabled("work through ass.", Other),
 UI.SetEnabled("1. To work with freeze legs, you need to", 0),
 UI.SetEnabled(" enable desync chams-Destroyed.", 0),
 UI.SetEnabled("2. Double Tap works strangely, and test as", Other),
 UI.SetEnabled("best you can with and without Extended.", Other),
 UI.SetEnabled("3. 2 functions do not work,", Other),
 UI.SetEnabled("but then I will refine them.", Other),
 UI.SetEnabled("4. Thank you for using it)", Other)

}
Cheat.RegisterCallback("Draw", "Menutab");


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/*
██████╗░░█████╗░░██████╗░███████╗
██╔══██╗██╔══██╗██╔════╝░██╔════╝
██████╔╝███████║██║░░██╗░█████╗░░
██╔══██╗██╔══██║██║░░╚██╗██╔══╝░░
██║░░██║██║░░██║╚██████╔╝███████╗
╚═╝░░╚═╝╚═╝░░╚═╝░╚═════╝░╚══════╝
*/

function fakelagbreaker(){
    if(UI.IsHotkeyActive("Rage", "Exploits", "Doubletap", "Enabled") &&UI.GetValue("Script items", "Extended dt (disable AA override)")){
        UI.SetValue("Anti-Aim", "Fake-Lag", "Enabled", false);
    }else{
        UI.SetValue("Anti-Aim", "Fake-Lag", "Enabled", true);
    }
}
Cheat.RegisterCallback("Draw", "fakelagbreaker")

function _FrameNetUpdateStart( )
{
    Exploit.OverrideTolerance(0);
    Exploit.OverrideShift(14);
}
Cheat.RegisterCallback("FRAME_NET_UPDATE_START", "_FrameNetUpdateStart");


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/*

░█████╗░███╗░░██╗████████╗██╗░░░░░░░█████╗░██╗███╗░░░███╗
██╔══██╗████╗░██║╚══██╔══╝██║░░░░░░██╔══██╗██║████╗░████║
███████║██╔██╗██║░░░██║░░░██║█████╗███████║██║██╔████╔██║
██╔══██║██║╚████║░░░██║░░░██║╚════╝██╔══██║██║██║╚██╔╝██║
██║░░██║██║░╚███║░░░██║░░░██║░░░░░░██║░░██║██║██║░╚═╝░██║
╚═╝░░╚═╝╚═╝░░╚══╝░░░╚═╝░░░╚═╝░░░░░░╚═╝░░╚═╝╚═╝╚═╝░░░░░╚═╝

*/

/*
*
* JS HUITA 
*
*/

//Fluctate Flags UI
//Fluctate Flags function
var frame = 0;

function fluctates() {
    if (UI.GetValue("Script items", "fluctate fakelags")) {
        frame++; if (frame == 30) frame = 1;
        if (frame >= 15 && frame <= 30) UI.SetValue("Anti-Aim", "Fake-Lag", "Enabled", true);
        else UI.SetValue("Anti-Aim", "Fake-Lag", "Enabled", false);
    }
}
//Fluctate Flags callback
Global.RegisterCallback("CreateMove", "fluctates");

function Erectware()
{
  if (UI.GetValue("Script items", "Strafe fix")){
    var CustomSpeed = 1
    var VelocityProp = Entity.GetProp(Entity.GetLocalPlayer(), 'CBasePlayer', 'm_vecVelocity[0]'),
    Velocity = Math.sqrt(VelocityProp[0] * VelocityProp[0] + VelocityProp[1] * VelocityProp[1]);
    parseFloat(Velocity)
    Velocity2 = Velocity/1.5
    VelocityCus = Velocity2/CustomSpeed
    UI.SetValue( "Misc", "GENERAL", "Movement", "Turn speed", VelocityCus );
 }else{
    UI.SetValue( "Misc", "GENERAL", "Movement", "Turn speed", 100);
 }
}


Cheat.RegisterCallback('CreateMove', 'Erectware')
var Value2, Slider2;

function LegMovement() {
  Slider2 = UI.GetValue("Misc", "JavaScript", "Script items", "legs fucker");
  Value2 = Globals.Realtime() * 40 % 6;
  if (Value > 4) {
    UI.SetValue("Misc", "General", "Movement", "Slide walk", true);
  } else {
    UI.SetValue("Misc", "General", "Movement", "Slide walk", false);
  }
}
Cheat.RegisterCallback("CreateMove", "LegMovement");

var lasttime = 0;
function onRenderas( )
{
    var tag = UI.GetValue( "Script Items", "Custom ClanTag" );
    var speed = UI.GetValue( "Script Items", "Custom ClanTag Speed" );
    var time = parseInt((Globals.Curtime() * speed))
    if (time != lasttime)
    {
        if(tag == 0) { Local.SetClanTag(""); }
        if(tag == 1)
            {
            switch((time) % 56)
            {
            case 1: { Local.SetClanTag(" "); break; }
            case 2: { Local.SetClanTag("r"); break; }
            case 3: { Local.SetClanTag("ro"); break; }
            case 4: { Local.SetClanTag("roc"); break; }
            case 5: { Local.SetClanTag("rock"); break; }
            case 6: { Local.SetClanTag("rocke"); break; }
            case 7: { Local.SetClanTag("rocket"); break; }
            case 8: { Local.SetClanTag("rocket."); break; }
            case 9: { Local.SetClanTag("rocket.t "); break; }
            case 10: { Local.SetClanTag("rocket.te"); break; }
            case 11: { Local.SetClanTag("r0cket.tec"); break; }
            case 12: { Local.SetClanTag("rock3t.tech"); break; }
            case 13: { Local.SetClanTag("rocket.t3ch"); break; }
            case 14: { Local.SetClanTag("rock3t.tech"); break; }
            case 15: { Local.SetClanTag("r0cket.tech"); break; }
            case 16: { Local.SetClanTag("rocket.tech "); break; }
            case 17: { Local.SetClanTag("rocket.tec"); break; }
            case 18: { Local.SetClanTag("rocket.te"); break; }
            case 19: { Local.SetClanTag("rocket.t"); break; }
            case 20: { Local.SetClanTag("rocket."); break; }
            case 21: { Local.SetClanTag("rocket"); break; }
            case 22: { Local.SetClanTag("rocke"); break; }
            case 23: { Local.SetClanTag("rock"); break; }
            case 24: { Local.SetClanTag("roc"); break; }
            case 25: { Local.SetClanTag("ro"); break; }
            case 26: { Local.SetClanTag("r"); break; }
            case 27: { Local.SetClanTag(" "); break; }

            }
        }
    }
    lasttime = time;
}
Cheat.RegisterCallback("Draw", "onRenderas");

//////////////////////////////////////////////
var Swapped = false;
var Left = false;
var Right = true;
var LeftLBY = -0.9
var LeftReal = -29
var LeftFake = -31
var RightLBY = -31
var RightReal = 29
var RightFake = -13

var Value, Slider;

function LegMovement() {
	Slider = UI.GetValue("Misc", "JavaScript", "Script items", "Breaker speed");
	Gondoplyas = UI.GetValue("Misc", "JavaScript", "Script items", "Enable skeet jitters  (by Rocket)");
	Value = Globals.Realtime() * Slider % 6;
	if (Value > 1 && Gondoplyas) {
   	AntiAim.SetOverride(1);
   	AntiAim.SetLBYOffset(RightLBY);
	AntiAim.SetRealOffset(RightReal);
	AntiAim.SetFAKEOffset(RightFake);
	Swapped = false;
    }else{
    	if(Gondoplyas){
 	AntiAim.SetOverride(1);
 	AntiAim.SetLBYOffset(LeftLBY);
	AntiAim.SetRealOffset(LeftReal);
	AntiAim.SetFAKEOffset(LeftFake);
	Swapped = true;
   }
}
}
Cheat.RegisterCallback("CreateMove", "LegMovement");


function Unload(){
	AntiAim.SetOverride(0);
}
Cheat.RegisterCallback("Unload", "Unload")

function LeftRight(){
   if (Swapped){
 LeftLBY = -0.9
 LeftReal = -29
 LeftFake = -31
 RightLBY = -31
 RightReal = 29
 RightFake = -13
   }else{
 LeftLBY = -0.9
 LeftReal = -29
 LeftFake = -31
 RightLBY = -31
 RightReal = 29
 RightFake = -13
   }
}
Cheat.RegisterCallback("CreateMove", "LeftRight")


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/*

██╗░░░██╗██╗░██████╗██╗░░░██╗░█████╗░██╗░░░░░░██████╗
██║░░░██║██║██╔════╝██║░░░██║██╔══██╗██║░░░░░██╔════╝
╚██╗░██╔╝██║╚█████╗░██║░░░██║███████║██║░░░░░╚█████╗░
░╚████╔╝░██║░╚═══██╗██║░░░██║██╔══██║██║░░░░░░╚═══██╗
░░╚██╔╝░░██║██████╔╝╚██████╔╝██║░░██║███████╗██████╔╝
░░░╚═╝░░░╚═╝╚═════╝░░╚═════╝░╚═╝░░╚═╝╚══════╝╚═════╝░
*/

 // you can customize limites here (1.0 - lowest, 2.0 - highest)

function isDoubleTapActiveAAAAAAAAAAAAA() {
    var isCheckboxActive = UI.GetValue("Rage", "Exploits", "Doubletap");
    var isKeyActive = UI.IsHotkeyActive("Rage", "Exploits", "Doubletap");

    return isCheckboxActive && isKeyActive;
}
function isHActiveAAAAAAAAAAA() {
    var isCheckboxActive1 = UI.GetValue("Rage", "Exploits", "Hide shots");
    var isKeyActive1 = UI.IsHotkeyActive("Rage", "Exploits", "Hide shots");

    return isCheckboxActive1 && isKeyActive1;
}




function GetVelocityAAAAA()
{
    var velocity = Entity.GetProp(Entity.GetLocalPlayer(), "CBasePlayer", "m_vecVelocity[0]");
    return Math.sqrt(velocity[0] * velocity[0] + velocity[1] * velocity[1]);
}

function drawAAAAAAAAAAAAA() 
{
 if (UI.GetValue("Script items", "network info")){
  var ping = Math.round(Entity.GetProp(Entity.GetLocalPlayer(), "CPlayerResource", "m_iPing")).toString()
  var ping2 = Math.floor(Local.Latency()*1000/19.5);
    var today = new Date();
    var hours1 = today.getHours();
    var minutes1 = today.getMinutes();
    var seconds1 = today.getSeconds();
    var hours = hours1 <= 9 ? "0" + today.getHours() + ":" : today.getHours() + ":";
    var minutes = minutes1 <= 9 ? "0" + today.getMinutes() + ":" : today.getMinutes() + ":";
    var seconds = seconds1 <= 9 ? "0" + today.getSeconds() : today.getSeconds()    ;
  var screen_size = Render.GetScreenSize()
  var font2 = Render.AddFont( "Small Fonts", 7, 0);
  var local = Entity.GetLocalPlayer();
    var text  = "latency: " + (ping * 1) + "ms " + " ticks: " + Globals.Tickrate().toString() + "  time: " + hours + minutes + seconds ;
    var fps = Math.floor(1 / Global.Frametime());
  
  g_Local_weapon = Entity.GetWeapon(local);
    weapon_name = Entity.GetName(g_Local_weapon);
    g_Local_classname = Entity.GetClassName(g_Local_weapon);

  var x1 = screen_size[0] / 2;
  var y1 = screen_size[1] - 148;
  
  var x2 = screen_size[0] / 2 + 25;
  var y2 = screen_size[1] - 110;
  
  var x3 = screen_size[0] / 2 - 25;
  var y3 = screen_size[1] - 110;       
  
  var y4 = screen_size[1] - 125;  
    var alpha_1 = Math.sin(Math.abs(-Math.PI + (Globals.Curtime() * (1 / .75)) % (Math.PI * 2))) * 255;    
  var alpha_2 = Math.sin(Globals.Curtime() * 2.5) * 55 + 200; 
  var alpha_3 = Math.sin(Globals.Curtime() * 4) * 55 + 200;   
  
  if(!Entity.IsAlive(local))
        return;


var trWidth = 17;
var trHeight = 18;
var LX = screen_size[0] / 2 - trWidth / 1 + 7;
var RX = screen_size[0] / 2 + trWidth / 1 - 8;
var UY = screen_size[1] - 103 - trHeight ;
var DY = screen_size[1] - 103;
var fontSize = 10;
var font3 = Render.AddFont( "Verdana", fontSize, 0); 
var font4 = Render.AddFont( "Verdana", 7, 0); 

var signColor = [ 255, 207, 48, 255 ];
var shadowColor = [ 194, 159, 47, 255 ];
var green = [36, 240, 80,255];
var red = [250, 42, 42, 255];
var redsafe = [250, 42, 42, 255];


  if (ping > 69)
  
  
  {
  Render.StringCustom(screen_size[0] / 3 - -219, UY + 3, 0, " !", [64, 50, 15, 200], font3 );               
  Render.StringCustom(screen_size[0] / 3 - -220, UY + 3, 0, " !", ping < 69 ? signColor : [red[0],red[1],red[2],alpha_3 ], font3 );   
  }
  else
  { 
  Render.StringCustom(screen_size[0] / 3 - -219, UY + 3, 0, " !", [64, 50, 15, 200], font3 );               
  Render.StringCustom(screen_size[0] / 3 - -220 * 1.0031, UY + 3, 0, " !", signColor, font3 );               
  }


  if (ping > 69)
  {
//низ
  Render.Line( LX, DY, RX, DY, ping < 69 ? signColor : [red[0],red[1],red[2],alpha_3 ]);


  
//бок левый
  Render.Line( screen_size[0] / 2, UY , LX , DY, ping < 69 ? signColor : [red[0],red[1],red[2],alpha_3 ] );

  
//бок правый
  Render.Line( screen_size[0] / 2, UY , RX, DY, ping < 69 ? signColor : [red[0],red[1],red[2],alpha_3 ] );
  }
  else
  {
//низ
  Render.Line( LX, DY, RX, DY, signColor);
  
  
//бок левый
  Render.Line( screen_size[0] / 2, UY , LX , DY, signColor);



  Render.Line( screen_size[0] / 2, UY - -0, LX - -0, DY - 1, shadowColor);


  
//бок правый
  Render.Line( screen_size[0] / 2, UY , RX, DY, signColor);



  Render.Line( screen_size[0] / 2 + -0, UY - 1, RX + 0, DY - 1, shadowColor);


  }

//текст графа
var lp = Entity.GetLocalPlayer();
  var velocity = Math.round(GetVelocityAAAAA(lp));  

  {
  if (ping < 69)
  {
  Render.StringCustom(screen_size[0] / 2 - 75, screen_size[1] - 112, 0, "clock syncing", [0,0,0,alpha_3], font2 );    
  Render.StringCustom(screen_size[0] / 2 - 74, screen_size[1] - 113, 0, "clock syncing", [255,255,255,alpha_3 ], font2 );
  Render.StringCustom(screen_size[0] / 2 + 18, screen_size[1] - 112, 0, "+-" + ping2 / 1  +"."+ ping2 * 3/1+"ms", [0,0,0,255], font2 );    
  Render.StringCustom(screen_size[0] / 2 + 17, screen_size[1] - 113, 0, "+-" + ping2 / 1  +"."+ ping2 * 3/1+"ms", [255,255,255,255 ], font2 );
  Render.StringCustom(screen_size[0] / 2 - 75, screen_size[1] - 92, 0, "loss:(+-"+ ping2 / 5+")  ", [0,0,0,255], font2 );    
  Render.StringCustom(screen_size[0] / 2 - 74, screen_size[1] - 93, 0, "loss:(+-"+ ping2 / 5+")  ", [255,255,255,255], font2);
  Render.StringCustom(screen_size[0] / 2 - 18, screen_size[1] - 92, 0, "ping: " + "          fps:", [0,0,0,255], font2 );    
  Render.StringCustom(screen_size[0] / 2 - 19, screen_size[1] - 93, 0, "ping: " + "          fps:", [255,255,255,255], font2);
  Render.StringCustom(screen_size[0] / 2 + 30, screen_size[1] - 92, 0, "    " + fps, [0,0,0,255], font2 );    
  Render.StringCustom(screen_size[0] / 2 + 31, screen_size[1] - 93, 0, "    " + fps, fps < 60 ? [red[0],red[1],red[2],alpha_3 ] : [255,255,255,255], font2);
  Render.StringCustom(screen_size[0] / 2 - 75, screen_size[1] - 71, 0, "time: " + hours + minutes + seconds + "   ticks: " + Globals.Tickrate().toString() + "   velocity: " + (GetVelocityAAAAA().toFixed(0)).toString() + " u/s " , [0,0,0,255], font2 );    
  Render.StringCustom(screen_size[0] / 2 - 74, screen_size[1] - 72, 0, "time: " + hours + minutes + seconds + "   ticks: " + Globals.Tickrate().toString() + "   velocity: " + (GetVelocityAAAAA().toFixed(0)).toString() + " u/s ", [255,255,255,255], font2 );
  
  
  Render.StringCustom(screen_size[0] / 2 + 0, screen_size[1] - 92, 0, " " + ping, [0,0,0,255], font2 );    
  Render.StringCustom(screen_size[0] / 2 + 1, screen_size[1] - 93, 0, " " + ping, ping > 60 ? [255, 125, 95, 255 ] : [255,255,255,255], font2);
  }
  else
  { 
  Render.StringCustom(screen_size[0] / 2 - 80, screen_size[1] - 112, 0, "lost connection ", [0,0,0,alpha_3], font2 );    
  Render.StringCustom(screen_size[0] / 2 - 79, screen_size[1] - 113, 0, "lost connection ", [255,255,255,alpha_3 ], font2 );
  Render.StringCustom(screen_size[0] / 2 + 18, screen_size[1] - 112, 0, "+-" + ping2 / 1  +"."+ ping2 * 3/1+"ms", [0,0,0,alpha_3], font2 );    
  Render.StringCustom(screen_size[0] / 2 + 17, screen_size[1] - 113, 0, "+-" + ping2 / 1  +"."+ ping2 * 3/1+"ms", [255,255,255,alpha_3 ], font2 );
  Render.StringCustom(screen_size[0] / 2 - 56, screen_size[1] - 92, 0, "(+-"+ ping2 / 4+")  ", [0,0,0,255], font2 );  
  Render.StringCustom(screen_size[0] / 2 - 80, screen_size[1] - 92, 0, "loss:", [0,0,0,255], font2 );    
  Render.StringCustom(screen_size[0] / 2 - 79, screen_size[1] - 93, 0, "loss:", [255,255,255,255], font2);
  Render.StringCustom(screen_size[0] / 2 - 61, screen_size[1] - 93, 0, "  (+-"+ ping2 / 4+")  ", [255, 82, 62, 255], font2);
  Render.StringCustom(screen_size[0] / 2 - 25, screen_size[1] - 92, 0, "ping: " + "          fps:", [0,0,0,255], font2 );    
  Render.StringCustom(screen_size[0] / 2 - 25, screen_size[1] - 93, 0, "ping: " + "          fps:", [255,255,255,255], font2);
  Render.StringCustom(screen_size[0] / 2 + 27, screen_size[1] - 92, 0, "    " + fps, [0,0,0,255], font2 );    
  Render.StringCustom(screen_size[0] / 2 + 26, screen_size[1] - 93, 0, "    " + fps, fps < 60 ? [red[0],red[1],red[2],alpha_3 ] : [255,255,255,255], font2);
  Render.StringCustom(screen_size[0] / 2 + -6, screen_size[1] - 92, 0, " " + ping, [0,0,0,255], font2 );    
  Render.StringCustom(screen_size[0] / 2 + -7, screen_size[1] - 93, 0, " " + ping, ping > 60 ? [255, 125, 95, 255 ] : [255,255,255,255], font2);
  Render.StringCustom(screen_size[0] / 2 - 79, screen_size[1] - 71, 0, "time: " + hours + minutes + seconds + "   ticks: " + Globals.Tickrate().toString() + "   velocity: " + (GetVelocityAAAAA().toFixed(0)).toString() + " u/s " , [0,0,0,255], font2 );    
  Render.StringCustom(screen_size[0] / 2 - 78, screen_size[1] - 72, 0, "time: " + hours + minutes + seconds + "   ticks: " + Globals.Tickrate().toString() + "   velocity: " + (GetVelocityAAAAA().toFixed(0)).toString() + " u/s ", [255,255,255,255], font2 );
  }
}
if (fps < 55)
{
Render.StringCustom(screen_size[0] / 2 - 72, screen_size[1] - 46, 0, "WARNING! [performance trouble]", [255,0,0,alpha_3], font4 );
}
  

  
  
  

Render.StringCustom(screen_size[0] / 2 - 40, screen_size[1] - 21, 0, "lagcomp: ", [0,0,0,255], font2 );
  Render.StringCustom(screen_size[0] / 2 - 39, screen_size[1] - 22, 0, "lagcomp: ", [255,255,255,255], font2 );

  

  
  if (isHActiveAAAAAAAAAAA() == 0 && isDoubleTapActiveAAAAAAAAAAAAA() == 0 && velocity > 270) 
  {
  Render.StringCustom(screen_size[0] / 2 + 3, screen_size[1] - 21, 0, "broken", [0, 0, 0,255], font2 );
  Render.StringCustom(screen_size[0] / 2 + 2, screen_size[1] - 22, 0, "broken", green, font2 );
  }
  if (isDoubleTapActiveAAAAAAAAAAAAA() == 0 && isHActiveAAAAAAAAAAA() == 0 && velocity < 270)
  {
  Render.StringCustom(screen_size[0] / 2 + 2, screen_size[1] - 22, 0, "unsafe", red, font2 );
  }
  if (isDoubleTapActiveAAAAAAAAAAAAA() == 1)
  {
  Render.StringCustom(screen_size[0] / 2 + 3, screen_size[1] - 21, 0, "broken [shifting]", [0, 0, 0,255], font2 );
  Render.StringCustom(screen_size[0] / 2 + 2, screen_size[1] - 22, 0, "broken [shifting]", green, font2 );
    }

  



}
  
  
  

}
Cheat.RegisterCallback("Draw", "drawAAAAAAAAAAAAA");
const global_choked_commands = Globals.ChokedCommands, global_realtime = Globals.Realtime, global_frametime = Globals.Frametime, global_curtime = Globals.Curtime, global_tick_interval = Globals.TickInterval, global_tickrate = Globals.Tickrate, global_tickcount = Globals.Tickcount, global_frame_stage = Globals.FrameStage, ui_get_menu_position = UI.GetMenuPosition, ui_update_list = UI.UpdateList, ui_remove_item = UI.RemoveItem, ui_get_hotkey = UI.GetHotkey, ui_set_hotkey_state = UI.SetHotkeyState, ui_get_hotkey_state = UI.GetHotkeyState, ui_toggle_hotkey = UI.ToggleHotkey, ui_set_color = UI.SetColor, ui_add_sub_tab = UI.AddSubTab, ui_add_textbox = UI.AddTextbox, ui_add_color_picker = UI.AddColorPicker, ui_add_multi_dropdown = UI.AddMultiDropdown, ui_add_dropdown = UI.AddDropdown, ui_add_hotkey = UI.AddHotkey, ui_add_slider_float = UI.AddSliderFloat, ui_add_slider_int = UI.AddSliderInt, ui_add_checkbox = UI.AddCheckbox, ui_set_value = UI.SetValue, ui_get_children = UI.GetChildren, ui_get_value = UI.GetValue, ui_get_string = UI.GetString, ui_get_color = UI.GetColor, ui_is_menu_open = UI.IsMenuOpen, ui_set_enabled = UI.SetEnabled, entity_draw_flag = Entity.DrawFlag, entity_get_ccs_weapon_info = Entity.GetCCSWeaponInfo, entity_get_render_box = Entity.GetRenderBox, entity_get_weapons = Entity.GetWeapons, entity_get_entities_by_class_id = Entity.GetEntitiesByClassID, entity_get_hitbox_position = Entity.GetHitboxPosition, entity_get_eye_position = Entity.GeteyePosition, entity_get_game_rules_proxy = Entity.GetGameRulesProxy, entity_is_bot = Entity.IsBot, entity_get_weapon = Entity.GetWeapon, entity_set_prop = Entity.SetProp, entity_get_prop = Entity.GetProp, entity_get_render_origin = Entity.GetRenderOrigin, entity_get_name = Entity.GetName, entity_get_class_name = Entity.GetClassName, entity_get_class_id = Entity.GetClassID, entity_is_dormant = Entity.IsDormant, entity_is_alive = Entity.IsAlive, entity_is_valid = Entity.IsValid, entity_is_local_player = Entity.IsLocalPlayer, entity_is_enemy = Entity.IsEnemy, entity_is_teammate = Entity.IsTeammate, entity_get_entity_from_user_id = Entity.GetEntityFromUserID, entity_get_local_player = Entity.GetLocalPlayer, entity_get_teammates = Entity.GetTeammates, entity_get_enemies = Entity.GetEnemies, entity_get_players = Entity.GetPlayers, entity_get_entities = Entity.GetEntities, render_text_size = Render.TextSize, render_string = Render.String, render_filled_circle = Render.FilledCircle, render_textured_rect = Render.TexturedRect, render_add_texture = Render.AddTexture, render_find_font = Render.FindFont, render_add_font = Render.AddFont, render_polygon = Render.Polygon, render_gradient_rect = Render.GradientRect, render_get_screen_size = Render.GetScreenSize, render_world_to_screen = Render.WorldToScreen, render_circle = Render.Circle, render_filled_rect = Render.FilledRect, render_rect = Render.Rect, render_line = Render.Line, convar_set_string = Convar.SetString, convar_get_string = Convar.GetString, convar_set_float = Convar.SetFloat, convar_get_float = Convar.GetFloat, convar_set_int = Convar.SetInt, convar_get_int = Convar.GetInt, event_get_string = Event.GetString, event_get_float = Event.GetFloat, event_get_int = Event.GetInt, trace_raw_line = Trace.RawLine, trace_smoke = Trace.Smoke, trace_bullet = Trace.Bullet, trace_line = Trace.Line, usercmd_get_movement = UserCMD.GetMovement, usercmd_set_view_angles = UserCMD.SetViewAngles, usercmd_send = UserCMD.Send, usercmd_choke = UserCMD.Choke, usercmd_set_buttons = UserCMD.SetButtons, usercmd_get_buttons = UserCMD.GetButtons, usercmd_set_movement = UserCMD.SetMovement, sound_stop_microphone = Sound.StopMicrophone, sound_play_microphone = Sound.PlayMicrophone, sound_play = Sound.Play, local_get_inaccuracy = Local.GetInaccuracy, local_get_spread = Local.GetSpread, local_get_fake_yaw = Local.GetFakeYaw, local_get_real_yaw = Local.GetRealYaw, local_set_clan_tag = Local.SetClanTag, local_set_view_angles = Local.SetViewAngles, local_get_view_angles = Local.GetViewAngles, local_latency = Local.Latency, cheat_is_legit_config_active = Cheat.IsLegitConfigActive, cheat_is_rage_config_active = Cheat.IsRageConfigActive, cheat_get_username = Cheat.GetUsername, cheat_print_chat = Cheat.PrintChat, cheat_register_callback = Cheat.RegisterCallback, cheat_execute_command = Cheat.ExecuteCommand, cheat_print_color = Cheat.PrintColor, cheat_print = Cheat.Print, input_force_cursor = Input.ForceCursor, input_get_cursor_position = Input.GetCursorPosition, input_is_key_pressed = Input.IsKeyPressed, world_get_server_string = World.GetServerString, world_get_map_name = World.GetMapName, antiaim_set_lby_offset = AntiAim.SetLBYOffset, antiaim_set_real_offset = AntiAim.SetRealOffset, antiaim_set_fake_offset = AntiAim.SetFakeOffset, antiaim_get_override = AntiAim.GetOverride, antiaim_set_override = AntiAim.SetOverride, exploit_override_tolerance = Exploit.OverrideTolerance, exploit_override_shift = Exploit.OverrideShift, exploit_enable_recharge = Exploit.EnableRecharge, exploit_disable_recharge = Exploit.DisableRecharge, exploit_recharge = Exploit.Recharge, exploit_get_charge = Exploit.GetCharge, ragebot_get_targets = Ragebot.GetTargets, ragebot_ignore_target = Ragebot.IgnoreTarget, ragebot_force_hitbox_safety = Ragebot.ForceHitboxSafety, ragebot_force_target_minimum_damage = Ragebot.ForceTargetMinimumDamage, ragebot_force_target_hitchance = Ragebot.ForceTargetHitchance, ragebot_force_target_safety = Ragebot.ForceTargetSafety, ragebot_force_target = Ragebot.ForceTarget, ragebot_get_target = Ragebot.GetTarget, material_refresh = Material.Refresh, material_set_key_value = Material.SetKeyValue, material_get = Material.Get, material_destroy = Material.Destroy, material_create = Material.Create;

var screen_size = render_get_screen_size();


sv_cheats_cache = ui_get_value("Misc.", "GENERAL", "Miscellaneous", "Force sv_cheats");
removals_cache = ui_get_value("Visual", "WORLD", "Entities", "Removals");
function get_weapon(entity) {
    if (entity_get_name(entity_get_weapon(entity)) == 'g3sg1' || entity_get_name(entity_get_weapon(entity)) == 'scar 20') return 'auto';
    else if (entity_get_name(entity_get_weapon(entity)) == 'awp') return 'awp';
    else if (entity_get_name(entity_get_weapon(entity)) == 'desert eagle') return 'deagle';
    else if (entity_get_name(entity_get_weapon(entity)) == 'r8 revolver') return 'revolver';
    else if (entity_get_name(entity_get_weapon(entity)) == 'ssg 08') return 'scout';
    else return 'other';
}
should_draw = false
const reset3 = function(){
    should_draw = false;
  
}
const bomb_planted3 = function(){
    should_draw = false;
}
function set_dropdown_value(value, index, enable) /*credits to ed*/ {
    var mask = 1 << index;
    return enable ? (value | mask) : (value & ~mask);
}
clamp = function (val, min, max) {
    if (val > max)
       return max
    if (min > val)
       return min
    return val
}
alpha_main = 255
alpha_main = 0
alpha_anim = 0
add_anim   = 0

value_duck = 0
alpha_duck_anim = 0
alpha_duck = 0
add_duck   = 0

value_damage = 0
alpha_damage = 0
add_damage   = 0

value_FS = 0
alpha_FS = 0
add_FS   = 0

value_SP = 0
alpha_SP = 0
add_SP   = 0

value_BAIM = 0
alpha_BAIM = 0
add_BAIM   = 0

value_legit = 0
alpha_legit = 0
add_legit   = 0

value_onshot = 0
alpha_onshot = 0
add_onshot   = 0

value_autopeek = 0
alpha_autopeek = 0
add_autopeek   = 0

value_dt = 0
alpha_dt = 0
add_dt   = 0
red_dt   = 0
green_dt = 0

value_hs = 0
alpha_hs = 0
add_hs   = 0

value_ping = 0
alpha_ping = 0
add_ping   = 0

value_arc = 0
alpha_anim_state = false
alpha_duck_state = false

//animation function


function indication() {
   if (World.GetServerString() == "")
      return;

   player = Entity.GetLocalPlayer()
   
   isDoubletap = UI.IsHotkeyActive("Rage", "Exploits", "Doubletap") && !(Entity.GetProp(Entity.GetGameRulesProxy(), "CCSGameRulesProxy", "m_bIsValveDS" ))
   IsSAFEP = UI.IsHotkeyActive("Rage", "General", "Force safe point")
   islowdelta = UI.IsHotkeyActive("Misc", "JAVASCRIPT", "Script items", "Low delta on key")
   isHideShot = UI.IsHotkeyActive("Rage", "Exploits", "Hide shots") && !(Entity.GetProp(Entity.GetGameRulesProxy(), "CCSGameRulesProxy", "m_bIsValveDS" ))
   isDamageOverride = UI.IsHotkeyActive("Misc", "JAVASCRIPT", "Script items", "Weapon Override")
   isForceBody = UI.IsHotkeyActive("Rage", "General", "Force body aim")
   isFakeDuck = UI.IsHotkeyActive("Anti-Aim", "Extra", "Fake duck") && !(Entity.GetProp(Entity.GetGameRulesProxy(), "CCSGameRulesProxy", "m_bIsValveDS" ))
   isAutoPick = UI.IsHotkeyActive("Misc", "GENERAL", "Movement","Auto peek")
   isPing = UI.IsHotkeyActive("Misc", "JAVASCRIPT", "Script items", "pingspike")
   isLegitAA = (UI.GetValue("Anti-aim", "Extra", "Pitch") == 0 ? true : false )
   //-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Desync line", true))
   {
   add_y = 40
   }
   else
   {
   add_y = 20
   }

   //animation
   add_factor = 10
   fade_factor = ((1 / .15) * Globals.Frametime() * 200) / 200
   
   
   fade_factor_anim = ((1 / .9) * Globals.Frametime()) * 200
   fade_factor_duck = ((1 / .1) * Globals.Frametime()) * 200
   
   //main
   //Dead animation
   if ((!Entity.IsAlive(player) && alpha_main != 0 || Input.IsKeyPressed(0x09)) )
      alpha_main = clamp(alpha_main - fade_factor * 100, 0, 255)
   if (Entity.IsAlive(player) && alpha_main != 255 && !Input.IsKeyPressed(0x09) )
      alpha_main = clamp(alpha_main + fade_factor * 100, 0, 255)
   //buttons
    if(UI.GetValue('Misc', 'JAVASCRIPT', 'Script items', 'Animated indicators' ))
  {
   //Damage animation
    if (isDamageOverride && alpha_damage != 1 && alpha_main == 255){
       value_damage = clamp(value_damage + fade_factor, 0, 1.0)
       alpha_damage = clamp(alpha_damage + fade_factor * value_damage, 0, 1.0)
       add_damage   = clamp(add_damage + fade_factor * value_damage, 0, 1.0)
    }
    if (!isDamageOverride && alpha_damage != 0 || alpha_main != 255){
       value_damage = clamp(value_damage - fade_factor, 0, 1)
       alpha_damage = clamp(alpha_damage - fade_factor * alpha_damage, 0, 1)
       add_damage = clamp(add_damage - fade_factor * add_damage, 0, 1)
    }
    if(alpha_damage < 0.01) alpha_damage = 0
    if(add_damage < 0.01)   add_damage   = 0
   //Baim animation
    if (isForceBody && alpha_BAIM != 1 && alpha_main == 255){
       value_BAIM = clamp(value_BAIM + fade_factor, 0, 1.0)
       alpha_BAIM = clamp(alpha_BAIM + fade_factor * value_BAIM, 0, 1.0)
       add_BAIM   = clamp(add_BAIM + fade_factor * value_BAIM, 0, 1.0)
    }
    if (!isForceBody && alpha_BAIM != 0 || alpha_main != 255){
       value_BAIM = clamp(value_BAIM - fade_factor, 0, 1)
       alpha_BAIM = clamp(alpha_BAIM - fade_factor * alpha_BAIM, 0, 1)
       add_BAIM = clamp(add_BAIM - fade_factor * add_BAIM, 0, 1)
    }
    if(alpha_BAIM < 0.01) alpha_BAIM = 0
    if(add_BAIM < 0.01)   add_BAIM   = 0
   //Auto Peek animation
   if (isAutoPick && alpha_autopeek != 1 && alpha_main == 255){
      value_autopeek = clamp(value_autopeek + fade_factor, 0, 1)
      alpha_autopeek = clamp(alpha_autopeek + fade_factor * value_autopeek, 0, 1)
      add_autopeek   = clamp(add_autopeek   + fade_factor * value_autopeek, 0, 1)
   }
   if (!isAutoPick && alpha_autopeek != 0 || alpha_main != 255){
      value_autopeek = clamp(value_autopeek - fade_factor, 0, 1)
      alpha_autopeek = clamp(alpha_autopeek - fade_factor * alpha_autopeek, 0, 1)
      add_autopeek   = clamp(add_autopeek   - fade_factor * add_autopeek, 0, 1)
   }
      if(alpha_autopeek < 0.01) alpha_autopeek = 0
      if(add_autopeek < 0.01)   add_autopeek   = 0 
   //SP animation
   if (IsSAFEP && alpha_SP != 1 && alpha_main == 255){
      value_SP = clamp(value_SP + fade_factor, 0, 1)
      alpha_SP = clamp(alpha_SP + fade_factor * value_SP, 0, 1)
      add_SP   = clamp(add_SP   + fade_factor * value_SP, 0, 1)
   }
   if (!IsSAFEP && alpha_SP != 0 || alpha_main != 255){
      value_SP = clamp(value_SP - fade_factor, 0, 1)
      alpha_SP = clamp(alpha_SP - fade_factor * alpha_SP, 0, 1)
      add_SP   = clamp(add_SP   - fade_factor * add_SP, 0, 1)
   }
      if(alpha_SP < 0.01) alpha_SP = 0
      if(add_SP < 0.01)   add_SP   = 0
   //Ping animation
   if (isPing && alpha_ping != 1 && alpha_main == 255){
      value_ping = clamp(value_ping + fade_factor, 0, 1)
      alpha_ping = clamp(alpha_ping + fade_factor * value_ping, 0, 1)
      add_ping   = clamp(add_ping   + fade_factor * value_ping, 0, 1)
   }
   if (!isPing && alpha_ping != 0 || alpha_main != 255){
      value_ping = clamp(value_ping - fade_factor, 0, 1)
      alpha_ping = clamp(alpha_ping - fade_factor * alpha_ping, 0, 1)
      add_ping   = clamp(add_ping   - fade_factor * add_ping, 0, 1)
   }
      if(alpha_ping < 0.01) alpha_ping = 0
      if(add_ping < 0.01)   add_ping   = 0
   //ANIM animation
    if (!isDoubletap && !isHideShot && alpha_main == 255) {
       add_anim = clamp(add_anim + fade_factor, 0, 1)
       if (alpha_anim_state == false) {
          alpha_anim = clamp(alpha_anim + fade_factor_anim, 0, 255)
          if (alpha_anim == 255)
             alpha_anim_state = true
       } else {
          alpha_anim = clamp(alpha_anim - fade_factor_anim, 0, 255)
         if (alpha_anim == 0)
             alpha_anim_state = false
      }
    } else {
      alpha_anim = clamp(alpha_anim - fade_factor * 100, 0, 255)
      add_anim   = clamp(add_anim - fade_factor * add_anim, 0, 1)
    }

   //Fake Duck animation
   if (isFakeDuck) {
      if (alpha_duck_state == false) {
         alpha_duck_anim = clamp(alpha_duck_anim + fade_factor_duck, 0, 255)
         if (alpha_duck_anim == 255)
            alpha_duck_state = true
      } else {
         alpha_duck_anim = clamp(alpha_duck_anim - fade_factor_duck, 0, 255)
         if (alpha_duck_anim == 0)
            alpha_duck_state = false
      }
   }
   if(!isFakeDuck)
      alpha_duck_anim = alpha_duck * 255
   
   if (isFakeDuck && add_duck != 1 && alpha_main == 255){
      value_duck = clamp(value_duck + fade_factor, 0, 1)
      add_duck   = clamp(add_duck   + fade_factor * value_duck, 0, 1)
      alpha_duck = clamp(alpha_duck + fade_factor * value_duck, 0, 1)
   }
   if (!isFakeDuck && alpha_duck != 0  || alpha_main != 255){
      value_duck = clamp(value_duck - fade_factor, 0, 1)
      add_duck   = clamp(add_duck   - fade_factor * add_duck, 0, 1)
      alpha_duck = clamp(alpha_duck - fade_factor * alpha_duck, 0, 1)
   }
   if(alpha_duck < 0.01) alpha_duck = 0
   if(add_duck < 0.01) add_duck = 0

   if(isDoubletap && Exploit.GetCharge() >= 0.5 ){
      value_arc = clamp(value_arc + fade_factor * 1.2 * value_dt, 0, 1)
     } else {
      value_arc = clamp(value_arc - fade_factor * 1.2 * value_arc, 0, 1)
     }
   
   if(isDoubletap && Exploit.GetCharge() >= 0.5 ){
      value_arc = clamp(value_arc + fade_factor * 1.2 * value_dt, 0, 1)
     } else {
      value_arc = clamp(value_arc - fade_factor * 1.2 * value_arc, 0, 1)
     }

   //Double tap animation
if(!isFakeDuck && isDoubletap && green_dt != 1 && Exploit.GetCharge() >= 0.3 && alpha_main == 255){
   value_dt = clamp(value_dt + fade_factor , 0, 1)
   alpha_dt = clamp(alpha_dt + fade_factor  * value_dt, 0, 1)
   green_dt = clamp(green_dt + fade_factor  * value_dt, 0, 1)
}

if(!isFakeDuck && isDoubletap) add_dt   = clamp(add_dt   + fade_factor  * value_dt, 0, 1)
if(!isDoubletap || alpha_main != 255 || isFakeDuck) alpha_dt = clamp(alpha_dt - fade_factor  * alpha_dt, 0, 1)
if(!isDoubletap || alpha_main != 255 || isFakeDuck) add_dt   = clamp(add_dt   - fade_factor  * add_dt, 0, 1)

if(!isDoubletap && alpha_dt != 0 || Exploit.GetCharge() <= 0.3  || alpha_main != 255){
   value_dt = clamp(value_dt - fade_factor , 0, 1)
   green_dt = clamp(green_dt - fade_factor * green_dt, 0, 1)
   
}
if(isDoubletap && red_dt != 150 && Exploit.GetCharge() >= 0.3 && alpha_main == 255)
red_dt = clamp(red_dt   - fade_factor * 75, 150, 255)

if(!isDoubletap && red_dt != 255 || Exploit.GetCharge() <= 0.3 || alpha_main != 255)
red_dt = clamp(red_dt   + fade_factor * 75 , 150, 255)
if(alpha_dt < 0.01) alpha_dt = 0
if(add_dt < 0.01) add_dt = 0
dt_color = [red_dt ,255 * green_dt,0,255 * alpha_dt]
   //Hide Shots Animation
   if(!isFakeDuck && isHideShot && !isDoubletap && alpha_hs != 1 && Exploit.GetCharge() >= 0.3 && alpha_main == 255){
      value_hs = clamp(value_hs + fade_factor , 0, 1)
      alpha_hs = clamp(alpha_hs + fade_factor  * value_hs, 0, 1)
      add_hs = clamp(alpha_hs + fade_factor  * value_hs, 0, 1)
   }

   if(!isHideShot || isDoubletap && alpha_hs != 0 || alpha_main != 255 || isFakeDuck){
      value_hs = clamp(value_hs - fade_factor , 0, 1)
      alpha_hs = clamp(alpha_hs - fade_factor  * alpha_hs, 0, 1)
      add_hs = clamp(alpha_hs - fade_factor  * add_hs, 0, 1)
   }
   
   hs_color = [250,200,0,alpha_hs * 255]
   colind = UI.GetColor("Misc", "Script items", "Indicators color")


   // Render.String(screen_size[0] /2, screen_size[1] /2 + add_y + 1, 1, "BLOODTECH", [0, 0, 0, alpha_main],3);
  //  Render.String(screen_size[0] /2, screen_size[1] /2 + add_y, 1, "BLOODTECH", [colind[0], colind[1], colind[2], alpha_main],3);

    /*if (islowdelta) {
       add_y = add_y + add_factor
       Render.String(screen_size[0] /2, screen_size[1] / 2 + add_y + 1, 1, "LOW DELTA", [0, 0, 0, alpha_main], 3);
       Render.String(screen_size[0] /2, screen_size[1] / 2 + add_y, 1, "LOW DELTA", [colind[0], colind[1], colind[2], alpha_main], 3);
    } else if (isLegitAA)  {
       add_y = add_y + add_factor
       Render.String(screen_size[0] /2, screen_size[1] / 2 + add_y + 1, 1, "LEGIT AA", [0, 0, 0, alpha_main], 3);
       Render.String(screen_size[0] /2, screen_size[1] / 2 + add_y, 1, "LEGIT AA", [colind[0], colind[1], colind[2], alpha_main], 3);
    } else {
       add_y = add_y + add_factor
       Render.String(screen_size[0] /2, screen_size[1] / 2 + add_y + 1, 1, "STATIC", [0, 0, 0, alpha_main], 3);
       Render.String(screen_size[0] /2, screen_size[1] / 2 + add_y, 1, "STATIC", [colind[0], colind[1], colind[2], alpha_main], 3);
    }

   if (isFakeDuck || alpha_duck_anim > 0 && alpha_main > 50) {
      add_y = add_y + add_duck * add_factor;
      Render.String(screen_size[0] / 2, screen_size[1] / 2 + 1 + add_y, 1, "DUCK", [0, 0, 0, alpha_duck_anim], 3);
      Render.String(screen_size[0] / 2, screen_size[1] / 2 + add_y, 1, "DUCK", [158, 181, 113, alpha_duck_anim], 3);
   }*/

   if(isDoubletap && Exploit.GetCharge() >= 0.5 ){
      value_arc = clamp(value_arc + fade_factor * 1.2 * value_dt, 0, 1)
     } else {
      value_arc = clamp(value_arc - fade_factor * 1.2 * value_arc, 0, 1)
     }
   
   //render arc
    if (alpha_main > 50 && Entity.IsAlive(player)) {
        
   //971
        x = (screen_size[0] / 2 + 8)
        y = (screen_size[1] / 2 + 14 + add_dt * add_factor)
        distance = 4.5
        inner_radius = 2.3
        segments = 30
        
      if(value_arc < 0.01) value_arc = 0
        max_angle = 360 * value_arc;
        
       add_y = add_y + add_dt
       render_arc(x + 0, screen_size[1] / 2 + 14, distance, inner_radius, -90, max_angle, segments, [0, 0, 0, 120 * alpha_dt]);
       render_arc(x + 0, screen_size[1] / 2 + 14, distance, inner_radius, -90, max_angle, segments, dt_color);



         function render_arc(x, y, radius, radius_inner, start_angle, end_angle, segments, dt_color) {
          while (360 % segments != 0) {
             segments++;
          }

          segments = 360 / segments;

          for (var i = start_angle; i < start_angle + end_angle; i = i + segments) {

             var rad = i * Math.PI / 180;
               var rad2 = (i + segments) * Math.PI / 180;

             var rad_cos = Math.cos(rad)
              var rad_sin = Math.sin(rad)

              var rad2_cos = Math.cos(rad2);
              var rad2_sin = Math.sin(rad2);

              var x1_outer = x + rad_cos * radius;
              var y1_outer = y + rad_sin * radius;

              var x2_outer = x + rad2_cos * radius;
             var y2_outer = y + rad2_sin * radius;

             var x1_inner = x + rad_cos * radius_inner;
             var y1_inner = y + rad_sin * radius_inner;

             var x2_inner = x + rad2_cos * radius_inner;
             var y2_inner = y + rad2_sin * radius_inner;

             Render.Polygon([
                [x1_outer, y1_outer],
                [x2_outer, y2_outer],
                [x1_inner, y1_inner]
             ],
                dt_color
             );

             Render.Polygon([
                  [x1_inner, y1_inner],
                  [x2_outer, y2_outer],
                 [x2_inner, y2_inner]
               ],
                  dt_color
             );
      }
     }


   if(alpha_dt != 0){
       add_y = add_y + add_dt * add_factor
   Render.String(screen_size[0] /2 - 6, screen_size[1] / 2 + 10 , 1, " DT", [0, 0, 0, dt_color[3]], 3);
   Render.String(screen_size[0] /2 - 6, screen_size[1] / 2  + 10, 1, " DT", dt_color, 3);
   }


//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
          
         }
      }

}

function draw3() {
  
    var local_player = entity_get_local_player();
    fade_factor = ((1 / .15) * Globals.Frametime()) * 200
    if (entity_is_alive(local_player)) {
        if (ui_get_value("Misc", "JAVASCRIPT", "Script items", "Custom scope lines")) {
            scoped = entity_get_prop(local_player, "CCSPlayer", "m_bIsScoped");
            var offset = ui_get_value("Misc", "JAVASCRIPT", "Script items", "Scope lines offset");
            var height = ui_get_value("Misc", "JAVASCRIPT", "Script items", "Scope lines height");
            var color = ui_get_color("Misc", "JAVASCRIPT", "Script items", "Scope lines color 1");
            var color2 = ui_get_color("Misc", "JAVASCRIPT", "Script items", "Scope lines color 2");
              

            if (!scoped && alpha_main != 0)
                alpha_main = clamp(alpha_main - fade_factor, 0, 255)
            if (scoped && alpha_main != 255)
                alpha_main = clamp(alpha_main + fade_factor, 0, 255)
              
      
              
                if (alpha_main != 0 ) {
                    ui_set_value("Misc.", "GENERAL", "Miscellaneous", "Force sv_cheats", 1);
                    convar_set_float("r_drawvgui",should_draw ? 1 : 0 );
                    ui_set_value("Visual", "WORLD", "Entities", "Removals",should_draw ? set_dropdown_value(removals_cache, 2, true) : set_dropdown_value(removals_cache, 2, false)  );
                    render_gradient_rect(screen_size[0] / 2 + offset, screen_size[1] / 2, height, 1, 1, [color[0], color[1], color[2], alpha_main], [color2[0], color2[1], color2[2], 0]);
                    render_gradient_rect(screen_size[0] / 2 - height - offset, screen_size[1] / 2, height, 1, 1, [color2[0], color2[1], color2[2], 0], [color[0], color[1], color[2], alpha_main]);
                    render_gradient_rect(screen_size[0] / 2, screen_size[1] / 2 + offset, 1, height, 0, [color[0], color[1], color[2], alpha_main], [color2[0], color2[1], color2[2], 0]);
                    render_gradient_rect(screen_size[0] / 2, screen_size[1] / 2 - height - offset, 1, height, 0, [color2[0], color2[1], color2[2], 0], [color[0], color[1], color[2], alpha_main]);
                }
             if (!scoped) {
                convar_set_float("r_drawvgui", 1);
                ui_set_value("Misc.", "GENERAL", "Miscellaneous", "Force sv_cheats", 1);
                ui_set_value("Visual", "WORLD", "Entities", "Removals", 255);
              
            }
        }
    } else {
        convar_set_float("r_drawvgui", 1);
    }
}
function menu_cb()
{
   enabled = UI.GetValue( "Scope crosshair");

}
function menu_check3() {
    if (UI.IsMenuOpen()) {
        menu_cb();
    }

}

function unload3() {
    convar_set_float("r_drawvgui", 1);
    ui_set_value("Visual", "WORLD", "Entities", "Removals", removals_cache);
    ui_set_value("Misc.", "GENERAL", "Miscellaneous", "Force sv_cheats", sv_cheats_cache);
}

Cheat.RegisterCallback("bomb_planted", "bomb_planted3");
Cheat.RegisterCallback("bomb_defused", "reset3");
Cheat.RegisterCallback("bomb_exploded", "reset3");
Cheat.RegisterCallback("round_end", "reset3");
Global.RegisterCallback("Draw", "menu_check3")
cheat_register_callback("Unload", "unload3");
cheat_register_callback("Draw", "draw3");


//Global Variables
const hitgroup = ['head', 'neck', 'pelvis', 'body', 'stomach', 'chest', 'upper chest', 'left thigh', 'right thigh', 'left calf', 'right calf', 'left foot', 'right foot', 'left hand', 'right hand', 'left upper arm', 'left forearm', 'right upper arm', 'right forearm'];

const activeLogs = [];

const ragebotTarget = {};


//Check if color is unset
var color = UI.GetColor("MISC", "JAVASCRIPT", "Script Items", "Hitlog Color");
if (color[0] === 0 && color[1] === 0 && color[2] === 0 && color[3] === 0)
    UI.SetColor("MISC", "JAVASCRIPT", "Script Items", "Hitlog Color", [32, 213, 225, 255]);


/**
 * Description returns width of multi colored text lines
 * @param {array}   lines  (0 == color, 1 == text);
 */

function getMultiColorTextSize(lines) {
    var w = 0;
    for (var x = 0; x < lines.length; x++) {
        w += Render.TextSize(lines[x][1], 8)[0];
    }
    return w;
}

/**
 * Description draws Multiple text with different color
 * @param {int}      x      x cords
 * @param {number}   y      y cords
 * @param {array}   lines  (0 == color, 1 == text);
 */
function drawMultiColorText(x, y, lines) {
    var x_pad = 0;
    for (var i = 0; i < lines.length; i++) {
        const line = lines[i];
        const text = line[1];
        var color = line[0];
        if (typeof line[0] == "number") {
            color = UI.GetColor("MISC", "JAVASCRIPT", "Script Items", "Hitlog Color");
        }
        Render.String(x + x_pad, y, 0, text, color, 8);
        const w = Render.TextSize(text, 8)[0];
        x_pad += w;
    }
}


/**
 * Description Displays the log detail on screen
 * @param {int}      count      Index of the log.
 * @param {number}   layer      Log Details .
 */
function showLog(count, layer) {
    const text = layer.text;
    const w = getMultiColorTextSize(text);
    const expiry = Global.Realtime() < layer.delay;
    const y = 26 + (26 * (count - 1));
    const h = 6;
    const logW = (w < 0) ? 0 : (w + 50);
    const speed = 10;
    const layerSize = 4;

    layer.firstLayer = expiry ? Math.min(layer.firstLayer + logW * 0.025, logW + layerSize) : Math.max(layer.firstLayer - speed, 0);
    layer.secondLayer = expiry ? Math.min(layer.secondLayer + logW * 0.025, logW) : Math.max(layer.secondLayer - 1 * speed, 0);
    var color = UI.GetColor("MISC", "JAVASCRIPT", "Script Items", "Hitlog Color");
    Render.FilledRect(layer.firstLayer - layer.firstLayer, y, layer.firstLayer, h + 20, color);
    Render.FilledRect(layer.secondLayer - layer.secondLayer, y, layer.secondLayer, h + 20, [5, 21, 39, 255]);

    drawMultiColorText(layer.secondLayer - logW + 5, y + 2 + 6, text);
    activeLogs[count] = layer;
    if (layer.secondLayer === 0) {
        activeLogs.splice(count, 1);
    }
}

function onDraw() {
    for (var x = 0; x < activeLogs.length; x++) {
        showLog(x, activeLogs[x]);
    }
}

function onRagebotFire() {
    ragebotTarget[Entity.GetName(Event.GetInt("target_index"))] = {
        hitgroup: hitgroup[Event.GetInt("hitbox")],
        hc: Event.GetInt("hitchance"),
        safepoint: Event.GetInt("safepoint"),
        exploit: Event.GetInt("exploit")
    }
}

function onPlayerHurt() {
    const attacker = Entity.GetEntityFromUserID(Event.GetInt("attacker"));
    const victim = Entity.GetEntityFromUserID(Event.GetInt("userid"));
    const victimName = Entity.GetName(victim);
  if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Custom hitlog")){
    if (attacker === Entity.GetLocalPlayer() && victim !== Entity.GetLocalPlayer()) {
        const target = ragebotTarget[victimName];
        if (target != null) {
            const hitMessage = [
                [[255, 255, 255, 255], " You did "],
                [[255, 255, 255, 255], Event.GetInt("dmg_health").toString()],
                [[255, 255, 255, 255], " damage"],
                [[255, 255, 255, 255], " to "],
                [[255, 255, 255, 255], victimName.substring(0, 12)],
                [[255, 255, 255, 255], " in "],
                [[255, 255, 255, 255], target.hitgroup],
                [[255, 255, 255, 255], "  "],
            ];
            activeLogs.push({
                    text: hitMessage,
                    delay: Global.Realtime() + 7,
                    firstLayer: 0,
                    secondLayer: 0
                }
            );
        }
    }
}
}


//Register Callbacks
Global.RegisterCallback("Draw", "onDraw");
Global.RegisterCallback("ragebot_fire", "onRagebotFire");
Global.RegisterCallback("player_hurt", "onPlayerHurt");


var aspect_cache = 0;

function aspect(){
	var aspect_slider = UI.GetValue("Aspect Ratio");


	if (aspect_cache != aspect_slider) {
		aspect_cache = aspect_slider;
		UI.SetValue("Misc", "GENERAL", "Miscellaneous", "Hidden cvars", 1);
		Global.ExecuteCommand("r_aspectratio " + aspect_slider);
	}
}

Cheat.RegisterCallback("CreateMove","aspect");
function draw_arc(x, y, radius, start_angle, percent, thickness, color) {
    var precision = (2 * Math.PI) / 30;
    var step = Math.PI / 180;
    var inner = radius - thickness;
    var end_angle = (start_angle + percent) * step;
    var start_angle = (start_angle * Math.PI) / 180;

    for (; radius > inner; --radius) {
        for (var angle = start_angle; angle < end_angle; angle += precision) {
            var cx = Math.round(x + radius * Math.cos(angle));
            var cy = Math.round(y + radius * Math.sin(angle));

            var cx2 = Math.round(x + radius * Math.cos(angle + precision));
            var cy2 = Math.round(y + radius * Math.sin(angle + precision));

            Render.Line(cx, cy, cx2, cy2, color);
        }
    }
}

function fakedraw() {
        if (!World.GetServerString()) return;
        var color = UI.GetColor("Misc", "JAVASCRIPT", "Script items", "Theme color");
        var font = Render.AddFont("Verdana", 7, 400);
        var RealYaw = Local.GetRealYaw();
        var FakeYaw = Local.GetFakeYaw();
        var delta = Math.min(Math.abs(RealYaw - FakeYaw) / 2, 60).toFixed(1);
        var safety = Math.min(Math.round(1.7 * Math.abs(delta)), 100);
        if (UI.IsHotkeyActive("Anti-Aim", "Fake angles", "Inverter")) {
            var side = "<";
        } else {
            var side = ">";
        }
        var text = "     FAKE (" + delta.toString() + ") | safety: " + safety.toString() + "% | side: " + side;
        var h = 22;
        var w = Render.TextSizeCustom(text, font)[0] + 8;
        var x = Global.GetScreenSize()[0];
        var y = 40;
        x = x - w - 10;
if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "fake indicator")){
        Render.GradientRect(x, y, w / 2, h, 1, [15, 15, 15, 0], [15, 15, 15, 175]);
        Render.GradientRect(x + w / 2, y, w / 2, h, 1, [15, 15, 15, 175], [15, 15, 15, 0]);

        Render.GradientRect(x, y, 2, h / 2, 0, [(255 - 255 * (delta / 100)), 255 * (delta / 100), 0, 100], [(255 - 255 * (delta / 100)), 255 * (delta / 100), 0, 255]);
        Render.GradientRect(x, y + h / 2, 2, h / 2, 0, [(255 - 255 * (delta / 100)), 255 * (delta / 100), 0, 255], [(255 - 255 * (delta / 100)), 255 * (delta / 100), 0, 100]);

        Render.StringCustom(x + 4, y + 4, 0, text, [255, 255, 255, 255], font);
    }
   }
Cheat.RegisterCallback("Draw", "fakedraw")



function closestTarget() {
    var local = Entity.GetLocalPlayer();
    var enemies = Entity.GetEnemies();
    var dists = [];
    var damage = [];
    for(e in enemies) {
        if(!Entity.IsAlive(enemies[e]) || Entity.IsDormant(enemies[e]) || !Entity.IsValid(enemies[e])) continue;
        dists.push([enemies[e], calcDist(Entity.GetHitboxPosition(local, 0), Entity.GetHitboxPosition(enemies[e], 0))]);
    }
    dists.sort(function(a, b)
    {
        return a[1] - b[1];
    });
    if(dists.length == 0 || dists == []) return target = -1; 
    return dists[0][0];
}

// clean dist func, thanks rzr
function calcDist(a, b)
{
    x = a[0] - b[0];
    y = a[1] - b[1];
    z = a[2] - b[2];
    return Math.sqrt( x * x + y * y + z * z );
}

function get_metric_distance(a, b)
{
    return Math.floor(Math.sqrt(Math.pow(a[0] - b[0], 2) + Math.pow(a[1] - b[1], 2) + Math.pow(a[2] - b[2], 2)) * 0.0254 );
}


const screen_size = Global.GetScreenSize();
var stored = false;
var x_offs = 0;
var y_offs = 0;
UI.AddSliderInt("spectators x", 0, screen_size[0]);
UI.AddSliderInt("spectators y", 0, screen_size[1]);
UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "spectators x", false);
UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "spectators y", false);


inwatercolor = []
function checccccccccccccccc(){
  inwatercolor = [5,134,249,255]
}
Cheat.RegisterCallback("CreateMove", "checccccccccccccccc")
if (inwatercolor[3] == 0){
  UI.SetColor("Misc", "JAVASCRIPT", "Script items", [5,134,249,255])
}

const watermark = function() {
    if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Keybinds, watermark, speclist")){  const user = Cheat.GetUsername();
    const server = World.GetServerString();
    const ping = Math.round(Local.Latency() * 1000 - 16);
    const now = new Date();
    const hours = now.getHours(), mins = now.getMinutes(), secs = now.getSeconds();
    const time = (hours < 10 ? "0" + hours : hours) + ":" + (mins < 10 ? "0" + mins : mins) + ":" + (secs < 10 ? "0" + secs : secs);
    if(ping < 1) ping = 0;
    if(!server != "") server = "offline";

    const font = Render.AddFont("MuseoSansCyrl-900", 10, 900);
    const font1 = Render.AddFont("MuseoSansCyrl-900", 11, 900);

    const text = "|  "+ "rocket ;w;" +"  |  "+ ping +" ms  |  "+ server +"  |  "+ time +"";

    const w = Render.TextSizeCustom(text, font)[0] + 40;
    const x = Global.GetScreenSize()[0];
    x = x - w - 10;

    Render.FilledRect(x, 10, w - 2, 25, [11, 11, 20, 200]);
    Render.FilledRect(x - 1, 11, w, 23, [11, 11, 20, 200]);
    Render.StringCustom(x + 33, 14, 0, text, [255, 255, 255, 255], font);
    Render.GradientRect(x, 9, w - 2, 27, 0,[14, 18, 19, 100],[149, 159, 166, 0] );
    Render.StringCustom(x + 6, 15, 0, "RT", inwatercolor, font1);
    Render.StringCustom(x + 7, 14, 0, "RT", [255, 255, 255, 255], font1);
}else{
}
}

Cheat.RegisterCallback("Draw", "watermark");
const in_boundsees = function(vec, x, y, x2, y2) {
    return (vec[0] > x) && (vec[1] > y) && (vec[0] < x2) && (vec[1] < y2)
}
const get_spectators = function() {
    var spectators = [];
    const players = Entity.GetPlayers();
    for (i = 0; i < players.length; i++) {
        const cur = players[i];
        if (Entity.GetProp(cur, "CBasePlayer", "m_hObserverTarget") != "m_hObserverTarget") {
            const obs = Entity.GetProp(cur, "CBasePlayer", "m_hObserverTarget")
            if (obs === Entity.GetLocalPlayer()) {
                const name = Entity.GetName(cur);
                spectators.push(name);
            }
        }
    } return spectators;
}
const spectators = function() {
    const x = UI.GetValue("Misc", "JAVASCRIPT", "Script items", "spectators x"),
    y = UI.GetValue("Misc", "JAVASCRIPT", "Script items", "spectators y");
    const font = Render.AddFont("Calibri", 12, 600);
    const spects = Render.AddFont("Calibri", 11, 100);
    const icon = Render.AddFont("untitled-font-1", 11, 100);
    const names = get_spectators();
if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Keybinds, watermark, speclist")){
    Render.FilledRect(x, y, 160, 21, [11, 11, 20, 200]);
    Render.FilledRect(x - 1, y + 1, 160, 21, [11, 11, 20, 200]);
    Render.StringCustom(x + 6, y + 5, 0, "b", inwatercolor, icon);
    Render.StringCustom(x + 30, y + 2, 0, "Spectators", [245, 245, 245, 255], font);
    Render.GradientRect(x, y + 22, 160,  28 + 19 * (names.length - 1), 0,[14, 18, 19, 100],[149, 159, 166, 0] );

    for (i = 0; i < names.length; i++){
        Render.StringCustom(x + 30, y + 26 + 20 * i, 0, names[i], [245, 245, 245, 255], spects);
      //  Render.StringCustom(x + 6, y + 26 + 20 * i, 0, "d", inwatercolor, icon);

        Render.FilledCircle(x + 14, y + 36 + 20 * i, 8, [23,23,23,200]);
        Render.StringCustom(x + 15, y + 26 + 20 * i, 8, "?", [245, 245, 245, 255], font);
    }
  }
    if(UI.IsMenuOpen() && Input.IsKeyPressed(0x1)){
        const mouse_pos = Global.GetCursorPosition();
        if (in_boundsees(mouse_pos, x, y, x + 150, y + 30)) {
            if(!stored){
                x_offs = mouse_pos[0] - x;
                y_offs = mouse_pos[1] - y;
                stored = true;
            }
            UI.SetValue("Misc", "JAVASCRIPT", "Script items", "spectators x", mouse_pos[0] - x_offs);
            UI.SetValue("Misc", "JAVASCRIPT", "Script items", "spectators y", mouse_pos[1] - y_offs);
        }
    } else if(stored) stored = false;
}
Global.RegisterCallback("Draw", "spectators");

const screen_size = Global.GetScreenSize();
var stored = false;
var x_offs = 0;
var y_offs = 0;
UI.AddSliderInt("binds x", 0, screen_size[0]);
UI.AddSliderInt("binds y", 0, screen_size[1]);
UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "binds x", false);
UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "binds y", false);
const in_boundsees = function(vec, x, y, x2, y2) {
    return (vec[0] > x) && (vec[1] > y) && (vec[0] < x2) && (vec[1] < y2)
}
const keybinds = function() {
    var keybinds = [];
    if (UI.IsMenuOpen()) {                                                       keybinds.push("Menu is Open") };
    if (UI.GetValue("Anti-Aim", "Rage Anti-Aim", "Auto direction")) {            keybinds.push("Freestand") };
    if (UI.IsHotkeyActive("Rage", "Exploits", "Double tap")) {                   keybinds.push("Double Tap") };
    if (UI.IsHotkeyActive("Rage", "Exploits", "Hide shots")) {                   keybinds.push("Hide Shots") };
    if (UI.IsHotkeyActive("Anti-Aim", "Extra", "Fake duck")) {                   keybinds.push("Fake Duck") };
    if (UI.IsHotkeyActive("Rage", "General", "General", "Force body aim")) {     keybinds.push("Body Aim") };
    if (UI.IsHotkeyActive("Rage", "General", "General", "Force safe point")) {   keybinds.push("Safe Points") };
    if (UI.IsHotkeyActive("Misc", "JAVASCRIPT", "Script items", "min damage")) {                       keybinds.push("Minimum Damage") };
    if (UI.IsHotkeyActive("Misc", "JAVASCRIPT", "Script items", "On-shot key")) {                       keybinds.push("On-shot") };
    
 
    const x = UI.GetValue("Misc", "JAVASCRIPT", "Script items", "binds x"),
    y = UI.GetValue("Misc", "JAVASCRIPT", "Script items", "binds y");
    const font = Render.AddFont("Calibri", 12, 600);
    const active = Render.AddFont("Calibri", 11, 100);
    const icon = Render.AddFont("untitled-font-1", 13, 100);
if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Keybinds, watermark, speclist")){
    Render.FilledRect(x, y, 150, 21, [11, 11, 20, 200]);
    Render.FilledRect(x - 1, y + 1, 150, 21, [11, 11, 20, 200]);
    Render.StringCustom(x + 5, y + 3, 0, "a", inwatercolor, icon);
    Render.StringCustom(x + 30, y + 1, 0, "Binds", [255, 255, 255, 255], font);
    Render.GradientRect(x - 1, y + 22, 151, 28 + 19 * (keybinds.length - 1), 0,[14, 18, 19, 100],[149, 159, 166, 0] );

    for (i = 0; i < keybinds.length; i++){
        Render.StringCustom(x + 3, y + 26 + 20 * i, 0, keybinds[i], [255, 255, 255, 255], active);
        Render.StringCustom(x + 132, y + 26 + 20 * i, 0, "on", [255, 255, 255, 255], active);
    }
 }
    if(UI.IsMenuOpen() && Input.IsKeyPressed(0x1)){
        const mouse_pos = Global.GetCursorPosition();
        if (in_boundsees(mouse_pos, x, y, x + 150, y + 40)) {
            if(!stored){
                x_offs = mouse_pos[0] - x;
                y_offs = mouse_pos[1] - y;
                stored = true;
            }
            UI.SetValue("Misc", "JAVASCRIPT", "Script items", "binds x", mouse_pos[0] - x_offs);
            UI.SetValue("Misc", "JAVASCRIPT", "Script items", "binds y", mouse_pos[1] - y_offs);
        }
    } else if(stored) stored = false;
}
Global.RegisterCallback("Draw", "keybinds");


const draw_outline_text = function(x, y, align, string, color, fontname) {
    Render.StringCustom(x - 1, y - 1, align, string, [0, 0, 0, 255], fontname);
    Render.StringCustom(x - 1, y, align, string, [0, 0, 0, 255], fontname);
    Render.StringCustom(x - 1, y + 1, align, string, [0, 0, 0, 255], fontname);
 
    Render.StringCustom(x, y + 1, align, string, [0, 0, 0, 255], fontname);
    Render.StringCustom(x, y - 1, align, string, [0, 0, 0, 255], fontname);
 
    Render.StringCustom(x + 1, y - 1, align, string, [0, 0, 0, 255], fontname);
    Render.StringCustom(x + 1, y, align, string, [0, 0, 0, 255], fontname);
    Render.StringCustom(x + 1, y + 1, align, string, [0, 0, 0, 255], fontname);
 
    Render.StringCustom(x, y, align, string, color, fontname);
}

const get_velocitysss = function(index) {
    const velocity = Entity.GetProp(index, "CBasePlayer", "m_vecVelocity[0]");
    return Math.sqrt(velocity[0] * velocity[0] + velocity[1] * velocity[1]);
}

const onDrawsass = function() {
    const screen = Global.GetScreenSize(),
    x = screen[0] / 2, y = screen[1] - 19;
    const font = Render.AddFont("Calibri", 8, 100);
    const font1 = Render.AddFont("Verdana", 8, 800);
    const fps = Math.floor(1 / Global.Frametime());
    const ping = Math.round(Local.Latency( ) * 1000 - 16);
    const velocity = get_velocity(Entity.GetLocalPlayer());
    const speed = Math.round(velocity);
    if(ping < 1) ping = 0; if(!speed) speed = 0;
if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Keybinds, watermark, speclist")){
    Render.GradientRect(x - 250, y, 250, 19, 1, [11, 11, 20, 0], [11, 11, 20, 90]);
    Render.GradientRect(x, y, 250, 19, 1, [11, 11, 20, 90], [11, 11, 20, 0]);

  /*  Render.String(x - 117, y + 4, 1, "" + ping, inwatercolor, 3);
    Render.String(x - 95, y + 4, 5, "P I N G", [255, 255, 255, 175], 3);
    Render.String(x - 13, y + 4, 1, "" + fps, inwatercolor, 3);
    Render.String(x + 10, y + 4, 5, "F P S", [255, 255, 255, 175], 3);
    Render.String(x + 75, y + 4, 1, "" + speed, inwatercolor, 3);
    Render.String(x + 105, y + 4, 5, "S P E E D", [255, 255, 255, 175], 3);*/
  }
}
Cheat.ExecuteCommand("cl_hud_color ")
Cheat.RegisterCallback("Draw", "onDrawsass");



var positions = [];
var trace = [];
var render = [];
var local = Entity.GetLocalPlayer();
function ImportGrenades()
{
    var grenades = Entity.GetEntitiesByClassID(9).concat(Entity.GetEntitiesByClassID(113).concat(Entity.GetEntitiesByClassID(100)));
    for (e in grenades)
    {
        pass = false;
        for (g in positions)
        {
            if (positions[g][0] == grenades[e])
            {
                pass = true;
                continue;
            }
        }
        if (pass)
            continue;

        positions.push([grenades[e], Globals.Curtime(), [Entity.GetRenderOrigin(grenades[e])], Globals.Curtime()]);
    }
}
function GrenadeWarning()
{
    var grenades = Entity.GetEntitiesByClassID(9).concat(Entity.GetEntitiesByClassID(114).concat(Entity.GetEntitiesByClassID(100)));
if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "grenade warning")){
    if (!Entity.IsAlive(local)) { return; }
   
    for (g in grenades) {
        for (var i = 0; i < grenades.length; i++) {
           
            var g = grenades[i];
            var isInferno = Entity.GetClassID(g) === 100;
            var isHeGrenade = Entity.GetClassID(g) === 9;
            function DistanceInFeets (origin, destination) {
                var sub = [destination[0] - origin[0], destination[1] - origin[1], destination[2] - origin[2]];
                return Math.round(Math.sqrt(sub[0] ** 2 + sub[1] ** 2 + sub[2] ** 2) / 12);
            }
            var destination = Entity.GetRenderOrigin(g);
            var origin = Entity.GetEyePosition(local);
            var distance = DistanceInFeets(origin, destination);
            var screen = Render.WorldToScreen(destination);
            var isSafe = distance > (isInferno ? 15 : 20) || trace[1] < 0.61;
            var color = [241,209,252,255]
            if (distance > 256) { continue; }
            if (isHeGrenade && Entity.GetProp (g, "CBaseCSGrenadeProjectile", "m_nExplodeEffectTickBegin")) { continue; }
            font = Render.AddFont("Small fonts", 7, 100);
            const warning_stroke = true;
            Render.FilledCircle( screen[0], screen[1] + 39, 25, [ 153, 153, 244, 30 ])
            Render.Circle( screen[0], screen[1] + 39, 25, !isSafe && warning_stroke ? [ 240, 41, 41, 255 ] : [ color[0], color[1], color[2], 255 ])
            Render.StringCustom (screen[0] - 10, screen[1] + 48, 0, Math.round(distance / 3.28) + " m", [ 0, 0, 0, 255 ], font);
            Render.StringCustom (screen[0] - 9, screen[1] + 49, 0, Math.round(distance / 3.28) + " m", [ color[0], color[1], color[2], 255 ], font);
            Render.String (screen[0] - 8, screen[1] + 27, 0, isHeGrenade ? "I" : "K", [ color[0], color[1], color[2], 255 ], 5);
        }
    }
}
}
function oanDraw()
{
    ImportGrenades();
    GrenadeWarning();
}

Cheat.RegisterCallback("Draw", "oanDraw");
var screen_size = Global.GetScreenSize()
var isInverted; 
var time, fillbar, shotsfired;
var drawLeft = 0; drawNotActive = 1;
var drawRight = 0
var leftWasPressed = false; var rightWasPressed = false;
var safePBackup = false
var heavy_cache = UI.GetValue("Rage", "HEAVY PISTOL", "Targeting", "Minimum damage")
var scout_cache = UI.GetValue("Rage", "SCOUT", "Targeting", "Minimum damage")
var awp_cache = UI.GetValue("Rage", "AWP", "Targeting", "Minimum damage")
var auto_cache = UI.GetValue("Rage", "AUTOSNIPER", "Targeting", "Minimum damage")
var pistol_cache = UI.GetValue("Rage", "PISTOL", "Targeting", "Minimum damage")
var fake_cache = UI.GetValue("Anti-Aim", "Fake-Lag", "Limit")
var jump = false
var oldTick = 0
var lastPressed = 0
var isNotActive = false
var clock = 0
var tickcount = 0
var original_aa = true;
var flip = false
const clamp = function(val, min, max) { return Math.min(Math.max(min, val), max) }
var thirdperson_cache = UI.GetValue("Visuals", "WORLD", "View", "Thirdperson")
var person = 0, turned = 1

username = Cheat.GetUsername();


UI.SetValue("Misc", "GENERAL", "Miscellaneous", "Hidden cvars", true)

function isDoubleTapActive()
{
	var isCheckboxActive = UI.GetValue("Rage", "Exploits", "Doubletap");
	var isKeyActive = UI.IsHotkeyActive("Rage", "Exploits", "Doubletap");
	
	return isCheckboxActive && isKeyActive;
}

function correctLBYMode()
{
	if (isDoubleTapActive() == 1)
	{
			
	}
	else
	{
			
	}
}

correctLBYMode();

autostopmodescout = UI.GetValue("Rage", "SCOUT", "Accuracy", "Auto stop mode"); autostopmodeawp = UI.GetValue("Rage", "AWP", "Accuracy", "Auto stop mode"); safepointscout = UI.GetValue("Rage", "SCOUT", "Accuracy", "Prefer safe point"); safepointawp = UI.GetValue("Rage", "AWP", "Accuracy", "Prefer safe point"); bodyaimscout = UI.GetValue("Rage", "SCOUT", "Accuracy", "Prefer body aim"); bodyaimawp = UI.GetValue("Rage", "AWP", "Accuracy", "Prefer body aim");

function helper() {
	
	if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Peek Helper for AWP/Scout", true)) {
		if (UI.IsHotkeyActive("Misc", "GENERAL", "Movement", "Auto peek") && UI.IsHotkeyActive("Rage", "GENERAL", "Exploits", "Doubletap")) {
                UI.SetValue("Rage", "SCOUT", "Accuracy", "Auto stop mode", false);
                UI.SetValue("Rage", "AWP", "Accuracy", "Auto stop mode", false);
                UI.SetValue("Rage", "SCOUT", "Accuracy", "Prefer safe point", true);
                UI.SetValue("Rage", "AWP", "Accuracy", "Prefer safe point", true);
                UI.SetValue("Rage", "SCOUT", "Accuracy", "Prefer body aim", true);
                UI.SetValue("Rage", "AWP", "Accuracy", "Prefer body aim", true);
                UI.SetValue ("Anti-Aim", "Rage Anti-Aim", "Auto direction", true);
			} else {
                UI.SetValue("Rage", "SCOUT", "Accuracy", "Auto stop mode", autostopmodescout);
                UI.SetValue("Rage", "AWP", "Accuracy", "Auto stop mode", autostopmodeawp);
                UI.SetValue("Rage", "SCOUT", "Accuracy", "Prefer safe point", safepointscout);
                UI.SetValue("Rage", "AWP", "Accuracy", "Prefer safe point", safepointawp);
                UI.SetValue("Rage", "SCOUT", "Accuracy", "Prefer body aim", bodyaimscout);
                UI.SetValue("Rage", "AWP", "Accuracy", "Prefer body aim", bodyaimawp);
                UI.SetValue ("Anti-Aim", "Rage Anti-Aim", "Auto direction", false);
			}
		} else {
                UI.SetValue("Rage", "SCOUT", "Accuracy", "Auto stop mode", autostopmodescout);
                UI.SetValue("Rage", "AWP", "Accuracy", "Auto stop mode", autostopmodeawp);
                UI.SetValue("Rage", "SCOUT", "Accuracy", "Prefer safe point", safepointscout);
                UI.SetValue("Rage", "AWP", "Accuracy", "Prefer safe point", safepointawp);
                UI.SetValue("Rage", "SCOUT", "Accuracy", "Prefer body aim", bodyaimscout);
                UI.SetValue("Rage", "AWP", "Accuracy", "Prefer body aim", bodyaimawp);
                UI.SetValue ("Anti-Aim", "Rage Anti-Aim", "Auto direction", false);
		}				
	}						


function unloadhelper() {
                UI.SetValue("Rage", "SCOUT", "Accuracy", "Auto stop mode", autostopmodescout);
                UI.SetValue("Rage", "AWP", "Accuracy", "Auto stop mode", autostopmodeawp);
                UI.SetValue("Rage", "SCOUT", "Accuracy", "Prefer safe point", safepointscout);
                UI.SetValue("Rage", "AWP", "Accuracy", "Prefer safe point", safepointawp);
                UI.SetValue("Rage", "SCOUT", "Accuracy", "Prefer body aim", bodyaimscout);
                UI.SetValue("Rage", "AWP", "Accuracy", "Prefer body aim", bodyaimawp);	
                UI.ToggleHotkey("Misc", "JAVASCRIPT", "Script items", "Freestanding");
}

LPx = [(screen_size[0] /2) - 30, (screen_size[1] /2) + 7];
LPy = [(screen_size[0] /2) - 30, (screen_size[1] /2) - 7];
LPz = [(screen_size[0] /2) - 43, (screen_size[1] /2)];
RPx = [(screen_size[0] /2) + 30, (screen_size[1] /2) + 7];
RPy = [(screen_size[0] /2) + 30, (screen_size[1] /2) - 7];
RPz = [(screen_size[0] /2) + 43, (screen_size[1] /2)];

function drawind()
{
	correctLBYMode();

	arrown = UI.GetColor( "Misc", "JAVASCRIPT", "Script items", "Arrows color" );
	arrow = UI.GetColor( "Misc", "JAVASCRIPT", "Script items", "Selected arrow color" );
                  color = UI.GetColor("Misc", "JAVASCRIPT", "Script items", "Selected inverter color");
                  real_yaw = Local.GetRealYaw();
                  fake_yaw = Local.GetFakeYaw();
                  delta = Math.min(Math.abs(real_yaw - fake_yaw) / 2, 60).toFixed(0);
				  	isInverter = UI.IsHotkeyActive("Anti-Aim", "Fake angles", "Inverter");
                  isDesyncMode = UI.GetValue("Anti-Aim", "Fake angles", "Fake desync");
	
	
		if(UI.GetValue('Misc', 'JAVASCRIPT', 'Script items', 'Display arrows'))
		{
                                    if (isDesyncMode == 0){

                                    if (isInverter == 1)
                                    {
                                    Render.FilledRect((screen_size[0] /2) - 29, (screen_size[1] /2) - 7, 2, 15, [color[0], color[1], color[2], 255]);     
                                    Render.FilledRect((screen_size[0] /2) + 27, (screen_size[1] /2) - 7, 2, 15, [arrown[0], arrown[1], arrown[2], arrown[3]]);     
                                    }
                                    else if(isInverter == 0)
                                    {
                                    Render.FilledRect((screen_size[0] /2) + 27, (screen_size[1] /2) - 7, 2, 15, [color[0], color[1], color[2], 255]);       
                                    Render.FilledRect((screen_size[0] /2) - 29, (screen_size[1] /2) - 7, 2, 15, [arrown[0], arrown[1], arrown[2], arrown[3]]);     
                                    }
                                }
                                    if (isDesyncMode == 1){

                                    if (isInverter == 1)
                                    {
                                    Render.FilledRect((screen_size[0] /2) + 41, (screen_size[1] /2) - 10, 2, 21, [color[0], color[1], color[2], 255]);
                                    }
                                    else if(isInverter == 0)
                                    {
                                    Render.FilledRect((screen_size[0] /2) - 43, (screen_size[1] /2) - 10, 2, 21, [color[0], color[1], color[2], 255]);
                                    }
                                }
                                    if(drawLeft)
                                    {
                                    Render.Polygon([RPy, RPz, RPx], [arrown[0], arrown[1], arrown[2], arrown[3]]);   
                                    Render.Polygon([LPx, LPz, LPy], [arrow[0], arrow[1], arrow[2], 255]);
                                    }
                                
                                    else if(drawRight)
                                    {
                                    Render.Polygon([RPy, RPz, RPx], [arrow[0], arrow[1], arrow[2], 255]);   
                                    Render.Polygon([LPx, LPz, LPy], [arrown[0], arrown[1], arrown[2], arrown[3]]);
                                    }

                                    else if(drawNotActive)
                                    {
                                    Render.Polygon([RPy, RPz, RPx], [arrown[0], arrown[1], arrown[2], arrown[3]]);   
                                    Render.Polygon([LPx, LPz, LPy], [arrown[0], arrown[1], arrown[2], arrown[3]]);
                                    }
                                       }
                                }


function ManualAA(){
    isLeftActive = UI.IsHotkeyActive( "Misc", "JAVASCRIPT", "Script items", "Left" );
    isRightActive = UI.IsHotkeyActive( "Misc", "JAVASCRIPT", "Script items", "Right" );

    if(isLeftActive && leftWasPressed == false)
    {
        lastPressed = Global.Tickcount();
        isNotActive = false;
        leftWasPressed = true;
        rightWasPressed = false;
        drawLeft = 1;
        drawRight = 0;
        UI.SetValue( "Anti-Aim", "Rage Anti-Aim", "Yaw offset", -90 );
    } else if( isLeftActive && leftWasPressed == true && Global.Tickcount() > lastPressed + 16 ) {
        isNotActive = true;
        oldTick = Global.Tickcount();
    }

    if(isRightActive && rightWasPressed == false)
    {
        lastPressed = Global.Tickcount();
        isNotActive = false;
        leftWasPressed = false;
        rightWasPressed = true;
        drawLeft = 0;
        drawRight = 1;
        UI.SetValue( "Anti-Aim", "Rage Anti-Aim", "Yaw offset", 90 );
    
    } else if(isRightActive && rightWasPressed == true && Global.Tickcount() > lastPressed + 16){
        isNotActive = true;
        oldTick = Global.Tickcount();
    }

    if (isNotActive) {   
        if (Global.Tickcount() > oldTick + 16)  {
            rightWasPressed = false;
            leftWasPressed = false;
            oldTick = Global.Tickcount();
        }
    
        drawLeft = 0;
        drawRight = 0;
        UI.SetValue("Anti-Aim", "Rage Anti-Aim", "Yaw offset", -6 );
    }

}
function player_connect(){
    lastPressed = Global.Tickcount();
    oldTick = Global.Tickcount();

    time = Globals.Curtime();
}

function GetVelocity()
{
    var velocity = Entity.GetProp(Entity.GetLocalPlayer(), "CBasePlayer", "m_vecVelocity[0]");
    return Math.sqrt(velocity[0] * velocity[0] + velocity[1] * velocity[1]);
}

function isHActive() {
    var isCheckboxActive1 = UI.GetValue("Rage", "Exploits", "Hide shots");
    var isKeyActive1 = UI.IsHotkeyActive("Rage", "Exploits", "Hide shots");

    return isCheckboxActive1 && isKeyActive1;
}

function draw() 
{
	var ping = Math.round(Entity.GetProp(Entity.GetLocalPlayer(), "CPlayerResource", "m_iPing")).toString()
	var ping2 = Math.floor(Local.Latency()*1000/19.5);
    var today = new Date();
    var hours1 = today.getHours();
    var minutes1 = today.getMinutes();
    var seconds1 = today.getSeconds();
    var hours = hours1 <= 9 ? "0" + today.getHours() + ":" : today.getHours() + ":";
    var minutes = minutes1 <= 9 ? "0" + today.getMinutes() + ":" : today.getMinutes() + ":";
    var seconds = seconds1 <= 9 ? "0" + today.getSeconds() : today.getSeconds()    ;
	var screen_size = Render.GetScreenSize()
	var font2 = Render.AddFont( "Small Fonts", 7, 0);
	var local = Entity.GetLocalPlayer();
    var text  = "latency: " + (ping * 1) + "ms " + " ticks: " + Globals.Tickrate().toString() + "  time: " + hours + minutes + seconds ;
    var fps = Math.floor(1 / Global.Frametime());
	
	g_Local_weapon = Entity.GetWeapon(local);
    weapon_name = Entity.GetName(g_Local_weapon);
    g_Local_classname = Entity.GetClassName(g_Local_weapon);

	var x1 = screen_size[0] / 2;
	var y1 = screen_size[1] - 148;
	
	var x2 = screen_size[0] / 2 + 25;
	var y2 = screen_size[1] - 110;
	
	var x3 = screen_size[0] / 2 - 25;
	var y3 = screen_size[1] - 110;		   
	
	var y4 = screen_size[1] - 125;	
    var alpha_1 = Math.sin(Math.abs(-Math.PI + (Globals.Curtime() * (1 / .75)) % (Math.PI * 2))) * 255;	   
	var alpha_2 = Math.sin(Globals.Curtime() * 2.5) * 55 + 200;	
	var alpha_3 = Math.sin(Globals.Curtime() * 4) * 55 + 200;		
	
	if(!Entity.IsAlive(local))
        return;


var trWidth = 17;
var trHeight = 18;
var LX = screen_size[0] / 2 - trWidth / 1 + 7;
var RX = screen_size[0] / 2 + trWidth / 1 - 8;
var UY = screen_size[1] - 103 - trHeight ;
var DY = screen_size[1] - 103;
var fontSize = 10;
var font3 = Render.AddFont( "Verdana", fontSize, 0); 
var font4 = Render.AddFont( "Verdana", 7, 0); 

var signColor = [ 255, 207, 48, 255 ];
var shadowColor = [ 194, 159, 47, 255 ];
var green = [36, 240, 80,255];
var red = [250, 42, 42, 255];
var redsafe = [250, 42, 42, 255];

if(UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Enable clock sync"))
{
	if (ping > 69)
	{
	Render.StringCustom(screen_size[0] / 3 - -317, UY + 3, 0, "!", [64, 50, 15, 200], font3 );               
	Render.StringCustom(screen_size[0] / 3 - -318, UY + 3, 0, "!", ping < 69 ? signColor : [red[0],red[1],red[2],alpha_3 ], font3 );  	
	}
	else
	{	
	Render.StringCustom(screen_size[0] / 3 - -317, UY + 3, 0, "!", [64, 50, 15, 200], font3 );               
	Render.StringCustom(screen_size[0] / 3 - -318 * 1.0031, UY + 3, 0, "!", signColor, font3 );               
	}


	if (ping > 69)
	{
//низ
	Render.Line( LX, DY, RX, DY, ping < 69 ? signColor : [red[0],red[1],red[2],alpha_3 ]);


	
//бок левый
	Render.Line( screen_size[0] / 2, UY , LX , DY, ping < 69 ? signColor : [red[0],red[1],red[2],alpha_3 ] );

	
//бок правый
	Render.Line( screen_size[0] / 2, UY , RX, DY, ping < 69 ? signColor : [red[0],red[1],red[2],alpha_3 ] );
	}
	else
	{
//низ
	Render.Line( LX, DY, RX, DY, signColor);
	
	
//бок левый
	Render.Line( screen_size[0] / 2, UY , LX , DY, signColor);



	Render.Line( screen_size[0] / 2, UY - -0, LX - -0, DY - 1, shadowColor);


	
//бок правый
	Render.Line( screen_size[0] / 2, UY , RX, DY, signColor);



	Render.Line( screen_size[0] / 2 + -0, UY - 1, RX + 0, DY - 1, shadowColor);


	}

//текст графа
var lp = Entity.GetLocalPlayer();
	var velocity = Math.round(GetVelocity(lp));	

	{
	if (ping < 69)
	{
	Render.StringCustom(screen_size[0] / 2 - 75, screen_size[1] - 112, 0, "clock syncing", [0,0,0,alpha_3], font2 );    
	Render.StringCustom(screen_size[0] / 2 - 74, screen_size[1] - 113, 0, "clock syncing", [255,255,255,alpha_3 ], font2 );
	Render.StringCustom(screen_size[0] / 2 + 18, screen_size[1] - 112, 0, "+-" + ping2 / 1  +"."+ ping2 * 3/1+"ms", [0,0,0,255], font2 );    
	Render.StringCustom(screen_size[0] / 2 + 17, screen_size[1] - 113, 0, "+-" + ping2 / 1  +"."+ ping2 * 3/1+"ms", [255,255,255,255 ], font2 );
	Render.StringCustom(screen_size[0] / 2 - 75, screen_size[1] - 92, 0, "loss:(+-"+ ping2 / 5+")  ", [0,0,0,255], font2 );    
	Render.StringCustom(screen_size[0] / 2 - 74, screen_size[1] - 93, 0, "loss:(+-"+ ping2 / 5+")  ", [255,255,255,255], font2);
	Render.StringCustom(screen_size[0] / 2 - 18, screen_size[1] - 92, 0, "ping: " + "          fps:", [0,0,0,255], font2 );    
	Render.StringCustom(screen_size[0] / 2 - 19, screen_size[1] - 93, 0, "ping: " + "          fps:", [255,255,255,255], font2);
	Render.StringCustom(screen_size[0] / 2 + 30, screen_size[1] - 92, 0, "    " + fps, [0,0,0,255], font2 );    
	Render.StringCustom(screen_size[0] / 2 + 31, screen_size[1] - 93, 0, "    " + fps, [255,255,255,255], font2);
	Render.StringCustom(screen_size[0] / 2 - 75, screen_size[1] - 71, 0, "time: " + hours + minutes + seconds + "   ticks: " + Globals.Tickrate().toString() + "   velocity: " + (GetVelocity().toFixed(0)).toString() + " u/s " , [0,0,0,255], font2 );    
	Render.StringCustom(screen_size[0] / 2 - 74, screen_size[1] - 72, 0, "time: " + hours + minutes + seconds + "   ticks: " + Globals.Tickrate().toString() + "   velocity: " + (GetVelocity().toFixed(0)).toString() + " u/s ", [255,255,255,255], font2 );
// fps < 60 ? [red[0],red[1],red[2],alpha_3 ] : 	
	
	Render.StringCustom(screen_size[0] / 2 + 0, screen_size[1] - 92, 0, " " + ping, [0,0,0,255], font2 );    
	Render.StringCustom(screen_size[0] / 2 + 1, screen_size[1] - 93, 0, " " + ping, ping > 60 ? [255, 125, 95, 255 ] : [255,255,255,255], font2);
	}
	else
	{	
	Render.StringCustom(screen_size[0] / 2 - 80, screen_size[1] - 112, 0, "lost connection ", [0,0,0,alpha_3], font2 );    
	Render.StringCustom(screen_size[0] / 2 - 79, screen_size[1] - 113, 0, "lost connection ", [255,255,255,alpha_3 ], font2 );
	Render.StringCustom(screen_size[0] / 2 + 18, screen_size[1] - 112, 0, "+-" + ping2 / 1  +"."+ ping2 * 3/1+"ms", [0,0,0,alpha_3], font2 );    
	Render.StringCustom(screen_size[0] / 2 + 17, screen_size[1] - 113, 0, "+-" + ping2 / 1  +"."+ ping2 * 3/1+"ms", [255,255,255,alpha_3 ], font2 );
	Render.StringCustom(screen_size[0] / 2 - 56, screen_size[1] - 92, 0, "(+-"+ ping2 / 4+")  ", [0,0,0,255], font2 );  
	Render.StringCustom(screen_size[0] / 2 - 80, screen_size[1] - 92, 0, "loss:", [0,0,0,255], font2 );    
	Render.StringCustom(screen_size[0] / 2 - 79, screen_size[1] - 93, 0, "loss:", [255,255,255,255], font2);
	Render.StringCustom(screen_size[0] / 2 - 61, screen_size[1] - 93, 0, "  (+-"+ ping2 / 4+")  ", [255, 82, 62, 255], font2);
	Render.StringCustom(screen_size[0] / 2 - 25, screen_size[1] - 92, 0, "ping: " + "          fps:", [0,0,0,255], font2 );    
	Render.StringCustom(screen_size[0] / 2 - 25, screen_size[1] - 93, 0, "ping: " + "          fps:", [255,255,255,255], font2);
	Render.StringCustom(screen_size[0] / 2 + 27, screen_size[1] - 92, 0, "    " + fps, [0,0,0,255], font2 );    
	Render.StringCustom(screen_size[0] / 2 + 26, screen_size[1] - 93, 0, "    " + fps,[255,255,255,255], font2);
	Render.StringCustom(screen_size[0] / 2 + -6, screen_size[1] - 92, 0, " " + ping, [0,0,0,255], font2 );    
	Render.StringCustom(screen_size[0] / 2 + -7, screen_size[1] - 93, 0, " " + ping, ping > 60 ? [255, 125, 95, 255 ] : [255,255,255,255], font2);
	Render.StringCustom(screen_size[0] / 2 - 79, screen_size[1] - 71, 0, "time: " + hours + minutes + seconds + "   ticks: " + Globals.Tickrate().toString() + "   velocity: " + (GetVelocity().toFixed(0)).toString() + " u/s " , [0,0,0,255], font2 );    
	Render.StringCustom(screen_size[0] / 2 - 78, screen_size[1] - 72, 0, "time: " + hours + minutes + seconds + "   ticks: " + Globals.Tickrate().toString() + "   velocity: " + (GetVelocity().toFixed(0)).toString() + " u/s ", [255,255,255,255], font2 );
	}
}

	
	
	
	Render.StringCustom(screen_size[0] / 2 - 48, screen_size[1] - 31, 0, "        exploit: ", [0,0,0,255], font2 );
	Render.StringCustom(screen_size[0] / 2 - 47, screen_size[1] - 32, 0, "        exploit: ", [255,255,255,255], font2 );
                  Render.StringCustom(screen_size[0] / 2 - 40, screen_size[1] - 21, 0, "lagcomp: ", [0,0,0,255], font2 );
	Render.StringCustom(screen_size[0] / 2 - 39, screen_size[1] - 22, 0, "lagcomp: ", [255,255,255,255], font2 );

	

	
	if (isHActive() == 1) 
	{
	Render.StringCustom(screen_size[0] / 2 + 3, screen_size[1] - 21, 0, "broken", [0, 0, 0,255], font2 );
	Render.StringCustom(screen_size[0] / 2 + 2, screen_size[1] - 22, 0, "broken", green, font2 );
	}
	if (isHActive() == 0)
	{
	Render.StringCustom(screen_size[0] / 2 + 2, screen_size[1] - 21, 0, "unsafe", [0, 0, 0,255], font2 );
	Render.StringCustom(screen_size[0] / 2 + 2, screen_size[1] - 22, 0, "unsafe", red, font2 );
	}
	if (isDoubleTapActive() == 1)
	{
	Render.StringCustom(screen_size[0] / 2 + 3, screen_size[1] - 31, 0, "shifting", [0, 0, 0,255], font2 );
	Render.StringCustom(screen_size[0] / 2 + 2, screen_size[1] - 32, 0, "shifting", green, font2 );
                  }
	if (isDoubleTapActive() == 0)
	{
	Render.StringCustom(screen_size[0] / 2 + 3, screen_size[1] - 31, 0, "disabled", [0, 0, 0,255], font2 );
	Render.StringCustom(screen_size[0] / 2 + 2, screen_size[1] - 32, 0, "disabled", red, font2 );
    }
  }
}

function fsn( ) {
    ui_arat_val = UI.GetValue( "Aspect ratio" );

    switch ( Global.FrameStage( ) ) {
        case 5: {
            Global.ExecuteCommand( "r_aspectratio " + ui_arat_val.toString()/100 );

            break;
        }
        default: break;
    }
}

function autoscope()
{
    localplayer_index = Entity.GetLocalPlayer( )
    localplayer_weapon = Entity.GetWeapon(localplayer_index)
    weapon_name = Entity.GetName(localplayer_weapon)

    if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Scope on scar")) {
    if (weapon_name == "scar 20" ||  weapon_name == "g3sg1")
        UI.SetValue( "Rage", "GENERAL", "General", "Auto scope", false )
    else
        UI.SetValue ("Rage", "GENERAL", "General", "Auto scope", true)
}
}


function safeAWP() {
    SlocalPlayer = Entity.GetLocalPlayer()
	SlocalPlayerWeapon = Entity.GetWeapon(SlocalPlayer)
	SlocalPlayerWeaponName = Entity.GetName(SlocalPlayerWeapon)

                  if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Safe AWP")) {
	if (SlocalPlayerWeaponName == 'awp' ) {
		forceSafePoint = UI.IsHotkeyActive('Rage', 'GENERAL', 'General', 'Force safe point')
		if (!forceSafePoint) {
			UI.ToggleHotkey('Rage', 'GENERAL', 'General', 'Force safe point')
			safePBackup = true
		}
	} else if (safePBackup) {
		UI.ToggleHotkey('Rage', 'GENERAL', 'General', 'Force safe point')
		safePBackup = false
	}
}
}

function pingspike()
{
    if (UI.IsHotkeyActive("Misc", "JAVASCRIPT", "Script items", "pingspike"))
    {
        UI.SetValue ("Misc", "GENERAL", "Miscellaneous", "Extended backtracking", true);
    }
    else
    {
        {
        UI.SetValue ("Misc", "GENERAL", "Miscellaneous", "Extended backtracking", false);
        }
    }
}

hitboxes = [
    'generic',
    'head',
    'chest',
    'stomach',
    'left arm',
    'right arm',
    'left leg',
    'right leg',
    '?'
];
var scriptitems = ("Misc", "JAVASCRIPT", "Script items");
var shots = 0;
var predicthc = 0;
var safety = 0;
var hitboxName = "";
var choked = 0;
var exploit = 0;
var logs = [];
var logsct = [];
var logsalpha = [];
function getHitboxName(index)
{
    switch (index)
    {
        case 0:
            hitboxName = "head";
            break;
        case 1:
            hitboxName = "head";
            break;
        case 2:
            hitboxName = "stomach";
            break;
        case 3:
            hitboxName = "stomach";
            break;
        case 4:
            hitboxName = "stomach";
            break;
        case 5:
            hitboxName = "chest";
            break;
        case 6:
            hitboxName = "chest";
            break;
        case 7:
            hitboxName = "left leg";
            break;
        case 8:
            hitboxName = "right leg";
            break;
        case 9:
            hitboxName = "left leg";
            break;
        case 10:
            hitboxName = "right leg";
            break;
        case 11:
            hitboxName = "left leg";
            break;
        case 12:
            hitboxName = "right leg";
            break;
        case 13:
            hitboxName = "left arm";
            break;
        case 14:
            hitboxName = "right arm";
            break;
        case 15:
            hitboxName = "left arm";
            break;
        case 16:
            hitboxName = "left arm";
            break;
        case 17:
            hitboxName = "right arm";
            break;
        case 18:
            hitboxName = "right arm";
            break;
        default:
            hitboxName = "body";
    }
    return hitboxName;
}
function HitgroupName(index) {
    return hitboxes[index] || 'body';
	                         }

var target = -1;
var shots_fired = 0;
var hits = 0;
var lastUpdate = 0;
var logged = false;

function ragebot_fire() {
	predicthc = Event.GetInt("hitchance");
	safety = Event.GetInt("safepoint");
	hitboxName = getHitboxName(Event.GetInt("hitbox"));
	exploit = (Event.GetInt("exploit")+1).toString();
  target = Event.GetInt("target_index");
  shots_fired++;
  logged = false;
  lastUpdate = Globals.Curtime();
}

function hitlog() {
    var hit = Entity.GetEntityFromUserID(Event.GetInt("userid"));
    var attacker = Entity.GetEntityFromUserID(Event.GetInt("attacker"));
    if (attacker == Entity.GetLocalPlayer() && hit == target) hits++;

    var hittype = "Hit ";
    me = Entity.GetLocalPlayer();
    hitbox = Event.GetInt('hitgroup');
    target_damage = Event.GetInt("dmg_health");
    target_health = Event.GetInt("health");
    victim = Event.GetInt('userid');
    attacker = Event.GetInt('attacker');
    weapon = Event.GetString('weapon');
    victimIndex = Entity.GetEntityFromUserID(victim);
    attackerIndex = Entity.GetEntityFromUserID(attacker);
    name = Entity.GetName(victimIndex);
  	var simtime = Globals.Tickcount() % 17;

    var flags = "";

    if (exploit == 2)
      flags += "T";

    flags += "B";

    if (hitbox == 1)
      flags += "H";

  	if (safety == 1) {
  		safety = "true";
  	}
  	else {
  		safety = "false";
  	}

    if (weapon == "hegrenade")
      hittype = "Naded ";
    else if (weapon == "inferno")
      hittype = "Burned ";
    else if (weapon == "knife")
      hittype = "Knifed ";

    if (me == attackerIndex && me != victimIndex) {
        colind = UI.GetColor("Misc", "Script items", "Indicators color")
		Cheat.PrintColor([colind[0], colind[1], colind[2], 255], "[bloodtech] ");
    if (hittype == "Hit ") {
        if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Enable chat logging")) {
            Cheat.PrintChat(" \x08[\x0cbloodtech\x08] [\x0c"+shots.toString()+"\x08] "+hittype+name+"'s \x10"+HitgroupName(hitbox)+"\x08 for \x07"+target_damage.toString()+"\x08 ("+target_health.toString()+" remaining) aimed=\x10"+hitboxName+"\x08("+predicthc.toString()+"%%) safety=\x03"+safety+"\x08 (\x10"+flags+"\x08) (\x10"+simtime+"\x08:\x10"+exploit+"\x08)\n");
        }
      Cheat.Print("["+shots.toString()+"] "+hittype+name+"'s "+HitgroupName(hitbox)+" for "+target_damage.toString()+" ("+target_health.toString()+" remaining) aimed="+hitboxName+"("+predicthc.toString()+"%%) bt=0 ("+flags+") ("+simtime+":"+exploit+")\n");
  		logs.push("["+shots.toString()+"] "+hittype+name+"'s "+HitgroupName(hitbox)+" for "+target_damage.toString()+" ("+target_health.toString()+" remaining) aimed="+hitboxName+"("+predicthc.toString()+"%%) bt=0 ("+flags+") ("+simtime+":"+exploit+")");
    }
    else {
      Cheat.Print("["+shots.toString()+"] "+hittype+name+"'s "+HitgroupName(hitbox)+" for "+target_damage.toString()+" ("+target_health.toString()+" remaining) \n");
  		logs.push("["+shots.toString()+"] "+hittype+name+"'s "+HitgroupName(hitbox)+" for "+target_damage.toString()+" ("+target_health.toString()+" remaining)");
    }

		logsct.push(Globals.Curtime());
		logsalpha.push(255);
	}

  if (shots == 99)
    shots = 0;
  else
    shots++;

}

function removelogs() {
	if (logs.length > 6) {
		logs.shift();
		logsct.shift();
		logsalpha.shift();
	}

	if (logsct[0] + 6.5 < Globals.Curtime()) {
		logsalpha[0] -= Globals.Frametime() * 600;
		if (logsalpha[0] < 0) {
			logs.shift();
			logsct.shift();
			logsalpha.shift();
		}
	}
}

function item_purchase() {
    colind = UI.GetColor("Misc", "Script items", "Indicators color")

	Cheat.PrintColor([colind[0], colind[1], colind[2], 255], "[bloodtech] ");
	Cheat.Print(Entity.GetName(Entity.GetEntityFromUserID(Event.GetInt("userid")))+" bought "+Event.GetString("weapon")+"\n");
	logs.push(Entity.GetName(Entity.GetEntityFromUserID(Event.GetInt("userid")))+" bought "+Event.GetString("weapon")+"");
	logsct.push(Globals.Curtime());
	logsalpha.push(255);
}

function onDraaw() {
    if (!World.GetServerString()) return;
    var font = Render.AddFont("Lucida Console", 8, 0);


	for (i = 0; i < logs.length; i++) {
        Render.StringCustom(4, 4 + 13*i, 0, logs[i], [0, 0, 0, logsalpha[i]], font);
		Render.StringCustom(3, 3 + 13*i, 0, logs[i], [255, 255, 255, logsalpha[i]], font);
    }

    if (shots_fired > hits && (Globals.Curtime() - lastUpdate > 0.33)) {
      if (Globals.Curtime() - lastUpdate > 1) {
        shots_fired = 0;
        hits = 0;
      }
      if (!logged) {
        var simtime = Globals.Tickcount() % 16;
        logged = true;
        var issafe = "true";
        var reason = "resolver";
        if (safety == 0) {
          issafe = "false";
        }

		if (Entity.IsAlive(target) == false)
			reason = "death";
		else if (Entity.IsAlive(Entity.GetLocalPlayer()) == false)
			reason = "dead";
        else if (safety == true && predicthc < 76)
            reason = "spread";
        else if (safety == true && predicthc > 76)
            reason = "prediction error";

        var flags = "";

        if (exploit == 2)
          flags += "T";

          flags += "B";

        colind = UI.GetColor("Misc", "Script items", "Indicators color")

        Cheat.PrintColor([colind[0], colind[1], colind[2], 255], "[bloodtech] ");
        Cheat.Print("["+shots.toString()+"] "+"Missed "+Entity.GetName(target)+"'s "+hitboxName+"("+predicthc.toString()+"%%) due to "+reason+", bt=0 ("+flags+") ("+simtime+":"+exploit+")\n");
            logs.push("["+shots.toString()+"] "+"Missed "+Entity.GetName(target)+"'s "+hitboxName+"("+predicthc.toString()+"%%) due to "+reason+", bt=0 ("+flags+") ("+simtime+":"+exploit+")");

            if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Enable chat logging")) {
                Cheat.PrintChat(" \x08[\x0cbloodtech\x08] [\x0c"+shots.toString()+"\x08] "+"\x08Missed "+Entity.GetName(target)+"'s \x10"+hitboxName+"\x08("+predicthc.toString()+"%%) due to \x07"+reason+"\x08, safety=\x03"+issafe+"\x08 (\x10"+flags+"\x08) (\x10"+simtime+"\x08:\x10"+exploit+"\x08)");
            }
        logsct.push(Globals.Curtime());
    		logsalpha.push(255);
        if (shots == 99)
          shots = 0;
        else
          shots++;
      }
    }
}

function ragdollForce( )
{
    UI.SetValue("Misc", "GENERAL", "Miscellaneous", "Ragdoll Gravity", "1")
    if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Ragdoll Force")) {
    framestage = Cheat.FrameStage();
    if (framestage == 3)
    { 
        entities = Entity.GetEntities();
        for (i = 0; i < entities.length; i++)
        {
            classID = Entity.GetClassID(entities[i]);
            if (classID == 42)
            {
                dir = Entity.GetProp(entities[i], "CCSRagdoll", "m_vecRagdollVelocity");
                dir[0] = 0
                dir[1] = 0
                dir[2] = 999999
                dir1 = Entity.GetProp(entities[i], "CBaseAnimating", "m_vecForce");
                dir1[0] = 0
                dir1[1] = 0
                dir1[2] = 999999
                Entity.SetProp(entities[i], "CCSRagdoll", "m_vecRagdollVelocity", dir);
                Entity.SetProp(entities[i], "CBaseAnimating", "m_vecForce", dir1);
            }
        }
      }
    }
}

function get_velocity(index)
{
    var velocity = Entity.GetProp(index, "CBasePlayer", "m_vecVelocity[0]");
    return Math.sqrt(velocity[0] * velocity[0] + velocity[1] * velocity[1]);
}

function get_health(index)
{
    health_override = Entity.GetProp(index, "CBasePlayer", "m_iHealth");
    return health_override;
}

function Low_delta()
{
    localplayer_index = Entity.GetLocalPlayer( );
    
       if (UI.IsHotkeyActive("Misc", "JAVASCRIPT", "Script items", "Low delta on key"))
        {
            AntiAim.SetOverride(1);
            AntiAim.SetFakeOffset(0);
		if(UI.IsHotkeyActive("Misc", "JAVASCRIPT", "Script items","Invertor Key"))
		{
          	  AntiAim.SetRealOffset(16);
        }
        else
		{
        	    AntiAim.SetRealOffset(-16);
		}
        }
        else
        {
            AntiAim.SetOverride(0);
        }
}

function isActive(a) {
        return UI.IsHotkeyActive("Misc", "JAVASCRIPT", "Script items", a)
}

function setValue(cat, value) {
        UI.SetValue("Rage", cat.toUpperCase(), "Targeting", "Minimum damage", value)
}

function isPistol(name) {
        if (name == "p2000" || weapon_name == "glock 18" || weapon_name == "dual berettas" || weapon_name == "usp s" || weapon_name == "five seven" || weapon_name == "p250" || weapon_name == "tec 9") {
                return true
        }
}

function isHeavyPistol(name) {
        if (name == "r8 revolver" || name == "desert eagle") {
                return true
        }
}

function isAutoSniper(name) {
        if (name == "scar 20" || weapon_name == "g3sg1") {
                return true
        }
}


function onCM() {
        weapon_value = UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Weapon Mindmg")
        weapon_name = Entity.GetName(Entity.GetWeapon(Entity.GetLocalPlayer()))

        if (isActive("Weapon Override") && isPistol(weapon_name)) {

                setValue("PISTOL", weapon_value)
        } else {
                setValue("PISTOL", pistol_cache)
        }

        if (isActive("Weapon Override") && isHeavyPistol(weapon_name)) {
                setValue("HEAVY PISTOL", weapon_value)
        } else {
                setValue("HEAVY PISTOL", heavy_cache)
        }

        if (isActive("Weapon Override") && weapon_name == "ssg 08") {
                setValue("SCOUT", weapon_value)
        } else {
                setValue("SCOUT", scout_cache)
        }

        if (isActive("Weapon Override") && weapon_name == "awp") {
                setValue("AWP", weapon_value)
        } else {
                setValue("AWP", awp_cache)
        }

        if (isActive("Weapon Override") && isAutoSniper(weapon_name)) {

                setValue("AUTOSNIPER", weapon_value)
        } else {
                setValue("AUTOSNIPER", auto_cache)
        }


}



function delta() {
    local = Entity.GetLocalPlayer();
    if (!UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Desync line") || !Entity.IsValid(local) || !Entity.IsAlive(local)) return;
    font = Render.AddFont("Verdana", 8, 400);
    x = screen_size[0];
    y = screen_size[1];
    coldelt = UI.GetColor("Misc", "JAVASCRIPT", "Script items", "line color");
    real_yaw = Local.GetRealYaw();
    fake_yaw = Local.GetFakeYaw();
    delta = Math.min(Math.abs(real_yaw - fake_yaw) / 2, 60).toFixed(0);
    delta_size = Render.TextSizeCustom(delta, font);
    Render.StringCustom(x / 2, y / 2 + 10, 1, delta, [255, 255, 255, 255], font);
    Render.GradientRect(x / 2, y / 2 + 30, (45 / 60) * delta, 2, 1, coldelt, [0, 0, 0, 0]);
    Render.GradientRect(x / 2 - (45 / 60) * delta + 1, y / 2 + 30, (45 / 60) * delta, 2, 1, [0, 0, 0, 0], coldelt);
}

function anim()
{
    if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "legfucker"))
    {
        clock = clock + 0.5
        if (clock > 1)
        {
            if (UI.GetValue("Misc", "GENERAL", "Movement", "Slide walk") && UI.GetValue("Anti-Aim", "Extra", "Jitter move"))
            {
                UI.SetValue("Misc", "GENERAL", "Movement", "Slide walk", 0);
                UI.SetValue("Anti-Aim", "Extra", "Jitter move", 0);
                clock = 0
            }
            else
            {
                UI.SetValue("Misc", "GENERAL", "Movement", "Slide walk", 1);
                UI.SetValue("Anti-Aim", "Extra", "Jitter move", 1);
                clock = 0
            }
        }
    }
}

var delay = 3

function fakelags()
{
    var send = UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Send Limit")
    var choke = UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Choke Limit")
    if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "jitter fakelag"))
	{
    if(tickcount >= choke && !flip)
    {
        flip = true
        tickcount = 0
    }
    if(tickcount >= send && flip)
    {
        flip = false
        tickcount = 0
    }
    UI.SetValue("Anti-Aim", "Fake-Lag", "Limit", !flip ? choke : 0)
    tickcount++
   }
}

function roundstart()
{
    tickcount = 0
}

function legit_aa()
{
    if (UI.IsHotkeyActive("Misc", "JAVASCRIPT", "Script items", "Legit AA Key"))
    {
        if (original_aa)
        {
            restrictions_cache = UI.GetValue("Misc", "PERFORMANCE & INFORMATION", "Information", "Restrictions");
            hiderealangle_cache = UI.GetValue ("Anti-Aim", "Fake angles", "Hide real angle");
            yaw_offset_cache = UI.GetValue ("Anti-Aim", "Rage Anti-Aim", "Yaw offset");
            jitter_offset_cache = UI.GetValue ("Anti-Aim", "Rage Anti-Aim", "Jitter offset");
            pitch_cache = UI.GetValue ("Anti-Aim", "Extra", "Pitch");
            original_aa = false;
        }
        UI.SetValue ("Misc", "PERFORMANCE & INFORMATION", "Information", "Restrictions", 0);
        UI.SetValue ("Anti-Aim", "Fake angles", "Hide real angle", true);
        UI.SetValue ("Anti-Aim", "Rage Anti-Aim", "Yaw offset", 180);
        UI.SetValue ("Anti-Aim", "Rage Anti-Aim", "Jitter offset", 0);
        UI.SetValue ("Anti-Aim", "Extra", "Pitch", 0);
    }
    else
    {
        if (!original_aa)
        {
            UI.SetValue ("Misc", "PERFORMANCE & INFORMATION", "Information", "Restrictions", restrictions_cache);
            UI.SetValue ("Anti-Aim", "Fake angles", "Hide real angle", hiderealangle_cache);
            UI.SetValue ("Anti-Aim", "Rage Anti-Aim", "Yaw offset", yaw_offset_cache);
            UI.SetValue ("Anti-Aim", "Rage Anti-Aim", "Jitter offset", jitter_offset_cache);
            UI.SetValue ("Anti-Aim", "Extra", "Pitch", pitch_cache);
            original_aa = true;
        }
    }
}

var lasttime = 0;
function onRender( )
{
var tag = UI.GetValue("Script items", "clantag");
var speed = 4.5;
var time = parseInt((Globals.Curtime() * speed))
if (time != lasttime)
{
if (tag == 1) {
switch ((time) % 38) {

case 1: { Local.SetClanTag("advance.tech"); break; }

}
}
}
lasttime = time;
}


var scoutCach = UI.GetValue('Rage', 'SCOUT', 'Accuracy', 'Hitchance')
var revolverCach = UI.GetValue('Rage', 'HEAVY PISTOl', 'Accuracy', 'Hitchance')
function airHC() {
    var scoutAir = UI.GetValue('Misc', 'JAVASCRIPT', 'Script items', 'Jump scout hitchance')
    var revolverAir = UI.GetValue('Misc', 'JAVASCRIPT', 'Script items', 'Jump revolver hitchance')
   
    var local = Entity.GetLocalPlayer()
    var localWeapon = Entity.GetWeapon(local)
    var localWeaponName = Entity.GetName(localWeapon)
    var inAir = Entity.GetProp(local, 'CBasePlayer', 'm_hGroundEntity')
if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Jump scout/r8"))
{
    if (localWeaponName == 'r8 revolver' && inAir =='m_hGroundEntity') {
        UI.SetValue('Rage', 'HEAVY PISTOL', 'Accuracy', 'Hitchance', revolverAir)
    } else {
        UI.SetValue('Rage', 'HEAVY PISTOL', 'Accuracy', 'Hitchance', revolverCach)
    }
    if (localWeaponName == 'ssg 08' && inAir == 'm_hGroundEntity') {
        UI.SetValue('Rage', 'SCOUT', 'Accuracy', 'Hitchance', scoutAir)
    } else {
        UI.SetValue('Rage', 'SCOUT', 'Accuracy', 'Hitchance', scoutCach)
    }
  }
}

/* ------------------------------------------------------ */

const clr = [
    text = [ 240, 240, 240, 255 ],
    main = [ 38, 38, 38, 160 ],
    back = [ 32, 32, 32, 255 ],
    high = [ 48, 48, 48, 255 ],
    red  = [ 240, 41, 41, 255 ],
]

var positions = [];
var trace = [];
var render = [];
var local = Entity.GetLocalPlayer();

function Clamp(v, min, max)
{
    return Math.max(Math.min(v, max), min);
}

/* ------------------------------------------------------ */

function ImportGrenades()
{
    var grenades = Entity.GetEntitiesByClassID(9).concat(Entity.GetEntitiesByClassID(114).concat(Entity.GetEntitiesByClassID(100)));
    for (e in grenades)
    {
        pass = false;
        for (g in positions)
        {
            if (positions[g][0] == grenades[e])
            {
                pass = true;
                continue;
            }
        }
        if (pass)
            continue;

        positions.push([grenades[e], Globals.Curtime(), [Entity.GetRenderOrigin(grenades[e])], Globals.Curtime()]);
    }
}

/* ------------------------------------------------------ */

const clr = [
    text = [ 240, 240, 240, 255 ],
    main = [ 38, 38, 38, 160 ],
    back = [ 32, 32, 32, 255 ],
    high = [ 48, 48, 48, 255 ],
    red  = [ 240, 41, 41, 255 ],
]

var positions = [];
var trace = [];
var render = [];
var local = Entity.GetLocalPlayer();

function Clamp(v, min, max)
{
    return Math.max(Math.min(v, max), min);
}

/* ------------------------------------------------------ */

function ImportGrenades()
{
    var grenades = Entity.GetEntitiesByClassID(9).concat(Entity.GetEntitiesByClassID(113).concat(Entity.GetEntitiesByClassID(100)));
    for (e in grenades)
    {
        pass = false;
        for (g in positions)
        {
            if (positions[g][0] == grenades[e])
            {
                pass = true;
                continue;
            }
        }
        if (pass)
            continue;

        positions.push([grenades[e], Globals.Curtime(), [Entity.GetRenderOrigin(grenades[e])], Globals.Curtime()]);
    }
}
function GrenadeWarning()
{
    var grenades = Entity.GetEntitiesByClassID(9).concat(Entity.GetEntitiesByClassID(114).concat(Entity.GetEntitiesByClassID(100)));

    if (!Entity.IsAlive(local)) { return; }
    
    for (g in grenades) {
        for (var i = 0; i < grenades.length; i++) {
            
            var g = grenades[i];
            var isInferno = Entity.GetClassID(g) === 100;
            var isHeGrenade = Entity.GetClassID(g) === 9;
            function DistanceInFeets (origin, destination) {
                var sub = [destination[0] - origin[0], destination[1] - origin[1], destination[2] - origin[2]];
                return Math.round(Math.sqrt(sub[0] ** 2 + sub[1] ** 2 + sub[2] ** 2) / 12);
            }
            var destination = Entity.GetRenderOrigin(g);
            var origin = Entity.GetEyePosition(local);
            var distance = DistanceInFeets(origin, destination);
            var screen = Render.WorldToScreen(destination);
            var isSafe = distance > (isInferno ? 15 : 20) || trace[1] < 0.61;
            if (distance > 256) { continue; }
            if (isHeGrenade && Entity.GetProp (g, "CBaseCSGrenadeProjectile", "m_nExplodeEffectTickBegin")) { continue; }
            font = Render.AddFont("Small fonts", 7, 100);
            const warning_stroke = true;
            Render.FilledCircle( screen[0], screen[1] + 39, 25, [ 0, 0, 0, 30 ])
            Render.Circle( screen[0], screen[1] + 39, 25, !isSafe && warning_stroke ? [ 240, 41, 41, 255 ] : [ 0, 0, 0, 255 ])
            Render.StringCustom (screen[0] - 10, screen[1] + 48, 0, Math.round(distance / 3.28) + " m", [ 0, 0, 0, 255 ], font);
            Render.StringCustom (screen[0] - 9, screen[1] + 49, 0, Math.round(distance / 3.28) + " m", [ 240, 240, 240, 255 ], font);
            Render.String (screen[0] - 8, screen[1] + 27, 0, isHeGrenade ? "I" : "K", [ 240, 240, 240, 255 ], 5);
        }
    }
}
/* ------------------------------------------------------ */

const clr = [
    text = [ 240, 240, 240, 255 ],
    main = [ 38, 38, 38, 160 ],
    back = [ 32, 32, 32, 255 ],
    high = [ 48, 48, 48, 255 ],
    red  = [ 240, 41, 41, 255 ],
]

var positions = [];
var trace = [];
var render = [];
var local = Entity.GetLocalPlayer();

function Clamp(v, min, max)
{
    return Math.max(Math.min(v, max), min);
}

/* ------------------------------------------------------ */
function enQWarn()
{
    var grenades = Entity.GetEntitiesByClassID(9).concat(Entity.GetEntitiesByClassID(114).concat(Entity.GetEntitiesByClassID(100)));

    if (!Entity.IsAlive(local)) { return; }
  
    for (g in grenades) {
        for (var i = 0; i < grenades.length; i++) {
          
            var g = grenades[i];
            var isInferno = Entity.GetClassID(g) === 100;
            var isHeGrenade = Entity.GetClassID(g) === 9;

            /* --------------- */

            function DistanceInFeets (origin, destination) {
                var sub = [destination[0] - origin[0], destination[1] - origin[1], destination[2] - origin[2]];
                return Math.round(Math.sqrt(sub[0] ** 2 + sub[1] ** 2 + sub[2] ** 2) / 12);
                //return Math.round(sub[0] + sub[1] + sub[2]); // Для измерения в юнитах
            }

            /* --------------- */

            var destination = Entity.GetRenderOrigin(g);
            var origin = Entity.GetEyePosition(local);
            var distance = DistanceInFeets(origin, destination);
            var screen = Render.WorldToScreen(destination);
            var isSafe = distance > (isInferno ? 15 : 20) || trace[1] < 0.61;

            /* --------------- */

            if (distance > 256) { continue; }

            if (isHeGrenade && Entity.GetProp (g, "CBaseCSGrenadeProjectile", "m_nExplodeEffectTickBegin")) { continue; }

            /* --------------- */

            Render.FilledRect (screen[0] + 16, screen[1] - 12, 48, 24, clr[1]);

            Render.Polygon ([ [ screen[0] + 8,  screen[1] - 1 ], [ screen[0] + 16, screen[1] - 8 ], [ screen[0] + 16, screen[1] + 8 ] ], clr[1]);

            Render.String (screen[0] + 36, screen[1] - 5, 0, Math.round(distance / 3.28) + " m", clr[0], 3);
            Render.String (screen[0] + 20, screen[1] - 6, 0, isHeGrenade ? "I" : "K", isSafe ? clr[0] : clr[4], 6);

            /* --------------- */

            const warning_stroke = false; // true для красной обводки при опасности

            Render.Line ( screen[0] + 8, screen[1], screen[0] + 16, screen[1] - 8, !isSafe && warning_stroke ? clr[4] : clr[3])
            Render.Line ( screen[0] + 8, screen[1], screen[0] + 16, screen[1] + 8, !isSafe && warning_stroke ? clr[4] : clr[3])

            Render.Line ( screen[0] + 16, screen[1] - 12, screen[0] + 16, screen[1] - 7, !isSafe && warning_stroke ? clr[4] : clr[3])
            Render.Line ( screen[0] + 16, screen[1] + 12, screen[0] + 16, screen[1] + 8, !isSafe && warning_stroke ? clr[4] : clr[3])

            Render.Line ( screen[0] + 16, screen[1] - 12, screen[0] + 64, screen[1] - 12, !isSafe && warning_stroke ? clr[4] : clr[3])
            Render.Line ( screen[0] + 16, screen[1] + 12, screen[0] + 64, screen[1] + 12, !isSafe && warning_stroke ? clr[4] : clr[3])
            Render.Line ( screen[0] + 64, screen[1] + 12, screen[0] + 64, screen[1] - 12, !isSafe && warning_stroke ? clr[4] : clr[3])
          
            /* --------------- */

            if (isInferno)
            {
                var time = Entity.GetProp(g, "CInferno", "m_nFireEffectTickBegin") * Globals.TickInterval();
                var factor = Clamp(((time + 7) - Globals.Curtime()) / 7, 0, 7);
  
                Render.FilledRect(screen[0] + 16, screen[1] + 10, 48, 2, clr[2]);
                Render.FilledRect(screen[0] + 16, screen[1] + 10, Math.trunc(factor * 48), 2, clr[4]);
            }
        }
    }
}

/* ------------------------------------------------------ */

function DrawNade()
{
if (UI.GetValue("Misc", "JAVASCRIPT", "Script items","Nade warning") == true)
  {
if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Warning type") == 0)
    {
    ImportGrenades();
    GrenadeWarning();
    };
if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Warning type") == 1)
    {
    ImportGrenades();
    enQWarn();
    }
  }
}




function armsColor()
{
    if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Enable Custom Arms")) {
    var team = Entity.GetProp(Entity.GetLocalPlayer(),"DT_BaseEntity", "m_iTeamNum");
    if(team == 2){ // T
    if(Convar.GetString("r_skin") == UI.GetValue("T arms skin")) return;
    Global.ExecuteCommand("r_skin " + UI.GetValue("T arms skin"));
    }
    else if(team == 3){ // CT
    if(Convar.GetString("r_skin") == UI.GetValue("CT arms skin")) return;
    Global.ExecuteCommand("r_skin " + UI.GetValue("CT arms skin"));
    }
  }
}

function drawscope() {
    var dist = UI.GetValue ("Misc", "JAVASCRIPT", "Script items", "Distance from crosshair");
    var size = UI.GetValue ("Misc", "JAVASCRIPT", "Script items", "Size of lines");
    var color =UI.GetColor( "Misc", "JAVASCRIPT", "Script items", "Scope color" );
    var color2 =UI.GetColor( "Misc", "JAVASCRIPT", "Script items", "Scope color 2" );
    var local = Entity.GetLocalPlayer();
    var is_scope = Entity.GetProp (local, "DT_CSPlayer", "m_bIsScoped");
    localplayer_index = Entity.GetLocalPlayer( )
    localplayer_weapon = Entity.GetWeapon(localplayer_index)
    weapon_name = Entity.GetName(localplayer_weapon)

if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Enable custom scope", true)) {
    if ((is_scope) && (weapon_name == "scar 20" ||  weapon_name == "g3sg1" || weapon_name == "ssg 08" || weapon_name == "awp")) {
            var screen_size = Global.GetScreenSize();
            x = screen_size[0] / 2;
            y = screen_size[1] / 2;

        Render.GradientRect ( x + dist + 1, y, size, 1, 1, [color[0], color[1], color[2], 255], [color2[0], color2[1], color2[2], 50] );
        Render.GradientRect ( x, y + dist + 1, 1, size, 0, [color[0], color[1], color[2], 255], [color2[0], color2[1], color2[2], 50] );
        Render.GradientRect ( x - dist  - size, y, size, 1, 1, [color2[0], color2[1], color2[2], 50], [color[0], color[1], color[2], 255] );
        Render.GradientRect ( x, y - dist - size, 1, size, 0, [color2[0], color2[1], color2[2], 50], [color[0], color[1], color[2], 255] );

        Convar.SetFloat("r_drawvgui", 0)
        Convar.SetFloat("cl_draw_only_deathnotices", 1)
        }
        else
        {
        Convar.SetFloat("r_drawvgui", 1)
        Convar.SetFloat("cl_draw_only_deathnotices", 0)
        }
    }
}

const thirdperson = function() {
    local = Entity.GetLocalPlayer()
    var thirdperson_cache = UI.GetValue("Thirdperson distance"),
    hotkey_state = UI.IsHotkeyActive("Misc", "JAVASCRIPT", "Script items", "Animated thirdperson"),
    fade_factor = ((1 / .005) * Globals.Frametime())
    if(UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Enable anim thirdperson"))
    {
    if(hotkey_state && person != 1 && Entity.IsAlive(local))
        person = clamp(person - fade_factor, 49, thirdperson_cache)
    if(!hotkey_state && person != 0 || !Entity.IsAlive(local))
        person = clamp(person + fade_factor, 49, thirdperson_cache)
    if(hotkey_state && person == 49 && turned) {
        UI.ToggleHotkey("Visuals", "WORLD", "View", "Thirdperson")
        turned = 0
    }

    if(!hotkey_state && person > 49 && !turned) {
        UI.ToggleHotkey("Visuals", "WORLD", "View", "Thirdperson")
        turned = 1
    }

    if(turned && !UI.IsHotkeyActive("Visuals", "WORLD", "View", "Thirdperson") || !turned && UI.IsHotkeyActive("Visuals", "WORLD", "View", "Thirdperson"))
        UI.ToggleHotkey("Visuals", "WORLD", "View", "Thirdperson")
    if(person != 0) UI.SetValue("Visuals", "WORLD", "View", "Thirdperson", person );
    }
    else {
        UI.SetValue("Visuals", "WORLD", "View", "Thirdperson", thirdperson_cache );
    }
}

const unload = function() {
    UI.SetValue("Visuals", "WORLD", "View", "Thirdperson", thirdperson_cache );
}

function fps_boost()
{
    if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Fps Boost"))
        {
            // Disable shadows ->
            Convar.SetString("r_shadows", "0");
            Convar.SetString("cl_csm_static_prop_shadows", "0");
            Convar.SetString("cl_csm_shadows", "0");
            Convar.SetString("cl_csm_world_shadows", "0");
            Convar.SetString("cl_foot_contact_shadows", "0");
            Convar.SetString("cl_csm_viewmodel_shadows", "0");
            Convar.SetString("cl_csm_rope_shadows", "0");
            Convar.SetString("cl_csm_sprite_shadows", "0");
            // Disable blood ->
            Convar.SetString("violence_hblood", "0");
        
            // Disable 3dsky ->
            Convar.SetString("r_3dsky", "0");

            // Disable decals ->
            //Convar.SetString("r_drawdecals", "0");

            // Disable rain ->
            Convar.SetString("r_drawrain", "0");
        
            // Disable ropes ->
            Convar.SetString("r_drawropes", "0");

            // Disable sprites ->
            Convar.SetString("r_drawsprites", "0");

            // Disable water fog ->
            Convar.SetString("fog_enable_water_fog", "0");
        }
        else
        {
            // Enable shadows ->
            Convar.SetString("r_shadows", "1");
            Convar.SetString("cl_csm_static_prop_shadows", "1");
            Convar.SetString("cl_csm_shadows", "1");
            Convar.SetString("cl_csm_world_shadows", "1");
            Convar.SetString("cl_foot_contact_shadows", "1");
            Convar.SetString("cl_csm_viewmodel_shadows", "1");
            Convar.SetString("cl_csm_rope_shadows", "1");
            Convar.SetString("cl_csm_sprite_shadows", "1");
        
            // Enable blood ->
            Convar.SetString("violence_hblood", "1");
        
            // Enable 3dsky ->
            Convar.SetString("r_3dsky", "1");

            // Enable decals ->
            //Convar.SetString("r_drawdecals", "1");

            // Enable rain ->
            Convar.SetString("r_drawrain", "1");
        
            // Enable ropes ->
            Convar.SetString("r_drawropes", "1");

            // Enable sprites ->
            Convar.SetString("r_drawsprites", "1");

            // Enable water fog ->
            Convar.SetString("fog_enable_water_fog", "1");
        }
}

function training_server() {
    if (!UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Training server")) return;
    Cheat.ExecuteCommand("bot_kick");
    Cheat.ExecuteCommand("sv_cheats 1");
    Cheat.ExecuteCommand("mp_roundtime_defuse 99999999999999999999");
    Cheat.ExecuteCommand("mp_roundtime_hostage 99999999999999999999");
    Cheat.ExecuteCommand("mp_roundtime 99999999999999999999");
    Cheat.ExecuteCommand("mp_warmup_end");
    Cheat.ExecuteCommand("sv_infinite_ammo 1");
    Cheat.ExecuteCommand("mp_maxmoney 64000");
    Cheat.ExecuteCommand("mp_startmoney 64000");
    Cheat.ExecuteCommand("ammo_grenade_limit_total 6");
    Cheat.ExecuteCommand("mp_buy_anywhere 1");
    Cheat.ExecuteCommand("sv_grenade_trajectory 1");
    Cheat.ExecuteCommand("sv_showimpacts_time 10");
    Cheat.ExecuteCommand("sv_showimpacts 1");
    Cheat.ExecuteCommand("sv_grenade_trajectory_time 10");
    Cheat.ExecuteCommand("mp_buytime 99999999999999999999");
    Cheat.ExecuteCommand("mp_restartgame 1");
    Cheat.ExecuteCommand("mp_freezetime 1");
    Cheat.ExecuteCommand("cl_showpos 1");
    Cheat.ExecuteCommand("sv_airaccelerate 206");
    Cheat.ExecuteCommand("mp_respawn_on_death_ct 1");
    Cheat.ExecuteCommand("mp_respawn_on_death_t 1");
    Cheat.ExecuteCommand("god");
    UI.SetValue("Misc", "JAVASCRIPT", "Script items", "Training server", 0)
}

//UI.AddDropdown( "Sections", [ "Rage", "Anti-Aim", "Visual", "Misc" ] );
function menu(){

    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","pingspike", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Weapon Override", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Weapon Mindmg", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Jump scout/r8", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items",'Jump scout hitchance', false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items",'Jump revolver hitchance', false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Desync line", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","line color", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Arrows color", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Selected arrow color"   , false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Selected inverter color", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Animated indicators", Visuals)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Display arrows", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Left", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Right", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","legfucker", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Low delta", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Low delta on key", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Invertor Key", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Legit AA Key", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","jitter fakelag", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Send Limit", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Choke Limit", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Aspect ratio", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Enable chat logging", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Clantag", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Safe AWP", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Scope on scar", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Ragdoll Force", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Enable Custom Arms", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","T arms skin", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","CT arms skin", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Enable clock sync", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Enable custom scope", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Distance from crosshair", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Size of lines", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Scope color", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Scope color 2", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Peek Helper for AWP/Scout", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Animated thirdperson", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Thirdperson distance", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Training server", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Fps Boost", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Enable anim thirdperson", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Indicators color", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Warning type", false)
    UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Nade warning", false)
   
    if(UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Sections") == 0){
      // Rage
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","pingspike", true)
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Peek Helper for AWP/Scout", true)
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Weapon Override", true)
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Weapon Mindmg", true)
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Jump scout/r8", true)
        if (UI.GetValue("Misc", "JAVASCRIPT", "Script items","Jump scout/r8"))
        {
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items",'Jump scout hitchance', true)
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items",'Jump revolver hitchance', true)
        }
    }
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Desync line", true)
        if (UI.GetValue("Misc", "JAVASCRIPT", "Script items","Desync line"))
        {
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","line color", true)
        }
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Nade warning", true)
        if (UI.GetValue("Misc", "JAVASCRIPT", "Script items","Nade warning"))
        {
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Warning type", true)
        }
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Animated indicators",Visuals)
        if (UI.GetValue("Misc", "JAVASCRIPT", "Script items","Animated indicators"))
        {
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Indicators color", true)
        }
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Enable clock sync", true)
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Display arrows", true)
        if (UI.GetValue("Misc", "JAVASCRIPT", "Script items","Display arrows"))
        {
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Arrows color", true)
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Selected arrow color"   , true)
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Selected inverter color", true)
        }
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Enable custom scope", true)
        if (UI.GetValue("Misc", "JAVASCRIPT", "Script items","Enable custom scope"))
        {
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Distance from crosshair", true)
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Size of lines", true)
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Scope color", true)
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Scope color 2", true)
    }
    if(UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Sections") == 1){
        //Anti-Aim
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","legfucker", true)
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Low delta", true)
        if (UI.GetValue("Misc", "JAVASCRIPT", "Script items","Low delta"))
        {
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Low delta on key", true)
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Invertor Key", true)
        }
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Legit AA Key", true)
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","jitter fakelag", true)
        if (UI.GetValue("Misc", "JAVASCRIPT", "Script items","jitter fakelag"))
        {
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Send Limit", true)
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Choke Limit", true)
        }
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Left", true)
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Right", true)

    }
    if(UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Sections") == 3){
      // Misc
 
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Enable anim thirdperson", true)
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Aspect ratio", true)
        if (UI.GetValue("Misc", "JAVASCRIPT", "Script items","Enable anim thirdperson"))
        {
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Animated thirdperson", true)
        }
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Thirdperson distance", true)
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Enable chat logging", true)
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Clantag", true)
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Safe AWP", true)
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Scope on scar", true)
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Ragdoll Force", true)
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Training server", true)
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Fps Boost", true)
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","Enable Custom Arms", true)
        if (UI.GetValue("Misc", "JAVASCRIPT", "Script items","Enable Custom Arms"))
        {
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","T arms skin", true)
        UI.SetEnabled("Misc", "JAVASCRIPT", "Script items","CT arms skin", true)
        }
    }
}
  Cheat.RegisterCallback("Draw","menu");

function Main()
{




        
       // UI.AddColorPicker("Indicators color")
	
	//  callbacks
    Global.RegisterCallback("Draw", "drawind")
    //Global.RegisterCallback("player_hurt", "hitlog");
    //Global.RegisterCallback("Draw", "removelogs");
    //Global.RegisterCallback("Draw", "onDraw");
    Global.RegisterCallback("Draw", "indication")
}
Main();


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/*
███╗░░░███╗██╗░██████╗░█████╗░
████╗░████║██║██╔════╝██╔══██╗
██╔████╔██║██║╚█████╗░██║░░╚═╝
██║╚██╔╝██║██║░╚═══██╗██║░░██╗
██║░╚═╝░██║██║██████╔╝╚█████╔╝
╚═╝░░░░░╚═╝╚═╝╚═════╝░░╚════╝░
*/

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function FreezeLegs(){
	Rocket.API(Animbreak(Air), true);
	Material.Create("Destroyed")
}
Material.Create("Destroyed")
UI.AddDropdown("Visible type", ["Custom", "Flat", "Pulse", "Wireframe", "Glow", "Glow (two-color)", "Destroyed"]);
function FreezeLegs2(){
	if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "freeze legs in air (visuals break)")){
		Getcolorand_cache = UI.GetValue("Visual", "SELF", "Chams", "Visible Color");
		Getcolorand2_cache = UI.GetValue("Visual", "SELF", "Chams", "Visible type");
        UI.SetValue("Visual", "SELF", "Chams", "Visible override", 1);
        UI.SetValue("Visual", "SELF", "Chams", "Visible type", 6);
        UI.SetValue("Visual", "SELF", "Chams", "Visible transparency", 100);
        UI.SetValue("Visual", "SELF", "Chams", "Visible transparency", 100);
        UI.SetValue("Visual", "SELF", "Chams", "Desync override", 1);
        UI.SetValue("Visual", "SELF", "Chams", "Desync type", 6);
        UI.SetValue("Visual", "SELF", "Chams", "Desync transparency", 0);
        UI.SetValue("Visual", "SELF", "Chams", "Desync transparency", 0);
	}
}
Cheat.RegisterCallback("Draw","FreezeLegs2")

var old_tick_count = 0;
function animfuckerfeature()
{
    if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "animfucker") && (Globals.Tickcount() - old_tick_count) > (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "animfucker speed")))
    {
        if (UI.GetValue("Misc", "GENERAL", "Movement", "Slide walk"))
            UI.SetValue("Misc", "GENERAL", "Movement", "Slide walk", 0);
        else
            UI.SetValue("Misc", "GENERAL", "Movement", "Slide walk", 1);
        old_tick_count = Globals.Tickcount();
    }
}
Cheat.RegisterCallback("Draw", "animfuckerfeature");

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

