PLAYER_ESP

you can call all render.* functions inside of this callback

this callback is called right before the player esp is renderered, you can use it to add and override various things an instance of the player_esp_context_t is passed into the callback

local font = render.create_font("Impact", 40, 400)

local function on_player_esp(ctx)
    if ctx.dormant then
        return
    end
    local health = ctx.player:get_prop("m_iHealth")
    -- override font for name/weapon
    ctx:set_font(font)

    -- always add this flag
    ctx:add_flag("FLAG")

    -- conditional flag
    if health < 25 then
        ctx:add_flag("LOW HP", color_t(255, 0, 0))
    end
end

callbacks.add(e_callbacks.PLAYER_ESP, on_player_esp)

Last updated