RedM Natives

IS_ENTITY_AT_ENTITY

Checks if entity1 is within the box defined by x/y/zSize of entity2.

Hash0xC057F02B837A27F6
Runtime nameIsEntityAtEntity
NamespaceENTITY
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0x751B70C3D034E187

Signature

BOOL IS_ENTITY_AT_ENTITY(Entity entity1, Entity entity2, float xSize, float ySize, float zSize, BOOL p5, BOOL p6, int p7);

Parameters

NameTypeDescription
entity1Entity—
entity2Entity—
xSizefloat—
ySizefloat—
zSizefloat—
p5BOOL—
p6BOOL—
p7int—

Returns BOOL

Description

Checks if entity1 is within the box defined by x/y/zSize of entity2.

Last three parameters are almost always p5 = 0, p6 = 1, p7 = 0

Usage

Lua
local retval = IsEntityAtEntity(entity1, entity2, xSize, ySize, zSize, p5, p6, p7)

-- always works, by hash
local retval = Citizen.InvokeNative(0xC057F02B837A27F6, entity1, entity2, xSize, ySize, zSize, p5, p6, p7, Citizen.ReturnResultAnyway())
JavaScript and C#
JavaScript
const retval = IsEntityAtEntity(entity1, entity2, xSize, ySize, zSize, p5, p6, p7);

// by hash
const retval = Citizen.invokeNative('0xC057F02B837A27F6', entity1, entity2, xSize + 0.0000001, ySize + 0.0000001, zSize + 0.0000001, p5, p6, p7, Citizen.returnResultAnyway());
C#
bool retval = Function.Call<bool>((Hash)0xC057F02B837A27F6, entity1, entity2, xSize, ySize, zSize, p5, p6, p7);
  • 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.