EntityClient

isEntityInArea

IS_ENTITY_IN_AREA0x54736AA40E271165

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

SignatureJavaScript
isEntityInArea(
  entity: Entity,
  x1: number,
  y1: number,
  z1: number,
  x2: number,
  y2: number,
  z2: number,
  p7: boolean,
  p8: boolean,
  p9: any
): boolean
SignatureLua
isEntityInArea(
  entity: Entity,
  x1: number,
  y1: number,
  z1: number,
  x2: number,
  y2: number,
  z2: number,
  p7: boolean,
  p8: boolean,
  p9: any
): boolean

Usage

JavaScript
const result = isEntityInArea(entity, x1, y1, z1, x2, y2, z2, p7, p8, p9);
Lua
local result = isEntityInArea(entity, x1, y1, z1, x2, y2, z2, p7, p8, p9)

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 = isEntityInArea(entity, pos1, pos2, p7, p8, p9);
Lua · with vectors
local result = isEntityInArea(entity, pos1, pos2, p7, p8, p9)

Parameters

ParameterTypeJavaScriptLua
entityEntitynumberinteger
x1floatnumbernumber
y1floatnumbernumber
z1floatnumbernumber
x2floatnumbernumber
y2floatnumbernumber
z2floatnumbernumber
p7BOOLbooleanboolean
p8BOOLbooleanboolean
p9Anyanyany

Returns

BOOL JavaScript boolean, Lua boolean

Reference

Namespace
Entity ENTITY
In the game
BOOL IS_ENTITY_IN_AREA(Entity entity, float x1, float y1, float z1, float x2, float y2, float z2, BOOL p7, BOOL p8, Any p9)
Hash
0x54736AA40E271165

Open in the interactive natives reference