ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. getVehicleLightState

Function

getVehicleLightState

Server and clientVehiclesIdentical to MTA:SA

Returns whether a vehicle lamp is working (0) or broken (1). Numbering as in setVehicleLightState.

Syntax

int getVehicleLightState(vehicle vehicle, int light)

Arguments

vehiclevehicle
The vehicle.
lightint
Lamp number 0-3.

Returns

0 or 1.

Example

addCommandHandler("lampy", function(player)
    local vehicle = getPedOccupiedVehicle(player)
    if not vehicle then return end
    for light = 0, 3 do
        if getVehicleLightState(vehicle, light) == 1 then
            outputChatBox("Lampa " .. light .. " jest zbita.", player)
        end
    end
end)

See also