No, it does not turn on the lights. Think about it as a text above the vehicle. So, first of all you have to create it with this function:
Create3DTextLabel
So, once it is created and you have stored the result of the function, a.k.a the ID of the 3DTextLabel, you will now assign it to the vehicle:
Attach3DTextLabelToVehicle
If you are done with that, you have the Text attached to your vehicle and people should be able to see them now, you should for a start call it SIRENS OFF or anything similar.
Alright, we are done with that bit.
Now, whenever a person types a command, e.g. /sirens, it checks if the vehicles sirens are off or on and acts accordingly:
Update3DTextLabelText
We update the text, calling it "SIRENS ON" or "SIRENS OFF" according to the result and now each person coming closer to the vehicle will be able to see the displayed text and knows if the sirens are on or off.
Small example:
pawn Код:
public OnVehicleSpawn(vehicleid)
{
new Text3D:nIDOfLabel = Create3DTextLabel("SIRENS OFF"/*continue here choosing ya colors etc*/); // the "n" is a habbit of me, indicating its a value
Attach3DTextLabelToVehicle(nIDofLabel, vehicleid/*the needed coordinations*/);
}
// Lets use zcmd as a example for the command:
zcmd(sirens, playerid, params[])
{
if(/*check if the sirens are on*/)
{
// update the text here
}
else
{
// update the text here
}
}
This example may not be totally accurate and some things are possibly different, as well as a static variable to hold the ID, to be able to use it later on might be something you should consider.. but I hope it helps.