Skip to content

entity_t

Entity functions

is_player

entity:is_player(): boolean


is_weapon

entity:is_weapon(): boolean


is_dormant

entity:is_dormant(): boolean


get_index

entity:get_index(): number


get_origin

entity:get_origin(): vec3_t

Returns abs origin of the entity


get_class_id

entity:get_class_id(): number


get_class_name

entity:get_class_name(): string


Getting FFI pointer

To get entity pointer you can use entity[0]
Also you can use entity[OFFSET] to get the address pointing to specified offset of the entity Hexadecimal and decimal number are both supported

Example

This example will print money of all players

1
2
3
4
5
6
7
8
9
entitylist.get_entities("CCSPlayer", false, function(entity)
    local origin = entity:get_origin()
    local origin2 = render.world_to_screen(origin)
    local money = ffi.cast("int*", entity[0x117B8])[0] --m_iAccount: 0x117B8

    if origin2 ~= nil then
        render.text(tostring(money), 0, origin2)
    end
end)