Skip to content
FMFallout Multiplayer Scripting APIScripting guides and API
Global objectServer APIGenerated

Zone

const Zone: object

Defined in: server/api.d.ts:2036

Areas of the world the server watches, as FiveM resources do with PolyZone: an upright cylinder, around a point in a worldspace or an interior. zoneEnter and zoneLeave tell scripts who came in and who went out, from the places players’ games report: a safe zone, a shop’s floor, a job’s drop point. The server alone knows of them.

all(): number[]

Every zone’s ID.

number[]

In the order they were made.

contains(zone, position, space?): boolean

Whether a point lies in an area: where an NPC stands, a drop, a spawn.

number

The zone’s ID, as create gave it.

Vector3

The point.

{ worldSpace: number; } | { interiorCell: number; }

Where the point is; the Commonwealth when left out.

boolean

False for an unknown ID.

create(options): number

Starts watching an area. Players already in it are told so at the next update.

center and radius, on the ground plane, in game units. height: how far above and below the center it reaches, no limit when left out. name: given back with its events. space: its worldspace or interior, the Commonwealth when left out.

Vector3

number

string

number

{ worldSpace: number; } | { interiorCell: number; }

number

The zone’s ID. Throws for a missing center or a radius that is not above 0.

getPlayers(zone): Player[]

The players in an area, as the last update found them.

number

The zone’s ID, as create gave it.

Player[]

Empty for an unknown ID.

remove(zone): boolean

Stops watching an area; the players in it are told they left.

number

The zone’s ID, as create gave it.

boolean

False for an unknown ID.