VehicleClient

isCopVehicleInArea3d

IS_COP_VEHICLE_IN_AREA_3D0x7EEF65D5F153E26A

The GTA V native IS_COP_VEHICLE_IN_AREA_3D of the VEHICLE namespace, as LS:MP client scripts call it: the global function isCopVehicleInArea3d, in JavaScript and in Lua.

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

Usage

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

Parameters

ParameterTypeJavaScriptLua
x1floatnumbernumber
x2floatnumbernumber
y1floatnumbernumber
y2floatnumbernumber
z1floatnumbernumber
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.

Usage:

public bool isCopInRange(Vector3 Location, float Range)
        {
            return Function.Call<bool>(Hash.IS_COP_PED_IN_AREA_3D, Location.X - Range, Location.Y - Range, Location.Z - Range, Location.X + Range, Location.Y + Range, Location.Z + Range);
        }

Reference

Namespace
Vehicle VEHICLE
In the game
BOOL IS_COP_VEHICLE_IN_AREA_3D(float x1, float x2, float y1, float y2, float z1, float z2)
Hash
0x7EEF65D5F153E26A

Open in the interactive natives reference