Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local console_log = client.log
- local console_cmd = client.exec
- local get_local_player = entity.get_local_player
- local get_player_name = entity.get_player_name
- local get_prop = entity.get_prop
- local set_prop = entity.set_prop
- local get_all_ents = entity.get_all
- local get_all_players = entity.get_players
- local userid_to_entindex = client.userid_to_entindex
- local get_cvar = client.get_cvar
- local draw_debug_text = client.draw_debug_text
- local draw_hitboxes = client.draw_hitboxes
- local draw_text = client.draw_text
- local random_int = client.random_int
- local random_float = client.random_float
- local get_var = ui.get_var
- local ui_set = ui.set
- local ui_get = ui.get
- local get_curtime = globals.curtime
- local damage_indicator = ui.new_checkbox("VISUALS", "Other ESP", "Show damage dealt")
- if not damage_indicator then
- console_log("new_checkbox failed, exiting script")
- return
- end
- --local curve_damage_indicator = ui.new_checkbox("VISUALS", "Other ESP", "Damage-Text Curve")
- local red = ui.new_slider("VISUALS", "Other ESP", "Damage-Text Red", 0, 255)
- local green = ui.new_slider("VISUALS", "Other ESP", "Damage-Text Green", 0, 255)
- local blue = ui.new_slider("VISUALS", "Other ESP", "Damage-Text Blue", 0, 255)
- ui_set(red, 255)
- ui_set(green, 255)
- ui_set(blue, 255)
- local damage_queue = {}
- for i = 1,60,1 do
- damage_queue[i] = { 0 , 0 , 0 , 0, 0 }
- end
- local function get_eye_pos(ent)
- local ox,oy,oz = get_prop(ent, "m_vecOrigin")
- oz = oz - 72
- return ox, oy, oz
- end
- local function on_player_hurt(e)
- local attacker_uid = e.attacker
- local attacker_entid = userid_to_entindex(attacker_uid)
- local victim_uid = e.userid
- local victim_entid = userid_to_entindex(victim_uid)
- local damage_taken = e.dmg_health
- if attacker_entid == get_local_player() then
- local curtime = globals.curtime()
- local x,y,z = get_eye_pos(victim_entid)
- if not x then
- return
- end
- for i = 60,2,-1 do
- damage_queue[i] = damage_queue[i-1]
- end
- damage_queue[1] = {x, y, z, damage_taken, curtime}
- end
- end
- local function on_paint(context)
- if not ui_get(damage_indicator) then
- return
- end
- for i = 1,60,1 do
- --if damage_queue[i][5] ~= nil then
- if damage_queue[i][5] + 7 >= globals.curtime() then
- if damage_queue[i][1] ~= nil then
- local x, y = client.world_to_screen(context, damage_queue[i][1], damage_queue[i][2], damage_queue[i][3])
- if x ~= nil and y ~= nil then
- local dmg = damage_queue[i][4]
- local r = ui_get(red)
- local g = ui_get(green)
- local b = ui_get(blue)
- local offset = 100 * (7 / (damage_queue[i][5] + 7 - globals.curtime()))
- draw_text(context, x, y - offset, r, g, b, 255, "c", 0, dmg)
- end
- end
- end
- --end
- end
- end
- local err =
- client.set_event_callback('player_hurt', on_player_hurt) or
- client.set_event_callback('paint', on_paint)
- if err then
- console_log('set_event_callback failed: ', err)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement