Advertisement
Guest User

Untitled

a guest
Jun 24th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. local console_log = client.log
  2. local get_local_player = entity.get_local_player
  3. local get_all = entity.get_all
  4. local get_prop = entity.get_prop
  5. local get_name = entity.get_player_name
  6. local string_format = string.format
  7. local get_all_players = entity.get_players
  8. local console_cmd = client.exec
  9. local ui_get = ui.get
  10. local global_realtime = globals.realtime
  11. local oldtime = 0;
  12. local draw_text = client.draw_text
  13. local table_insert = table.insert
  14. local get_screen_size = client.screen_size
  15. local sw, sh = get_screen_size()
  16. local x, y = sw-20, sh-30
  17.  
  18. local enemyping_indicator = ui.new_checkbox("VISUALS", "Other ESP", "Enemy high ping indicator")
  19. local maxping = ui.new_slider("VISUALS", "Other ESP", "Max ping", 1, 999)
  20. ui.set(maxping, 400)
  21.  
  22. local pingspikerDetected = false
  23.  
  24. local function get_ping(playerresource, player)
  25. return get_prop(playerresource, string_format("%03d", player))
  26. end
  27.  
  28. function clamp(int, max)
  29. return int > max and max or int
  30. end
  31.  
  32. local function on_paint(context)
  33. if not ui_get(enemyping_indicator) then
  34. return
  35. end
  36.  
  37.  
  38. local local_entindex = get_local_player()
  39. local width, height = client.screen_size()
  40. local entities = get_all_players()
  41. local local_teamnum = get_prop(local_entindex, "m_iTeamNum")
  42.  
  43. if (global_realtime() - oldtime) > 1 then
  44. for i=1, #entities do
  45. local entindex = entities[i]
  46. local lifestate = get_prop(entindex, "m_lifeState")
  47. local ent_teamnum = get_prop(entindex, "m_iTeamNum")
  48.  
  49. if lifestate == 0 then
  50. if ent_teamnum ~= local_teamnum then
  51. local playerresource = get_all("CCSPlayerResource")[1]
  52. local ping = get_ping(playerresource, entindex)
  53. local ping = clamp(ping, 999)
  54. if ui_get(maxping) <= ping then
  55. pingspikerDetected = true
  56. if pingspikerDetected == true then
  57. console_log(get_name(entindex) .. " has a ping of " .. ping)
  58. draw_text(context, 10, 700, 255, 0, 0, 240, "+", 0, get_name(entindex) .. " is pingspiking")
  59. else return
  60. end
  61. end
  62. end
  63. end
  64. end
  65. oldtime = global_realtime()
  66. end
  67. end
  68.  
  69. client.set_event_callback("paint", on_paint)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement