Name
Type
Description
ent
int
Entity index
Name
Type
Description
ent
C_BaseEntity*
Pointer to entity
local localplayer = EntityList .GetClientEntity (EngineClient .GetLocalPlayer ())
Name
Type
Description
inclNonNetworkable
bool
Include non-networkable entities
Name
Type
Description
value
int
Number of entities currently in use
local num_ents = EntityList .NumberOfEntities (false )
print (num_ents )
Name
Type
Description
value
int
Highest entity index
local highest_index = EntityList .GetHighestEntityIndex ()
print (highest_index )
GetClientEntityFromHandle
Name
Type
Description
h
unsigned long
Entity handle
Name
Type
Description
ent
C_BaseEntity*
Pointer to entity
-- @summary : Get active weapon from weapon_handle
-- @hint: You can use GetActiveWeapon instead
local me = EntityList .GetClientEntity (EngineClient .GetLocalPlayer ())
local weapon_handle = me :GetProp (" DT_BaseCombatCharacter" , " m_hActiveWeapon" )
local weap = EntityList .GetClientEntityFromHandle (weapon_handle )
Name
Type
Description
Player Resource
CSPlayerResource*
-
local player_resource = EntityList .GetPlayerResource ()
local get_prop = player_resource :GetProp (" DT_CSPlayerResource" , " m_szClan" )
for key , value in pairs (get_prop ) do
print (key , value )
end
Name
Type
Description
Game Rules
CSGameRules*
-
local game_rules = EntityList .GetGameRules ()
local get_prop = game_rules :GetProp (" DT_CSGameRulesProxy" , " m_bIsValveDS" )
print (get_prop )
Name
Type
Description
id
int
Class id
Name
Type
Description
ent
C_BaseEntity*
Player entity
local ents = EntityList .GetEntitiesByClassID (40 )
print (" Found " .. tostring (# ents ) .. " entities with id 40" )
Name
Type
Description
name
string
Entity name
Name
Type
Description
ent
C_BaseEntity*
Player entity
local ents = EntityList .GetEntitiesByName (" CCSPlayer" )
print (" Found " .. tostring (# ents ) .. " entities with name CCSPlayer" )
Name
Type
Description
ent
C_BasePlayer*
Local Player entity
local player = EntityList .GetLocalPlayer ()
Name
Type
Description
Index
int
Weapon Entity index
Name
Type
Description
ent
C_BaseCombatWeapon*
Weapon entity
local player = EntityList .GetWeapon (100 )
Name
Type
Description
Index
int
Entity index
Name
Type
Description
ent
C_BasePlayer*
Player entity
local player = EntityList .GetPlayer (1 )
Name
Type
Description
handle
handle
Player Handle
Name
Type
Description
ent
C_BasePlayer*
Player entity
local player = EntityList .GetPlayerFromHandle (handle )
Name
Type
Description
handle
handle
Weapon Handle
Name
Type
Description
ent
C_BaseCombatWeapon*
Weapon
local local_player_ptr = EntityList .GetLocalPlayer ()
local active_weapon = local_player_ptr :GetProp (" DT_BaseCombatCharacter" , " m_hActiveWeapon" )
local weapon_from_handle = EntityList .GetWeaponFromHandle (active_weapon )
print (weapon_from_handle )
Name
Type
Description
players
table
Table with players (C_BasePlayer*)
Cheat .RegisterCallback (" createmove" , function ()
local players = EntityList .GetPlayers ()
local local_player = EntityList .GetLocalPlayer ()
for table_index , player_pointer in pairs (players ) do
if player_pointer == local_player then goto skip end
local player_name = player_pointer :GetName ()
print (" Name:" , player_name )
:: skip::
end
end )
Name
Type
Description
ent
C_BasePlayer*
Player entity
Cheat .RegisterCallback (" events" , function (event )
if event :GetName () == " player_hurt" then
local target_player = EntityList .GetPlayerForUserID (event :GetInt (" userid" , 0 ))
if not target_player then return end
local attacker_player = EntityList .GetPlayerForUserID (event :GetInt (" attacker" , 0 ))
if not attacker_player then return end
print (string.format (" %s hurt by %s" , target_player :GetName (), attacker_player :GetName ()))
end
end )