SHARE
TWEET

Untitled

a guest Mar 22nd, 2019 678 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function wm()
  2.  
  3.     drawrect();
  4.     drawtext();
  5.  
  6. end
  7.  
  8. local frame_rate = 0.0
  9.     local get_abs_fps = function()
  10.         frame_rate = 0.9 * frame_rate + (1.0 - 0.9) * globals.AbsoluteFrameTime()
  11.         return math.floor((1.0 / frame_rate) + 0.5)
  12. end
  13.  
  14. local kills  = {}
  15. local deaths = {}
  16.  
  17. local function KillDeathCount(event)
  18.  
  19.     local local_player = client.GetLocalPlayerIndex( );
  20.     local INDEX_Attacker = client.GetPlayerIndexByUserID( event:GetInt( 'attacker' ) );
  21.     local INDEX_Victim = client.GetPlayerIndexByUserID( event:GetInt( 'userid' ) );
  22.  
  23.     if (event:GetName( ) == "client_disconnect") or (event:GetName( ) == "begin_new_match") then
  24.         kills = {}
  25.         deaths = {}
  26.     end
  27.  
  28.     if event:GetName( ) == "player_death" then
  29.         if INDEX_Attacker == local_player then
  30.             kills[#kills + 1] = {};
  31.         end
  32.        
  33.         if (INDEX_Victim == local_player) then
  34.             deaths[#deaths + 1] = {};
  35.         end
  36.  
  37.     end
  38. end
  39.  
  40. function drawrect()
  41.  
  42.     --aw
  43.  
  44.     draw.Color(18, 12, 38, 200); --thicc outline color
  45.     draw.FilledRect(1640, 10, 1705, 55); --outline rect
  46.     draw.Color(34, 29, 70, 255); --inside rect color
  47.     draw.FilledRect(1645, 15, 1700, 50); --inside rect
  48.     draw.Color(54, 54, 99, 255); --inside rect outline color
  49.     draw.OutlinedRect(1644, 14, 1701, 51); --inside rect outline
  50.  
  51.     --info
  52.  
  53.     draw.Color(18, 12, 38, 200); --thicc outline color
  54.     draw.FilledRect(1707, 10, 1843, 55); --outline rect
  55.     draw.Color(34, 29, 70, 255); --inside rect color
  56.     draw.FilledRect(1712, 15, 1838, 50); --inside rect
  57.     draw.Color(54, 54, 99, 255); --inside rect outline color
  58.     draw.OutlinedRect(1711, 14, 1839, 51); --inside rect outline
  59.  
  60.     --kd
  61.  
  62.     draw.Color(18, 12, 38, 200); --thicc outline color
  63.     draw.FilledRect(1845, 10, 1910, 55); --outline rect
  64.     draw.Color(34, 29, 70, 255); --inside rect color
  65.     draw.FilledRect(1850, 15, 1905, 50); --inside rect
  66.     draw.Color(54, 54, 99, 255); --inside rect outline color
  67.     draw.OutlinedRect(1849, 14, 1904, 51); --inside rect outline
  68.  
  69. end
  70.  
  71. function drawtext()
  72.  
  73.     local f = draw.CreateFont("Arial", 30, 1200);
  74.     local i = draw.CreateFont("Arial", 14, 500);
  75.     local val = draw.CreateFont("Arial", 15, 500);
  76.     local rw,rh;
  77.  
  78.     local speed = 0;
  79.     local latency= 0;
  80.      if entities.FindByClass( "CBasePlayer" )[1] ~= nil then
  81.         latency=entities.GetPlayerResources():GetPropInt( "m_iPing", client.GetLocalPlayerIndex() )
  82.      end
  83.  
  84.     --name
  85.  
  86.     draw.SetFont(f);
  87.     draw.Color(255, 255, 255, 255);
  88.     draw.TextShadow(1651, 18, "A");
  89.     draw.Color(201, 47, 96, 255);
  90.     draw.TextShadow(1670, 18, "W");
  91.  
  92.     --info
  93.  
  94.     --fps
  95.     draw.SetFont(i);
  96.     draw.Color(255, 255, 255, 255);
  97.     draw.Text(1722, 35, "FPS");
  98.     draw.SetFont(val);
  99.     draw.Color(116, 195, 101);
  100.     rw,rh = draw.GetTextSize(get_abs_fps());
  101.     draw.Text(1732 - (rw/2), 20, get_abs_fps());
  102.  
  103.     --ping
  104.     draw.SetFont(i);
  105.     draw.Color(255, 255, 255, 255);
  106.     draw.Text(1758, 35, "PING");
  107.     draw.SetFont(val);
  108.     draw.Color(116, 195, 101);
  109.     rw,rh = draw.GetTextSize(latency);
  110.     draw.Text(1771 - (rw/2), 20, latency);
  111.  
  112.     --speed
  113.     draw.SetFont(i);
  114.     draw.Color(255, 255, 255, 255);
  115.     draw.Text(1794, 35, "SPEED");
  116.     draw.SetFont(val);
  117.     if entities.GetLocalPlayer() ~= nil then
  118.  
  119.         local Entity = entities.GetLocalPlayer();
  120.         local Alive = Entity:IsAlive();
  121.         local velocityX = Entity:GetPropFloat( "localdata", "m_vecVelocity[0]" );
  122.         local velocityY = Entity:GetPropFloat( "localdata", "m_vecVelocity[1]" );
  123.         local velocity = math.sqrt( velocityX^2 + velocityY^2 );
  124.         local FinalVelocity = math.min( 9999, velocity ) + 0.2;
  125.         if ( Alive == true ) then
  126.           speed= math.floor(FinalVelocity) ;
  127.         else
  128.           speed=0;
  129.         end
  130.     end
  131.     rw,rh = draw.GetTextSize(speed)
  132.     draw.Color(116, 195, 101);
  133.     draw.Text(1813 - (rw/2), 20, speed);
  134.  
  135.     --kd
  136.     draw.SetFont(i);
  137.     draw.Color(255, 255, 255, 255);
  138.     draw.Text(1870, 35, "KD");
  139.     draw.SetFont(val);
  140.     draw.Text(1875, 20, "/");
  141.     draw.Color(30, 117, 255);
  142.     rw,rh = draw.GetTextSize(#kills);
  143.     draw.Text(1865 - (rw/2) - 1, 20, #kills);
  144.     rw,rh = draw.GetTextSize(#deaths);
  145.     draw.Text(1883 + (rw/2) + 1, 20, #deaths);
  146.  
  147.  
  148. end
  149.  
  150. callbacks.Register('Draw', 'wm', wm);
  151. callbacks.Register( "FireGameEvent", "KillDeathCount", KillDeathCount);
  152. client.AllowListener( "player_death" );
  153. client.AllowListener( "client_disconnect" );
  154. client.AllowListener( "begin_new_match" );
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top