M MY Multiplayer: Wiki
Lado
Tipo

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

NombreTipoDescripción
startX, startY, startZfloatDonde empieza el segmento. También acepta un vec3.
endX, endY, endZfloatDonde 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

Ver también