Skip to content

policeUnitDispatchRequest

When a player is wanted, their game sends police after them: cars, bikes, helicopters and their crews. Asks your gamemode before such a unit appears for everyone.

Renamed in 0.28 from policeDispatchRequest; see renamed names.

server.on("policeUnitDispatchRequest", ({ player, unit, wantedLevel }) => boolean | void | Promise<boolean | void>)
Name Type Description
player PlayerSnapshot The wanted player whose game sends the unit.
unit DispatchUnitProposal The vehicle or ped and its crew.
wantedLevel number The player’s wanted level, 1-6.

false keeps the unit and its crew away; nobody sees them. true, or nothing, lets them come. The first false stops the handlers after it. See how decisions work.

Police up to three stars, and never a police helicopter.

gamemodes/my-mode.ts
import { server } from "nativemp";
server.on("policeUnitDispatchRequest", ({ wantedLevel, unit }) => wantedLevel <= 3 && unit.model !== 497);