M MY Multiplayer: Wiki
Lado
Tipo

getVehicleLightState

Compartido

Devuelve si una o más luces de un vehículo están rotas.

int|table|false getVehicleLightState(vehicle vehicle, int|string|table light)

Parámetros

NombreTipoDescripción
vehiclevehicleEl vehículo.
lightint|string|tableQué luz: su número (0 faro izquierdo, 1 faro derecho, 2 piloto trasero derecho, 3 piloto trasero izquierdo), el nombre del frame (headlight_l, headlight_r, taillight_r, taillight_l), un grupo (all, front_lights, rear_lights, left_lights, right_lights), -1 para todas o una tabla con varios.

Retorno

El estado (0 funcionando, 1 rota). Cuando se pidieron varias luces (un grupo, -1 o una tabla), una tabla de nombre del frame → valor. false si el vehículo no tiene una de las luces pedidas.

Ejemplo

addCommandHandler("farol", function(player)
    local vehicle = getPedOccupiedVehicle(player)
    if vehicle and getVehicleLightState(vehicle, 0) == 1 then
        setVehicleLightState(vehicle, 0, 0)
    end
end)

Ver también