GetEntProp

Last Updated2011-06-06
Created At2007-03-02

Retrieves an integer value from an entity's property. This function is considered safer and more robust over GetEntData, because it performs strict offset checking and typing rules.

native int GetEntProp(int entity, PropType type, const char[] prop, int size = 4, int element = 0)

Parameters

int entity
Entity/edict index.
Property type.
const char[] prop
Property name.
int size
Number of bytes to write (valid values are 1, 2, or 4). This value is auto-detected, and the size parameter is only used as a fallback in case detection fails.
int element
Element # (starting from 0) if property is an array.

Return Value

int Value at the given property offset.

Error

Invalid entity or property not found.