EntityClient

isEntityAtEntity

IS_ENTITY_AT_ENTITY0x751B70C3D034E187

The GTA V native IS_ENTITY_AT_ENTITY of the ENTITY namespace, as LS:MP client scripts call it: the global function isEntityAtEntity, in JavaScript and in Lua.

SignatureJavaScript
isEntityAtEntity(
  entity1: Entity,
  entity2: Entity,
  xSize: number,
  ySize: number,
  zSize: number,
  p5: boolean,
  p6: boolean,
  p7: number
): boolean
SignatureLua
isEntityAtEntity(
  entity1: Entity,
  entity2: Entity,
  xSize: number,
  ySize: number,
  zSize: number,
  p5: boolean,
  p6: boolean,
  p7: integer
): boolean

Usage

JavaScript
const result = isEntityAtEntity(entity1, entity2, xSize, ySize, zSize, p5, p6, p7);
Lua
local result = isEntityAtEntity(entity1, entity2, xSize, ySize, zSize, p5, p6, p7)

Three consecutive numbers can be given as one vector: { x, y, z } (or [x, y, z]) in JavaScript, a Vector3 in Lua.

JavaScript · with vectors
const result = isEntityAtEntity(entity1, entity2, size, p5, p6, p7);
Lua · with vectors
local result = isEntityAtEntity(entity1, entity2, size, p5, p6, p7)

Parameters

ParameterTypeJavaScriptLua
entity1Entitynumberinteger
entity2Entitynumberinteger
xSizefloatnumbernumber
ySizefloatnumbernumber
zSizefloatnumbernumber
p5BOOLbooleanboolean
p6BOOLbooleanboolean
p7intnumberinteger

Returns

BOOL JavaScript boolean, Lua boolean

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

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

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

Reference

Namespace
Entity ENTITY
In the game
BOOL IS_ENTITY_AT_ENTITY(Entity entity1, Entity entity2, float xSize, float ySize, float zSize, BOOL p5, BOOL p6, int p7)
Hash
0x751B70C3D034E187

Open in the interactive natives reference