C_BaseEntity

This type represents a base game entity.

circle-info

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

local health = player.m_iHealth;
local health = player['m_iHealth']; -- this also works

GetClassName

Function

Returns schema class name.

Returns

Type

Description

string

Name. Returns nil when failed.

Example


GetHandle

Function

Returns handle for this entity.

Returns

Type

Description

Entity handle

Example


GetPointer

Function

Returns a memory address for this entity, useful with FFI.

Returns

Type

Description

userdata

Entity pointer

Example


ToWeaponBaseGun

Function

Safe-casts the entity to C_CSWeaponBaseGun, returns nil if not a C_CSWeaponBaseGun .

Returns

Type

Description

Casted entity. Returns nil if the cast failed.

Example


ToWeaponBase

Function

Safe-casts the entity to C_CSWeaponBase, returns nil if not a C_CSWeaponBase .

Returns

Type

Description

Casted entity. Returns nil if the cast failed.

Example


ToPlayerPawn

Function

Safe-casts the entity to C_CSPlayerPawn, returns nil if not a C_CSPlayerPawn .

Returns

Type

Description

Casted entity. Returns nil if the cast failed.

Example


ToPlayerController

Function

Safe-casts the entity to C_CSPlayerController, returns nil if not a C_CSPlayerController .

Returns

Type

Description

Casted entity. Returns nil if the cast failed.

Example

Last updated