- Documentation
- Server functions
- addVehicleSirens
Function
addVehicleSirens
Stores a set of custom siren lights for the vehicle: number of points, type and flags. After it, setVehicleSirens sets the position and colour of each point.
Syntax
bool addVehicleSirens(vehicle vehicle, int sirenCount, int sirenType [, bool flag360 = false, bool checkLos = true, bool randomiser = true, bool silent = false])Arguments
vehiclevehicle- The vehicle.
sirenCountint- Number of lights 1-8.
sirenTypeint- Flash type 1-6.
flag360bool, optional = false- Lights visible from every side.
checkLosbool, optional = true- Check whether the lights are blocked from view.
randomiserbool, optional = true- Random flash order.
silentbool, optional = false- Light bar without siren sound.
Returns
true on success.
Example
local vehicle = createVehicle(596, 1535, -1670, 13.4)
addVehicleSirens(vehicle, 2, 2, true)
setVehicleSirens(vehicle, 1, -0.5, 0, 1, 255, 0, 0)
setVehicleSirens(vehicle, 2, 0.5, 0, 1, 0, 0, 255)
Notes
State for scripts. The game does not draw custom siren points yet; vehicles with a game siren flash their factory light bar (setVehicleSirensOn).
See also
setVehicleSirensSets the position and colour of one siren point added withaddVehicleSirens.getVehicleSirensReturns the list of siren points stored withaddVehicleSirensandsetVehicleSirens. Each point is a table with the fieldsx,y,z,Red,Green,Blue,Alpha,Min_Alpha.removeVehicleSirensRemoves the custom sirens added to the vehicle withaddVehicleSirens.setVehicleSirensOnTurns 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.