EntityClient

hasEntityClearLosToEntityInFront

HAS_ENTITY_CLEAR_LOS_TO_ENTITY_IN_FRONT0x0267D00AF114F17A

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

SignatureJavaScript
hasEntityClearLosToEntityInFront(entity1: Entity, entity2: Entity): boolean
SignatureLua
hasEntityClearLosToEntityInFront(entity1: Entity, entity2: Entity): boolean

Usage

JavaScript
const result = hasEntityClearLosToEntityInFront(entity1, entity2);
Lua
local result = hasEntityClearLosToEntityInFront(entity1, entity2)

Parameters

ParameterTypeJavaScriptLua
entity1Entitynumberinteger
entity2Entitynumberinteger

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.

Has the entity1 got a clear line of sight to the other entity2 from the direction entity1 is facing.
This is one of the most CPU demanding BOOL natives in the game; avoid calling this in things like nested for-loops

Reference

Namespace
Entity ENTITY
In the game
BOOL HAS_ENTITY_CLEAR_LOS_TO_ENTITY_IN_FRONT(Entity entity1, Entity entity2)
Hash
0x0267D00AF114F17A

Open in the interactive natives reference