helicopterCapExceedRequest
GTA:SA limits how many police and news helicopters fly 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 helicopterCapRequest; see renamed names.
Signature
Section titled “Signature”server.on("helicopterCapExceedRequest", ({ player, unit, helicopterService, currentHelicopterCount, helicopterCap }) => boolean | void | Promise<boolean | void>)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
player |
PlayerSnapshot |
The player whose game would send it. |
unit |
DispatchUnitProposal |
The helicopter and its crew. |
helicopterService |
"police" | "news" |
A police Maverick or a news helicopter. |
currentHelicopterCount |
number |
How many fly now. |
helicopterCap |
number |
The game’s limit. |
Returns
Section titled “Returns”Only true lets this one helicopter come. false, or nothing, keeps the limit. An allowed police helicopter still
goes through policeUnitDispatchRequest. See
how decisions work.
Example
Section titled “Example”One news helicopter more than the limit.
import { server } from "nativemp";
server.on("helicopterCapExceedRequest", ({ helicopterService, currentHelicopterCount, helicopterCap }) => helicopterService === "news" && currentHelicopterCount === helicopterCap);Related
Section titled “Related”policeCarCapExceedRequest: the same for police carspoliceUnitDispatchRequest: decide whether a police unit comes- Wanted and emergency guide