setVehicleSirens | Multi Theft Auto: Wiki Skip to content

setVehicleSirens

Client-side
Server-side
Shared

Pair: getVehicleSirens

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 changes the properties of a vehicles siren point.

Note

Although you may be able to add sirens to any vehice, this function may not work. This function fails on certain vehicle models ( https://wiki.multitheftauto.com/wiki/Vehicle_IDs#Lua_table_of_vehicles_that_doesn.27t_support_siren_lights ).

Syntax

setVehicleSirens ( )

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