# getVehicleLightState (Compartilhado)

> Devolve se uma ou mais luzes de um veículo estão quebradas.

- **Plataforma**: MY Multiplayer (MYMP)
- **Tipo**: Função Lua
- **Lado**: Compartilhado
- **Categoria**: Veículos
- **URL**: https://wiki.mymp.gg/pt/getVehicleLightState

## Sintaxe

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

## Parâmetros

| Nome | Tipo | Descrição |
| --- | --- | --- |
| `vehicle` | `vehicle` | O veículo. |
| `light` | `int\|string\|table` | Qual luz: o número (0 farol esquerdo, 1 farol direito, 2 lanterna traseira direita, 3 lanterna traseira esquerda), o nome do frame (`headlight_l`, `headlight_r`, `taillight_r`, `taillight_l`), um grupo (`all`, `front_lights`, `rear_lights`, `left_lights`, `right_lights`), `-1` para todas ou uma tabela com vários deles. |

## Retorno

O estado (0 funcionando, 1 quebrada). Quando foram pedidas várias luzes (um grupo, `-1` ou uma tabela), uma tabela de nome do frame → valor. `false` se o veículo não tem uma das luzes pedidas.

## Exemplo

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

## Veja também

- [setVehicleLightState (Compartilhado)](https://wiki.mymp.gg/pt/setVehicleLightState.md): Quebra ou conserta uma ou mais luzes de um veículo.
- [getVehicleDoorState (Compartilhado)](https://wiki.mymp.gg/pt/getVehicleDoorState.md): Devolve o estado de uma ou mais portas de um veículo.
- [getVehicleOverrideLights (Compartilhado)](https://wiki.mymp.gg/pt/getVehicleOverrideLights.md): Devolve se os faróis de um veículo estão forçados a ficar ligados ou desligados.
