Skip to content

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.

server.on("gateOpenRequest", ({ player, gateType, gateModel, position, interior }) => boolean | void | Promise<boolean | void>)
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.

false keeps the gate shut for everyone. Anything else opens it. See how decisions work.

The army bases are for the army.

gamemodes/roleplay.ts
import { server } from "nativemp";
const army = new Set<number>();
server.on("gateOpenRequest", ({ player, gateType }) => gateType !== "military" || army.has(player.id));