isLineOfSightClear
Client
Tells whether nothing blocks the segment between two points. Only buildings and objects block it, not vehicles or peds.
bool isLineOfSightClear(float startX, startY, startZ, float endX, endY, endZ)
Parameters
| Name | Type | Description |
|---|---|---|
| startX, startY, startZ | float | Where the segment starts. A vec3 also works. |
| endX, endY, endZ | float | Where the segment ends. A vec3 also works. |
Returns
true if the way is clear.
Example
local function canSee(ped)
return isLineOfSightClear(getElementPosition(localPlayer), getElementPosition(ped))
end