policeCarCapExceedRequest
GTA:SA limits how many police cars chase the wanted players at once. When the limit is reached and a player’s game would still send one, asks your gamemode whether this one may come anyway.
Renamed in 0.28 from policeCarCapRequest; see renamed names.
Signature
Section titled “Signature”server.on("policeCarCapExceedRequest", ({ player, unit, currentCarCount, carCap, sharedWantedPlayerCount }) => boolean | void | Promise<boolean | void>)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
player |
PlayerSnapshot |
The wanted player whose game would send it. |
unit |
DispatchUnitProposal |
The car and its crew. |
currentCarCount |
number |
How many police cars chase these players now. |
carCap |
number |
The game’s limit. |
sharedWantedPlayerCount |
number |
How many other wanted players share this count. |
Returns
Section titled “Returns”Only true lets this one car come. false, or nothing, keeps the limit. An allowed car still goes through
policeUnitDispatchRequest. See
how decisions work.
Example
Section titled “Example”One car more when several wanted players share the count.
import { server } from "nativemp";
server.on("policeCarCapExceedRequest", ({ currentCarCount, carCap, sharedWantedPlayerCount }) => sharedWantedPlayerCount > 0 && currentCarCount === carCap);Related
Section titled “Related”helicopterCapExceedRequest: the same for helicopterspoliceUnitDispatchRequest: decide whether a police unit comes- Wanted and emergency guide