# getVehicleLightState (Compartido)

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

- **Plataforma**: MY Multiplayer (MYMP)
- **Tipo**: Función Lua
- **Lado**: Compartido
- **Categoría**: Vehículos
- **URL**: https://wiki.mymp.gg/es/getVehicleLightState

## Sintaxis

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

## Parámetros

| Nombre | Tipo | Descripción |
| --- | --- | --- |
| `vehicle` | `vehicle` | El vehículo. |
| `light` | `int\|string\|table` | Qué 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

```lua
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

- [setVehicleLightState (Compartido)](https://wiki.mymp.gg/es/setVehicleLightState.md): Rompe o arregla una o más luces de un vehículo.
- [getVehicleDoorState (Compartido)](https://wiki.mymp.gg/es/getVehicleDoorState.md): Devuelve el estado de una o más puertas de un vehículo.
- [getVehicleOverrideLights (Compartido)](https://wiki.mymp.gg/es/getVehicleOverrideLights.md): Devuelve si las luces de un vehículo están forzadas encendidas o apagadas.
