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

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

    return isCheckboxActive1 && isKeyActive1;
}




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

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 (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, 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: " + (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 );
	
	
	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: " + (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 );
	}
}
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 (isHActive() == 0 && isDoubleTapActive() == 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 (isDoubleTapActive() == 0 && isHActive() == 0 && velocity < 270)
	{
	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] - 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", "draw");