Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
82
0
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(0, 0, 0, 0); --inside rect color
  47. draw.FilledRect(1645, 15, 1700, 50); --inside rect
  48. draw.Color(30, 144, 255, 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(0, 0, 0, 0); --inside rect color
  56. draw.FilledRect(1712, 15, 1838, 50); --inside rect
  57. draw.Color(30, 144, 255, 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(0, 0, 0, 0); --inside rect color
  65. draw.FilledRect(1850, 15, 1905, 50); --inside rect
  66. draw.Color(30, 144, 255, 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(i);
  87. draw.Color(30, 144, 255, 255);
  88. draw.TextShadow(1651, 19, "WANNA");
  89. draw.Color(30, 144, 255, 255);
  90.  
  91. draw.TextShadow(1649, 31, "CHEATS");
  92.  
  93. --info
  94.  
  95. --fps
  96. draw.SetFont(i);
  97. draw.Color(30, 144, 255, 255);
  98. draw.Text(1722, 35, "FPS");
  99. draw.SetFont(val);
  100. draw.Color(30, 144, 255, 255);
  101. rw,rh = draw.GetTextSize(get_abs_fps());
  102. draw.Text(1732 - (rw/2), 20, get_abs_fps());
  103.  
  104. --ping
  105. draw.SetFont(i);
  106. draw.Color(30, 144, 255, 255);
  107. draw.Text(1758, 35, "PING");
  108. draw.SetFont(val);
  109. draw.Color(30, 144, 255, 255);
  110. rw,rh = draw.GetTextSize(latency);
  111. draw.Text(1771 - (rw/2), 20, latency);
  112.  
  113. --speed
  114. draw.SetFont(i);
  115. draw.Color(30, 144, 255, 255);
  116. draw.Text(1794, 35, "SPEED");
  117. draw.SetFont(val);
  118. if entities.GetLocalPlayer() ~= nil then
  119.  
  120. local Entity = entities.GetLocalPlayer();
  121. local Alive = Entity:IsAlive();
  122. local velocityX = Entity:GetPropFloat( "localdata", "m_vecVelocity[0]" );
  123. local velocityY = Entity:GetPropFloat( "localdata", "m_vecVelocity[1]" );
  124. local velocity = math.sqrt( velocityX^2 + velocityY^2 );
  125. local FinalVelocity = math.min( 9999, velocity ) + 0.2;
  126. if ( Alive == true ) then
  127. speed= math.floor(FinalVelocity) ;
  128. else
  129. speed=0;
  130. end
  131. end
  132. rw,rh = draw.GetTextSize(speed)
  133. draw.Color(30, 144, 255, 255);
  134. draw.Text(1813 - (rw/2), 20, speed);
  135.  
  136. --kd
  137. draw.SetFont(i);
  138. draw.Color(30, 144, 255, 255);
  139. draw.Text(1870, 35, "KD");
  140. draw.SetFont(val);
  141. draw.Text(1875, 20, "/");
  142. draw.Color(30, 144, 255, 255);
  143. rw,rh = draw.GetTextSize(#kills);
  144. draw.Text(1865 - (rw/2) - 1, 20, #kills);
  145. rw,rh = draw.GetTextSize(#deaths);
  146. draw.Text(1883 + (rw/2) + 1, 20, #deaths);
  147.  
  148.  
  149. end
  150.  
  151. callbacks.Register('Draw', 'wm', wm);
  152. callbacks.Register( "FireGameEvent", "KillDeathCount", KillDeathCount);
  153. client.AllowListener( "player_death" );
  154. client.AllowListener( "client_disconnect" );
  155. client.AllowListener( "begin_new_match" );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement