EntityClient

wouldEntityBeOccluded

WOULD_ENTITY_BE_OCCLUDED0xEE5D2A122E09EC42

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

SignatureJavaScript
wouldEntityBeOccluded(
  entityModelHash: Hash,
  x: number,
  y: number,
  z: number,
  p4: boolean
): boolean
SignatureLua
wouldEntityBeOccluded(
  entityModelHash: Hash,
  x: number,
  y: number,
  z: number,
  p4: boolean
): boolean

Usage

JavaScript
const result = wouldEntityBeOccluded(entityModelHash, x, y, z, p4);
Lua
local result = wouldEntityBeOccluded(entityModelHash, x, y, z, p4)

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 = wouldEntityBeOccluded(entityModelHash, pos, p4);
Lua · with vectors
local result = wouldEntityBeOccluded(entityModelHash, pos, p4)

Parameters

ParameterTypeJavaScriptLua
entityModelHashHashnumberinteger
xfloatnumbernumber
yfloatnumbernumber
zfloatnumbernumber
p4BOOLbooleanboolean

Returns

BOOL JavaScript boolean, Lua boolean

Reference

Namespace
Entity ENTITY
In the game
BOOL WOULD_ENTITY_BE_OCCLUDED(Hash entityModelHash, float x, float y, float z, BOOL p4)
Hash
0xEE5D2A122E09EC42

Open in the interactive natives reference