Skip to content

ax.zones

Source: gamemode/modules/zones/libraries/sh_zones.lua

Zone system core library.

Documented functions: 9

Functions


ax.zones:Add(spec)

Add a new zone to the registry.

Realm: server

Returns

  • number|nil: id The assigned zone ID, or nil on failure
  • string|nil: error Error message if addition failed

ax.zones:Clear()

Clear all zones (runtime only).

Realm: server


ax.zones:Get(identifier)

Get a zone by ID or name.

Realm: shared

Returns

  • table|nil: The zone spec or nil if not found

ax.zones:GetAll()

Get all zones.

Realm: shared

Returns

  • table: Table of zone IDs mapped to zone specs

ax.zones:GetType(typeName)

Get a registered zone type implementation.

Realm: shared

Returns

  • table|nil: The type implementation or nil if not found

ax.zones:RegisterType(typeName, impl)

Register a zone type with validation and containment logic.

Realm: shared

Usage

ax.zones:RegisterType("box", { Validate = function(spec) ... end, Contains = function(spec, pos) ... end })

ax.zones:Remove(identifier)

Remove a zone from the registry.

Realm: server

Returns

  • boolean: success Whether the removal succeeded

ax.zones:Update(identifier, patch)

Update an existing zone.

Realm: server

Returns

  • boolean: success Whether the update succeeded

ax.zones:ValidateSpec(spec)

Validate a zone spec against its type implementation.

Realm: shared

Returns

  • boolean: success Whether validation passed
  • string|nil: error Error message if validation failed