- Documentation
- Server functions
- setVehicleSirens
Function
setVehicleSirens
Sets the position and colour of one siren point added with addVehicleSirens.
Syntax
bool setVehicleSirens(vehicle vehicle, int point, float x, float y, float z [, int r = 255, int g = 0, int b = 0, int a = 255, int minAlpha = 0])Arguments
vehiclevehicle- The vehicle.
pointint- Point number from 1 to the count from
addVehicleSirens. xfloat- Offset to the right of the vehicle's centre (m).
yfloat- Offset forwards (m).
zfloat- Offset upwards (m).
rint, optional = 255- Red 0-255.
gint, optional = 0- Green 0-255.
bint, optional = 0- Blue 0-255.
aint, optional = 255- Opacity when flashing 0-255.
minAlphaint, optional = 0- Opacity between flashes 0-255.
Returns
true on success, false when the vehicle has no sirens or the point number is wrong.
Example
local vehicle = createVehicle(596, 1535, -1670, 13.4)
addVehicleSirens(vehicle, 1, 1)
setVehicleSirens(vehicle, 1, 0, 0.3, 1.1, 255, 150, 0, 255, 40)
Notes
State for scripts. As with addVehicleSirens: the game does not draw these points yet.
See also
addVehicleSirensStores a set of custom siren lights for the vehicle: number of points, type and flags. After it,setVehicleSirenssets the position and colour of each point.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.