From SA-MP Wiki

Jump to: navigation, search

OnVehicleSirenStateChange was added in SA-MP 0.3.7 This callback was added in SA-MP 0.3.7 and will not work in earlier versions!


This callback is called when a vehicle's siren is toggled.



This callback can also be called by NPC.

(playerid, vehicleid, newstate)
playeridThe ID of the player that toggled the siren (driver).
vehicleidThe ID of the vehicle of which the siren was toggled for.
newstate0 if siren was turned off, 1 if siren was turned on.

Return Values:

  • 1 - Will prevent gamemode from receiving this callback.
  • 0 - Indicates that this callback will be passed to the gamemode.
  • It is always called first in filterscripts.



This callback is only called when a vehicle's siren is toggled on or off, NOT when the alternate siren is in use (holding horn).

Example Usage:

public OnVehicleSirenStateChange(playerid, vehicleid, newstate)
    if(newstate) GameTextForPlayer(playerid, "~W~Siren ~G~on", 1000, 3);
    else GameTextForPlayer(playerid, "~W~Siren ~r~off", 1000, 3);
    return 1;

Related Functions

The following functions may be helpful as they relate to this function in one way or another.