- Documentation
- Server functions
- setVehicleIndicators
Function
setVehicleIndicators
Turns on a vehicle's indicators, which blink for every player. On vehicles with their own model (engineReplaceModel) the lamps marked in the model with SA indicator colours blink. Game cars have no separate indicators, so the front blinks orange and the rear uses the red lens. A single lamp is set with setVehicleLampState.
Syntax
bool setVehicleIndicators(vehicle vehicle, int state)Arguments
vehiclevehicle- The vehicle.
stateint- 0 off, 1 left, 2 right, 3 hazard (both).
Returns
true on success, false for a value outside 0-3.
Example
addCommandHandler("awaryjne", function(player)
local vehicle = getPedOccupiedVehicle(player)
if vehicle then
setVehicleIndicators(vehicle, getVehicleIndicators(vehicle) == 3 and 0 or 3)
end
end)
See also
getVehicleIndicatorsReturns the indicator state: 0 off, 1 left, 2 right, 3 hazard. Works on both sides.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.