ObjectClient

hasClosestObjectOfTypeBeenCompletelyDestroyed

HAS_CLOSEST_OBJECT_OF_TYPE_BEEN_COMPLETELY_DESTROYED0x46494A2475701343

The GTA V native HAS_CLOSEST_OBJECT_OF_TYPE_BEEN_COMPLETELY_DESTROYED of the OBJECT namespace, as LS:MP client scripts call it: the global function hasClosestObjectOfTypeBeenCompletelyDestroyed, in JavaScript and in Lua.

SignatureJavaScript
hasClosestObjectOfTypeBeenCompletelyDestroyed(
  x: number,
  y: number,
  z: number,
  radius: number,
  modelHash: Hash,
  p5: boolean
): boolean
SignatureLua
hasClosestObjectOfTypeBeenCompletelyDestroyed(
  x: number,
  y: number,
  z: number,
  radius: number,
  modelHash: Hash,
  p5: boolean
): boolean

Usage

JavaScript
const result = hasClosestObjectOfTypeBeenCompletelyDestroyed(x, y, z, radius, modelHash, p5);
Lua
local result = hasClosestObjectOfTypeBeenCompletelyDestroyed(x, y, z, radius, modelHash, p5)

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 = hasClosestObjectOfTypeBeenCompletelyDestroyed(pos, radius, modelHash, p5);
Lua · with vectors
local result = hasClosestObjectOfTypeBeenCompletelyDestroyed(pos, radius, modelHash, p5)

Parameters

ParameterTypeJavaScriptLua
xfloatnumbernumber
yfloatnumbernumber
zfloatnumbernumber
radiusfloatnumbernumber
modelHashHashnumberinteger
p5BOOLbooleanboolean

Returns

BOOL JavaScript boolean, Lua boolean

Reference

Namespace
Object OBJECT
In the game
BOOL HAS_CLOSEST_OBJECT_OF_TYPE_BEEN_COMPLETELY_DESTROYED(float x, float y, float z, float radius, Hash modelHash, BOOL p5)
Hash
0x46494A2475701343

Open in the interactive natives reference