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

Function

areVehicleLightsOn

Server and clientVehiclesIdentical to MTA:SA

Checks whether the vehicle's headlights are on, i.e. whether setVehicleOverrideLights(vehicle, 2) was set. Works on both sides.

Syntax

bool areVehicleLightsOn(vehicle vehicle)

Arguments

vehiclevehicle
The vehicle.

Returns

true when the lights are on.

Example

local vehicle = getPedOccupiedVehicle(localPlayer)
if vehicle and not areVehicleLightsOn(vehicle) then
    outputChatBox("Wlacz swiatla, robi sie ciemno.")
end

See also