Skip to content

C_CSPlayer

Fields

Name Type Description
m_bIsLocalPlayer bool -
m_hGroundEntity unsigned int -
m_flDuckAmount float -
m_iObserverMode int -
m_hObserverTarget unsigned int -
m_iHealth int -
m_aimPunchAngleVel QAngle -
m_aimPunchAngle QAngle -
m_viewPunchAngle QAngle -
m_vecVelocity Vector -
m_nTickBase int -
m_fFlags int -
m_hLastWeapon unsigned int -
m_bGunGameImmunity bool -
m_vecOrigin Vector
m_angRotation QAngle
m_nModelIndex short
m_fEffects int
m_iTeamNum int
m_iPendingTeamNum int
m_flElasticity float
m_flShadowCastDistance float
m_hOwnerEntity CBaseHandle
moveparent CBaseHandle
m_iParentAttachment int
m_MoveType int
m_bSpotted bool
m_flMaxFallVelocity float

Functions

GetHitboxPosition

Get the hitbox position of the entity.

Name Type Description
hitbox int Hitbox index

Return value

Name Type Description
value Vector Hitbox position
local localplayer = EntityList.GetLocalPlayer()
local pos = localplayer:GetHitboxPosition(0)
print(pos)

GetBonePosition

Get the bone position of the entity.

Name Type Description
bone int Bone index

Return value

Name Type Description
value Vector Bone position
local localplayer = EntityList.GetLocalPlayer()
local pos = localplayer:GetBonePosition(8)
print(pos)

GetActiveWeapon

This function has no parameters.

Return value

Name Type Description
value C_WeaponCSBaseGun* Pointer to weapon
local localplayer = EntityList.GetLocalPlayer()
local weapon = localplayer:GetActiveWeapon()
print(weapon)

IsAlive

This function has no parameters.

Return value

Name Type Description
value bool
local localplayer = EntityList.GetLocalPlayer()
print(localplayer:IsAlive())

IsEnemy

This function has no parameters.

Return value

Name Type Description
value bool Is player enemy
local local_player = EntityList.GetLocalPlayer()
print(local_player:IsEnemy())

IsTeamMate

This function has no parameters.

Return value

Name Type Description
value bool Is player teammate
local local_player = EntityList.GetLocalPlayer()
print(local_player:IsTeamMate())

GetPlayerName

This function has no parameters.

Return value

Name Type Description
value string Player name
local local_player = EntityList.GetLocalPlayer()
print(local_player:GetPlayerName())

EntIndex

This function has no parameters.

Return value

Name Type Description
value int Entity index
local local_player = EntityList.GetLocalPlayer()
print(local_player:EntIndex())

IsDormant

This function has no parameters.

Return value

Name Type Description
value bool Is entity dormant
local local_player = EntityList.GetLocalPlayer()
print(local_player:IsDormant())

IsPlayer

This function has no parameters.

Return value

Name Type Description
value bool Is entity a player
local local_player = EntityList.GetLocalPlayer()
print(local_player:IsPlayer())

IsWeapon

This function has no parameters.

Return value

Name Type Description
value bool Is entity a weapon
local local_player = EntityList.GetLocalPlayer()
local weapon = local_player:GetActiveWeapon()
print(weapon:IsWeapon())

ToPlayer

This function has no parameters.

Return value

Name Type Description
value C_CSPlayer* Pointer to player
local entity = EntityList.GetClientEntity(EngineClient.GetLocalPlayer())
local local_player = entity:ToPlayer()
print(weapon:IsWeapon())

ToWeapon

This function has no parameters.

Return value

Name Type Description
value C_WeaponCSBaseGun* Pointer to weapon
local weapon = entity:ToWeapon() 

GetRenderAngles

This function has no parameters.

Return value

Name Type Description
value QAngle Render angles
local local_player = EntityList.GetLocalPlayer()
local angles = local_player:GetRenderAngles()
print(angles.pitch, angles.yaw, angles.roll)

GetRenderOrigin

This function has no parameters.

Return value

Name Type Description
value Vector Render origin
local local_player = EntityList.GetLocalPlayer()
local origin = local_player:GetRenderOrigin()
print(origin.x, origin.y, origin.z)

GetModelName

This function has no parameters.

Return value

Name Type Description
value string Model name of the entity
local local_player = EntityList.GetLocalPlayer()
print(local_player:GetModelName())

SetModelIndex

Name Type Description
value int New model index
local local_player = EntityList.GetLocalPlayer()
local_player:SetModelIndex(-1)

GetTeamNumber

Name Type Description
value int Entity team number
local local_player = EntityList.GetLocalPlayer()
print(local_player:GetTeamNumber())

GetClassID

This function has no parameters.

Return value

Name Type Description
value int Entity class ID
local local_player = EntityList.GetLocalPlayer()
print(local_player:GetClassId()) -- 40

GetMins

This function has no parameters.

Return value

Name Type Description
value Vector Mins of the entity.
local local_player = EntityList.GetLocalPlayer()
print(local_player:GetMins())

GetMaxs

This function has no parameters.

Return value

Name Type Description
value Vector Maxs of the entity.
local local_player = EntityList.GetLocalPlayer()
print(local_player:GetMaxs())

GetClassName

This function has no parameters.

Return value

Name Type Description
value string Entity class name
local local_player = EntityList.GetLocalPlayer()
print(local_player:GetClassName()) -- CCSPlayer

SetProp

For better interaction with netvars, would be great to include the table name. If you do not specify table name, we will use the network name of the entity.

Name Type Description
class string Table name
netvar string Netvar name
value mixed New netvar value
local local_player = EntityList.GetLocalPlayer()
print(local_player:SetProp("m_bIsScoped", false)) -- same as local_player:SetProp("CCSPlayer", "m_bIsScoped", false)

GetProp

For better interaction with netvars, would be great to include the table name. If you do not specify table name, we will use the network name of the entity.

Name Type Description
class string Table name (not required)
netvar string Netvar name

Return value

Name Type Description
value mixed Netvar value
local local_player = EntityList.GetLocalPlayer()
print(local_player:GetProp("m_bIsScoped")) -- same as local_player:GetProp("CCSPlayer", "m_bIsScoped")