Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.93 KB | None | 0 0
  1. function wm()
  2.  
  3.     drawline();
  4.  
  5.     local g_Local = entities.GetLocalPlayer()
  6.    
  7.     if g_Local == nil then
  8.         return
  9.     end
  10.  
  11.     drawrect();
  12.     drawtext();
  13.  
  14. end
  15.  
  16. local frame_rate = 0.0
  17.     local get_abs_fps = function()
  18.         frame_rate = 0.9 * frame_rate + (1.0 - 0.9) * globals.AbsoluteFrameTime()
  19.         return math.floor((1.0 / frame_rate) + 0.5)
  20. end
  21.  
  22. function drawrect()
  23.  
  24.     local sw, sh = draw.GetScreenSize();
  25.     --aw
  26.  
  27.     draw.Color(44, 42, 99, 200); --thicc outline color
  28.     draw.FilledRect(sw/1.186, sh/90, sw/1.139, sh/18.946); --outline rect
  29.     draw.Color(34, 29, 70, 220); --inside rect color
  30.     draw.FilledRect(sw/1.181, sh/63.529, sw/1.144, sh/20.769); --inside rect
  31.     draw.Color(18, 12, 38, 255); --inside rect outline color
  32.     draw.OutlinedRect(sw/1.182, sh/67.5, sw/1.143, sh/20.377); --inside rect outline
  33.     draw.OutlinedRect(sw/1.186, sh/98.181, sw/1.139, sh/18.620); --outside rect outline
  34.  
  35.     --info
  36.  
  37.     draw.Color(44, 42, 99, 200); --thicc outline color
  38.     draw.FilledRect(sw/1.138, sh/90, sw/1.053, sh/18.946); --outline rect
  39.     draw.Color(34, 29, 70, 220); --inside rect color
  40.     draw.FilledRect(sw/1.134, sh/63.529, sw/1.0565, sh/20.769); --inside rect
  41.     draw.Color(18, 12, 38, 255); --inside rect outline color
  42.     draw.OutlinedRect(sw/1.134, sh/67.5, sw/1.0565, sh/20.377); --inside rect outline
  43.     draw.OutlinedRect(sw/1.138, sh/98.181, sw/1.053, sh/18.620); --outside rect outline
  44.  
  45.     --time
  46.  
  47.     draw.Color(44, 42, 99, 200); --thicc outline color
  48.     draw.FilledRect(sw/1.052, sh/90, sw/1.0045, sh/18.946); --outline rect
  49.     draw.Color(34, 29, 70, 220); --inside rect color
  50.     draw.FilledRect(sw/1.048, sh/63.529, sw/1.008, sh/20.769); --inside rect
  51.     draw.Color(18, 12, 38, 255); --inside rect outline color
  52.     draw.OutlinedRect(sw/1.0485, sh/67.5, sw/1.0075, sh/20.377); --inside rect outline
  53.     draw.OutlinedRect(sw/1.052, sh/98.181, sw/1.0047, sh/18.620); --outside rect outline
  54.  
  55. end
  56.  
  57. function drawtext()
  58.  
  59.     local sw, sh = draw.GetScreenSize();
  60.     local f = draw.CreateFont("Arial", 30, 1200);
  61.     local i = draw.CreateFont("Arial", 14, 500);
  62.     local val = draw.CreateFont("Arial", 17, 600);
  63.     local t = draw.CreateFont("Arial", 17, 600);
  64.     local rw,rh;
  65.     local date = os.date("*t")
  66.  
  67.     local speed = 0;
  68.     local latency= 0;
  69.      if entities.FindByClass( "CBasePlayer" )[1] ~= nil then
  70.         latency=entities.GetPlayerResources():GetPropInt( "m_iPing", client.GetLocalPlayerIndex() )
  71.      end
  72.  
  73.     --name
  74.  
  75.     draw.SetFont(f);
  76.     draw.Color(255, 255, 255, 255);
  77.     draw.TextShadow(sw/1.177, sh/54, "A");
  78.     draw.Color(201, 47, 96, 255);
  79.     draw.TextShadow(sw/1.163, sh/54, "W");
  80.  
  81.     --info
  82.  
  83.     --fps
  84.     draw.SetFont(i);
  85.     draw.Color(255, 255, 255, 255);
  86.     draw.Text(sw/1.128, sh/29.189, "FPS");
  87.     draw.SetFont(val);
  88.     if (get_abs_fps() < 30) then
  89.         draw.Color(255, 0, 0);
  90.     else
  91.         draw.Color(126, 183, 50);
  92.     end
  93.     rw,rh = draw.GetTextSize(get_abs_fps());
  94.     draw.TextShadow(sw/1.121 - (rw/2), sh/49.09, get_abs_fps());
  95.  
  96.     --ping
  97.     draw.SetFont(i);
  98.     draw.Color(255, 255, 255, 255);
  99.     draw.Text(sw/1.104, 37, "PING");
  100.     draw.SetFont(val);
  101.     draw.Color(126, 183, 50);
  102.     rw,rh = draw.GetTextSize(latency);
  103.     draw.TextShadow(sw/1.096 - (rw/2), sh/49.09, latency);
  104.  
  105.     --speed
  106.     draw.SetFont(i);
  107.     draw.Color(255, 255, 255, 255);
  108.     draw.Text(sw/1.082, sh/29.189, "SPEED");
  109.     draw.SetFont(val);
  110.     if entities.GetLocalPlayer() ~= nil then
  111.  
  112.         local Entity = entities.GetLocalPlayer();
  113.         local Alive = Entity:IsAlive();
  114.         local velocityX = Entity:GetPropFloat( "localdata", "m_vecVelocity[0]" );
  115.         local velocityY = Entity:GetPropFloat( "localdata", "m_vecVelocity[1]" );
  116.         local velocity = math.sqrt( velocityX^2 + velocityY^2 );
  117.         local FinalVelocity = math.min( 9999, velocity ) + 0.2;
  118.         if ( Alive == true ) then
  119.           speed= math.floor(FinalVelocity) ;
  120.         else
  121.           speed=0;
  122.         end
  123.     end
  124.     rw,rh = draw.GetTextSize(speed)
  125.     draw.Color(126, 183, 50);
  126.     draw.TextShadow(sw/1.070 - (rw/2), sh/49.09, speed);
  127.  
  128.     --time
  129.     draw.SetFont(i);
  130.     draw.Color(255, 255, 255, 255);
  131.     draw.Text(sw/1.036, sh/29.189, "TIME");
  132.     draw.SetFont(t);
  133.     draw.Color(0, 170, 255, 255);
  134.     draw.TextShadow(sw/1.046, sh/49.09, string.format("%02d:%02d:%02d", date.hour, date.min, date.sec));
  135.  
  136. end
  137.  
  138. function drawline()
  139.  
  140.     local screenSize = draw.GetScreenSize();
  141.     local r = math.floor(math.sin(globals.RealTime() * 1) * 127 + 128);
  142.     local g = math.floor(math.sin(globals.RealTime() * 1 + 2) * 127 + 128);
  143.     local b = math.floor(math.sin(globals.RealTime() * 1 + 4) * 127 + 128);
  144.  
  145.     draw.Color(r, g, b, 255);
  146.     draw.FilledRect(0, 0, screenSize, 5);
  147. end
  148.  
  149. callbacks.Register('Draw', 'wm', wm);
  150. client.AllowListener( "client_disconnect" );
  151. client.AllowListener( "begin_new_match" );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement