addVehicleSirens | Multi Theft Auto: Wiki Skip to content

addVehicleSirens

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function adds sirens to a vehicle.

Syntax

addVehicleSirens ( )

Code Examples

server

This example adds a siren for the vehicle, then sets two custom sirens at the top of the vehicle. And then removes the siren when getting out the vehicle.

addEventHandler('onPlayerVehicleEnter', root, function(vehicle, seat)
if (seat == 0) then
addVehicleSirens(vehicle, 2, 2)
setVehicleSirens(vehicle, 1, -0.3, 0, 0.8, 0, 0, 255, 255, 255)
setVehicleSirens(vehicle, 2, 0.3, 0, 0.8, 255, 0, 0, 255, 255)
-- You can also make the sirens flash immediately with 'setVehicleSirensOn(vehicle, true)'
end
end)
addEventHandler('onPlayerVehicleExit', root, function(vehicle, seat)
removeVehicleSirens(vehicle)
end)

See Also

Vehicle Functions