base_entity
This type represents a base game entity.
This type may be returned for any other abstract entity class, but internally will point to the correct type.
__index
Function
Attemps to search for a field in this class.
Arguments
Name
Type
Description
name
string
Field name.
Returns
Type
Description
Accessor instance or pointer accessor instance
Example
get_class_name
Function
Returns schema class name.
Returns
Type
Description
string
Name. Returns nil
when failed.
Example
to_weapon_base_gun
Function
Safe-casts the entity to cs2_weapon_base_gun, returns nil if not a weapon_base_gun
Returns
Type
Description
cs2_weapon_base_gun?
Casted entity. Returns nil
if the cast failed.
Example
to_weapon_base
Function
Safe-casts the entity to cs2_weapon_base, returns nil if not a weapon_base
Returns
Type
Description
cs2_weapon_base?
Casted entity. Returns nil
if the cast failed.
Example
to_player_pawn
Function
Safe-casts the entity to cs2_player_pawn, returns nil if not a player_pawn
Returns
Type
Description
cs2_player_pawn?
Casted entity. Returns nil
if the cast failed.
Example
to_player_controller
Function
Safe-casts the entity to cs2_player_controller, returns nil if not a player_controller
Returns
Type
Description
cs2_player_controller?
Casted entity. Returns nil
if the cast failed.
Example
Last updated