- Documentation
- Shared functions
- getVehicleLampState
Function
getVehicleLampState
Returns the state of a lamp or lamp group set with setVehicleLampState: 'auto', 'on' or 'off'. When the lamps in a group differ, it returns 'mixed'.
Syntax
string getVehicleLampState(vehicle vehicle, string/int lamp)Arguments
vehiclevehicle- The vehicle.
lampstring/int- Lamp name, group or number 0-11 (as in
setVehicleLampState).
Returns
'auto', 'on', 'off' or 'mixed'.
Example
local vehicle = createVehicle(411, 2000, -1690, 13.5)
setVehicleLampState(vehicle, "front_left", "off")
outputDebugString(getVehicleLampState(vehicle, "front"))
See also
setVehicleLampStateTurns one lamp (or a group of lamps) of a vehicle on, off or back to game control, for every player. This lets a script e.g. light the brake lamps when braking, the reverse lamps, or leave a single headlight working. The'auto'state means the lamp works as usual in the game. An indicator set to'on'shines steadily; blinking comes fromsetVehicleIndicators. Game cars have no reverse lamps or separate indicators (the front shines orange, the rear uses the red lens); custom models fromengineReplaceModelhave all lamps.getVehicleLampStatesReturns the state of all twelve lamps of a vehicle as a table of name →'auto'/'on'/'off'.