isLineOfSightClear
Cliente
Indica si nada bloquea el segmento entre dos puntos. Solo bloquean edificios y objetos, no vehículos ni peds.
bool isLineOfSightClear(float startX, startY, startZ, float endX, endY, endZ)
Parámetros
| Nombre | Tipo | Descripción |
|---|---|---|
| startX, startY, startZ | float | Donde empieza el segmento. También acepta un vec3. |
| endX, endY, endZ | float | Donde termina el segmento. También acepta un vec3. |
Retorno
true si el camino está libre.
Ejemplo
local function canSee(ped)
return isLineOfSightClear(getElementPosition(localPlayer), getElementPosition(ped))
end