Skip to content

Files

Latest commit

 

History

History
193 lines (128 loc) · 3.82 KB

icliententity.md

File metadata and controls

193 lines (128 loc) · 3.82 KB
description
Base class of all entities, inherited into CBaseEntity, CBaseCombatWeapon classes

icliententity

🚧 API of this file is not finished yet and could be changed in any time

Functions

GetRefEHandle

Returns:

Type Description
CBaseHandle reference of current entity handle

Code:

local hHandle = pEntity:GetRefEHandle()

GetRenderOrigin

Returns:

Type Description
Vector render origin

Code:

local vecRenderOrigin = pEntity:GetRenderOrigin()

GetRenderAngles

Returns:

Type Description
QAngle render view point

Code:

local angRenderViewPoint = pEntity:GetRenderAngles()

IsDormant

Returns:

Type Description
bool true if entity have dormancy

Code:

local bIsDormant = pEntity:IsDormant()

GetIndex

Returns:

Type Description
int entity index

Code:

local nIndex = pEntity:GetIndex()

GetAbsOrigin

Returns:

Type Description
Vector absolute origin

Code:

local vecAbsOrigin = pEntity:GetAbsOrigin()

GetAbsAngles

Returns:

Type Description
QAngle absolute view point

Code:

local angAbsViewPoint = pEntity:GetAbsAngles()

SetAbsOrigin

Parameters:

Name Type Description
vecAbsOrigin Vector absolute origin to set

Code:

pEntity:SetAbsOrigin(Vector.new(0.0, 0.0, 0.0))

SetAbsAngles

Parameters:

Name Type Description
angAbsViewPoint QAngle absolute angles to set

Code:

pEntity:SetAbsAngles(QAngle.new(0.0, 0.0, 0.0))

SetModelIndex

Parameters:

Name Type Description
nModelIndex int override model index to set

Code:

GetPropertyBool, GetPropertyInt, GetPropertyFloat, GetPropertyVector, GetPropertyVector2D, GetPropertyQAngle, GetPropertyHandle

Parameters:

Name Type Description
szNetwordVariable string class and network variable name to get

Returns:

Type Description
bool, int, float, Vector, QAngle, CBaseHandle value of given network variable in networked data table (class), type depends by function

Code:

local bSpotted = pEntity:GetPropertyBool("CBaseEntity->m_bSpotted")
local iArmor = pLocal:GetPropertyInt("CCSPlayer->m_ArmorValue")
local flAnimationTime = pLocal:GetPropertyFloat("CBaseEntity->m_flAnimTime")
local angRotation = pEntity:GetPropertyQAngle("CBaseEntity->m_angRotation")
local vecMins = pEntity:GetPropertyVector("CBaseEntity->m_vecMins")
local hOwner = pEntity:GetPropertyHandle("CBaseEntity->m_hOwnerEntity")

SetPropertyBool, SetPropertyInt, SetPropertyFloat, SetPropertyVector, SetPropertyVector2D, SetPropertyQAngle, SetPropertyHandle

Parameters:

Name Type Description
szNetwordVariable string class and network variable name to set
value bool, int, float, Vector, QAngle, CBaseHandle value to set for given network variable in networked data table (class), type depends by function

Code:

pEntity:SetPropertyBool("CBaseEntity->m_bSpotted", true)
pLocal:GetPropertyInt("CCSPlayer->m_ArmorValue", 100)
pLocal:GetPropertyFloat("CBaseEntity->m_flAnimTime", 0.0)
pEntity:GetPropertyQAngle("CBaseEntity->m_angRotation", QAngle.new())
pEntity:GetPropertyVector("CBaseEntity->m_vecMins", Vector.new())
pEntity:GetPropertyHandle("CBaseEntity->m_hOwnerEntity", 0)