Skip to content

vehicleSirenChangeRequest

Asks your gamemode when a driver switches the siren on or off. A passenger cannot switch it, as in the game.

Renamed in 0.28 from vehicleSirenChange; see renamed names.

server.on("vehicleSirenChangeRequest", ({ player, fromActive, toActive }) => boolean | void | Promise<boolean | void>)
Name Type Description
player PlayerInVehicle The driver asking; vehicleId is the vehicle and seat is always 0.
fromActive boolean The siren now.
toActive boolean What they want.

false keeps the siren as it is. Anything else switches it. See how decisions work.

Only on-duty police use sirens.

gamemodes/roleplay.ts
import { server } from "nativemp";
const onDuty = new Set<number>();
server.on("vehicleSirenChangeRequest", ({ player }) => onDuty.has(player.id));