Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local console_log = client.log
- local get_local_player = entity.get_local_player
- local get_all = entity.get_all
- local get_prop = entity.get_prop
- local get_name = entity.get_player_name
- local string_format = string.format
- local get_all_players = entity.get_players
- local console_cmd = client.exec
- local ui_get = ui.get
- local global_realtime = globals.realtime
- local oldtime = 0;
- local draw_text = client.draw_text
- local table_insert = table.insert
- local get_screen_size = client.screen_size
- local sw, sh = get_screen_size()
- local x, y = sw-20, sh-30
- local enemyping_indicator = ui.new_checkbox("VISUALS", "Other ESP", "Enemy high ping indicator")
- local maxping = ui.new_slider("VISUALS", "Other ESP", "Max ping", 1, 999)
- ui.set(maxping, 400)
- local pingspikerDetected = false
- local function get_ping(playerresource, player)
- return get_prop(playerresource, string_format("%03d", player))
- end
- function clamp(int, max)
- return int > max and max or int
- end
- local function on_paint(context)
- if not ui_get(enemyping_indicator) then
- return
- end
- local local_entindex = get_local_player()
- local width, height = client.screen_size()
- local entities = get_all_players()
- local local_teamnum = get_prop(local_entindex, "m_iTeamNum")
- if (global_realtime() - oldtime) > 1 then
- for i=1, #entities do
- local entindex = entities[i]
- local lifestate = get_prop(entindex, "m_lifeState")
- local ent_teamnum = get_prop(entindex, "m_iTeamNum")
- if lifestate == 0 then
- if ent_teamnum ~= local_teamnum then
- local playerresource = get_all("CCSPlayerResource")[1]
- local ping = get_ping(playerresource, entindex)
- local ping = clamp(ping, 999)
- if ui_get(maxping) <= ping then
- pingspikerDetected = true
- if pingspikerDetected == true then
- console_log(get_name(entindex) .. " has a ping of " .. ping)
- draw_text(context, 10, 700, 255, 0, 0, 240, "+", 0, get_name(entindex) .. " is pingspiking")
- else return
- end
- end
- end
- end
- end
- oldtime = global_realtime()
- end
- end
- client.set_event_callback("paint", on_paint)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement