PedClient

isCopPedInArea3d

IS_COP_PED_IN_AREA_3D0x16EC4839969F9F5E

The GTA V native IS_COP_PED_IN_AREA_3D of the PED namespace, as LS:MP client scripts call it: the global function isCopPedInArea3d, in JavaScript and in Lua.

SignatureJavaScript
isCopPedInArea3d(
  x1: number,
  y1: number,
  z1: number,
  x2: number,
  y2: number,
  z2: number
): boolean
SignatureLua
isCopPedInArea3d(
  x1: number,
  y1: number,
  z1: number,
  x2: number,
  y2: number,
  z2: number
): boolean

Usage

JavaScript
const result = isCopPedInArea3d(x1, y1, z1, x2, y2, z2);
Lua
local result = isCopPedInArea3d(x1, y1, z1, x2, y2, z2)

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 = isCopPedInArea3d(pos1, pos2);
Lua · with vectors
local result = isCopPedInArea3d(pos1, pos2)

Parameters

ParameterTypeJavaScriptLua
x1floatnumbernumber
y1floatnumbernumber
z1floatnumbernumber
x2floatnumbernumber
y2floatnumbernumber
z2floatnumbernumber

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.

xyz - relative to the world origin.

Reference

Namespace
Ped PED
In the game
BOOL IS_COP_PED_IN_AREA_3D(float x1, float y1, float z1, float x2, float y2, float z2)
Hash
0x16EC4839969F9F5E

Open in the interactive natives reference