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

Function

setVehicleSirensOn

ServerVehiclesIdentical to MTA:SA

Turns the siren and light bar of an emergency vehicle (police, ambulance, fire truck) on or off for every player, just like a player does with the horn key in the game. Nothing is visible on vehicles without a siren.

Syntax

bool setVehicleSirensOn(vehicle element, bool value)

Arguments

elementvehicle
The vehicle.
valuebool
true = siren on.

Returns

true on success.

Example

addCommandHandler("syrena", function(player)
    local vehicle = getPedOccupiedVehicle(player)
    if vehicle then setVehicleSirensOn(vehicle, not getVehicleSirensOn(vehicle)) end
end)

See also