gateOpenRequest
Asks your gamemode when a player comes where one of the game’s gate scripts opens a gate: the army bases’ sliding gates and the airports’ gates. Allowed, the gate slides open on every player’s game, and shuts once no player is within 20 m of it.
Renamed in 0.28 from gateOpen; see renamed names.
Signature
Section titled “Signature”server.on("gateOpenRequest", ({ player, gateType, gateModel, position, interior }) => boolean | void | Promise<boolean | void>)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
player |
PlayerSnapshot |
The player at the gate. |
gateType |
"military" | "airport" |
An army base’s gate or an airport’s. |
gateModel |
number |
The gate’s model: 985 GATE_AUTOR or 986 GATE_AUTOL (military), 988 WS_APGATE (airport). |
position |
Vector3 |
Where the gate stands shut; with gateModel, which gate it is. |
interior |
number |
Its interior, 0 outside. |
Returns
Section titled “Returns”false keeps the gate shut for everyone. Anything else opens it. See how decisions work.
Example
Section titled “Example”The army bases are for the army.
import { server } from "nativemp";
const army = new Set<number>();server.on("gateOpenRequest", ({ player, gateType }) => gateType !== "military" || army.has(player.id));Related
Section titled “Related”venuePanicRequest: the game’s venue scriptsworld.isRuleEnabled: theambientliferule