đžentity
Last updated
Last updated
entity.get(idx: number[, by_userid: boolean]):
entity
Name | Type | Description |
---|---|---|
Returns a pointer to the specified entity.
entity.get_local_player():
entity
Returns a pointer to the local player.
entity.get_players([enemies_only: boolean, include_dormant: boolean, callback: function]):
table
Name | Type | Description |
---|---|---|
If the callback is nil, it returns the table of pointers to player entities. Otherwise the callback will be called. Access the player pointer using the arguments of the specified callback.
entity.get_entities([class: number/string, include_dormant: boolean, callback: function]):
table
If the callback is nil, it returns the table of pointers to entities. Otherwise the callback will be called. Access the entity pointer using the arguments of the specified callback.
entity.get_threat([ hittable: boolean ]):
entity
Returns a pointer to the current threat.
entity.get_game_rules():
entity
Returns the pointer to the CCSGameRulesProxy instance, or nil if none exists.
entity.get_player_resource():
entity
Returns the pointer to the CCSPlayerResource instance, or nil if none exists.
ent[0]
:
userdata
Returns the ffi
pointer to the entity.
ent.prop_name:
any
ent.prop_name[index]:
any
ent["prop_name"]:
any
ent.prop_name = value
ent.prop_name[index] = value
ent["prop_name"] = value
ent:is_player():
boolean
Returns true
if the entity is a player entity.
ent:is_weapon():
boolean
Returns true
if the entity is a weapon entity.
ent:is_dormant():
boolean
Returns true
if the entity is dormant.
ent:is_bot():
boolean
Returns true
if the entity is a bot.
ent:is_alive():
boolean
Returns true
if the entity is alive.
ent:is_enemy():
boolean
Returns true
if the entity is an enemy.
ent:is_visible():
boolean
Returns true
if the entity is visible.
ent:is_occluded([ to_entity: entity ]):
boolean
If the to_entity
is nil, the local player is checked. Returns true
if the entity is completely occluded for the current entity.
ent:get_index():
number
Returns the index of the entity.
ent:get_name():
string
Returns the player name, weapon name or class name if the entity is neither of those.
ent:get_origin():
vector
Returns the position vector of the entity.
ent:get_angles():
vector
Returns the absolute angles of the entity.
ent:get_simulation_time():
table
Returns a table containing current
and old
simulation time values.
ent:get_classname():
string
Returns the name of the entity's class.
ent:get_classid():
number
Returns the ID of the entity's class.
ent:get_materials():
table
Returns a table containing all materials used by the entity.
ent:get_model_name():
string
Returns the model name of the entity.
ent:get_network_state():
number
Returns the network state of the player.
ent:get_bbox():
table
Returns a table containing pos1
, pos2
, and alpha
values.
ent:get_player_info():
table
Returns a table containing information from the player_info_t
structure of the entity.
Table values: is_hltv
, is_fake_player
, steamid
, steamid64
, userid
, and files_downloaded
ent:get_player_weapon([all_weapons: boolean]):
entity / table
Returns a pointer to the player's weapon entity.
If all_weapons
is true
, returns a table containing pointers to every weapon entity the player is currently carrying.
ent:get_anim_state():
table
Returns a table containing information about the animation state of the player.
ent:get_anim_overlay([idx: number]):
table
Returns a table containing information about the specified animation layer. Pass nil
to get every animation layer.
ent:get_eye_position():
vector
Returns the eye position of the player.
ent:get_bone_position(idx: number):
vector
Returns the position of the specified bone.
ent:get_hitbox_position(idx: number):
vector
Returns the position of the specified hitbox.
ent:get_steam_avatar():
ImgObject
Returns a pointer to the Steam avatar image object of the specified entity.
ent:get_xuid():
string
Returns the Steam ID of the player.
ent:get_resource():
entity
Returns the pointer to the CCSPlayerResource instance attached to the player, or nil if none exists.
ent:get_spectators():
table
Returns a table of pointers to the players that are currently spectating the specified player.
ent:set_icon([icon: string])
Sets an icon in the scoreboard next to the specified player's avatar. The icon will be removed if no icon was provided.
ent:simulate_movement([origin: vector, velocity: vector, flags: number]):
sim_ctx
This function allows you to simulate players' movement by optionally providing an origin, velocity, and flags. Returns an instance of the sim_ctx
class containing details and tools for the movement simulation.
This class encapsulates the context and results of a movement simulation initiated by :simmulate_movement
.
sim:think([ticks: number])
Simulates the player's movement for a specified number of ticks. If not specified, it defaults to simulating for 1 tick.
Access functions listed below via :get_player_weapon
function
ent:get_weapon_index():
number
Returns the index of the weapon.
ent:get_weapon_icon():
ImgObject
Returns the icon of the weapon.
ent:get_weapon_info():
userdata
Returns a pointer to the CCSWeaponInfo
struct of the weapon.
ent:get_weapon_owner():
entity
Returns a pointer to the weapon owner's entity.
ent:get_weapon_reload():
number
Returns the weapon reload percentage (0.0-1.0), -1 if not reloading.
ent:get_max_speed():
number
Returns the maximum speed the player can move with the weapon.
ent:get_spread():
number
Returns the spread of the weapon in radians.
ent:get_inaccuracy():
number
Returns the inaccuracy of the weapon in radians.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
ID | Description |
---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|