ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. setVehicleIndicators

Function

setVehicleIndicators

ServerVehiclesTrilogy Hub only

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