RedM Natives

IS_ENTITY_AT_COORD

Checks if entity is within x/y/zSize distance of x/y/z.

Hash0x5E58342602E94718
Runtime nameIsEntityAtCoord
NamespaceENTITY
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0x20B60995556D004F

Signature

BOOL IS_ENTITY_AT_COORD(Entity entity, float xPos, float yPos, float zPos, float xSize, float ySize, float zSize, BOOL p7, BOOL p8, int p9);

Parameters

NameTypeDescription
entityEntity—
xPosfloat—
yPosfloat—
zPosfloat—
xSizefloat—
ySizefloat—
zSizefloat—
p7BOOL—
p8BOOL—
p9int—

Returns BOOL

Description

Checks if entity is within x/y/zSize distance of x/y/z.

Last three are unknown ints, almost always p7 = 0, p8 = 1, p9 = 0

Usage

Lua
local retval = IsEntityAtCoord(entity, xPos, yPos, zPos, xSize, ySize, zSize, p7, p8, p9)

-- always works, by hash
local retval = Citizen.InvokeNative(0x5E58342602E94718, entity, xPos, yPos, zPos, xSize, ySize, zSize, p7, p8, p9, Citizen.ReturnResultAnyway())
JavaScript and C#
JavaScript
const retval = IsEntityAtCoord(entity, xPos, yPos, zPos, xSize, ySize, zSize, p7, p8, p9);

// by hash
const retval = Citizen.invokeNative('0x5E58342602E94718', entity, xPos + 0.0000001, yPos + 0.0000001, zPos + 0.0000001, xSize + 0.0000001, ySize + 0.0000001, zSize + 0.0000001, p7, p8, p9, Citizen.returnResultAnyway());
C#
bool retval = Function.Call<bool>((Hash)0x5E58342602E94718, entity, xPos, yPos, zPos, xSize, ySize, zSize, p7, p8, p9);
  • Float parameters: Lua integers (10, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write 10.0 or value + 0.0. The generated JS wrappers add 0.0000001 to non-zero floats for the same reason.

Sources

alloc8or RDR3 NativeDB

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.