- Documentation
- Server functions
- resetVehicleLampStates
Function
resetVehicleLampStates
Returns all of a vehicle's lamps to 'auto', i.e. working as in the game. Clears everything set with setVehicleLampState.
Syntax
bool resetVehicleLampStates(vehicle vehicle)Arguments
vehiclevehicle- The vehicle.
Returns
true on success.
Example
addEventHandler("onVehicleExit", root, function()
resetVehicleLampStates(source)
end)
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'.getVehicleLampStateReturns the state of a lamp or lamp group set withsetVehicleLampState:'auto','on'or'off'. When the lamps in a group differ, it returns'mixed'.