PedClientNot in this build

hasPedClearLosToEntity

_HAS_PED_CLEAR_LOS_TO_ENTITY0xA32ABFEB2A03B306

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

SignatureJavaScript
hasPedClearLosToEntity(
  ped: Ped,
  entity: Entity,
  x: number,
  y: number,
  z: number,
  p5: number,
  p6: boolean,
  p7: boolean
): boolean
SignatureLua
hasPedClearLosToEntity(
  ped: Ped,
  entity: Entity,
  x: number,
  y: number,
  z: number,
  p5: integer,
  p6: boolean,
  p7: boolean
): boolean
⚠
Not in this game build

The global exists, but the native is not part of the game build LS:MP runs: calling it does nothing and returns undefined in JavaScript, nil in Lua. It never throws. See Coverage.

Usage

JavaScript
const result = hasPedClearLosToEntity(ped, entity, x, y, z, p5, p6, p7);
Lua
local result = hasPedClearLosToEntity(ped, entity, x, y, z, p5, p6, p7)

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 = hasPedClearLosToEntity(ped, entity, pos, p5, p6, p7);
Lua · with vectors
local result = hasPedClearLosToEntity(ped, entity, pos, p5, p6, p7)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
entityEntitynumberinteger
xfloatnumbernumber
yfloatnumbernumber
zfloatnumbernumber
p5intnumberinteger
p6BOOLbooleanboolean
p7BOOLbooleanboolean

Returns

BOOL JavaScript boolean, Lua boolean

Reference

Namespace
Ped PED
In the game
BOOL _HAS_PED_CLEAR_LOS_TO_ENTITY(Ped ped, Entity entity, float x, float y, float z, int p5, BOOL p6, BOOL p7)
Hash
0xA32ABFEB2A03B306
Introduced
Game build 3095 legacy numbering

Open in the interactive natives reference