Zone Creation
There are three ways to create safezones:
- In-game creators — Interactive polygon and circle zone builders with fly mode
- Admin panel — NUI-based management interface
- Static configuration — Define zones directly in
config.lua
In-Game Polygon Creator
The polygon creator lets you fly around the map and place points to define a polygon boundary.
Starting the Creator
The polygon creator is launched from the Admin Panel when creating a new polygon zone. It can also be triggered via the client event:
TriggerEvent('f5_safezones:create_zone')
Controls
Movement
| Key | Action |
|---|---|
| W / A / S / D | Move forward / left / backward / right (fly mode) |
| Q / E | Move up / down |
| Left Shift | Fly faster (3x speed) |
| Left Ctrl | Fly slower (0.25x speed) |
Point Placement
| Key | Action |
|---|---|
| F | Place a new point at crosshair position, or move the selected point to crosshair if a point is selected |
| X | Remove the last placed point |
| Delete | Delete the currently selected point (minimum 3 points must remain) |
Point Selection
| Key | Action |
|---|---|
| Tab | Select the next point (cycles through all points) |
| Space | Deselect the current point |
History
| Key | Action |
|---|---|
| Z | Undo last action (up to 50 steps) |
| Y | Redo last undone action |
General
| Key | Action |
|---|---|
| G | Toggle marker preview (shows how the zone will look) |
| Enter | Confirm the polygon (minimum 3 points required) |
| Backspace | Cancel and exit the creator |
How It Works
- When activated, your player becomes invisible and enters fly mode
- A crosshair appears at the point you're aiming at on the ground
- Press F to place polygon vertices — they appear as numbered orange markers connected by yellow lines
- Use Tab to select existing points — selected points turn green with a green label
- With a point selected, press F to move it to the crosshair position, or Delete to remove it
- Press Space to deselect and return to placement mode
- Use Z / Y to undo or redo any changes
- Once you have 3+ points, press G to preview the zone's marker rendering
- Press Enter to confirm — the points are sent back to the admin panel for final configuration
- Press Backspace at any time to cancel
Place points in order around the perimeter. The polygon automatically connects the last point to the first. Use point selection (Tab) and movement (F) to fine-tune positions after placing them.
In-Game Circle Creator
The circle creator lets you define a center point and radius for circle zones.
Starting the Creator
Launched from the Admin Panel when creating a new circle zone. It can also be triggered via the client event:
TriggerEvent('f5_safezones:create_circle_zone')
Controls
Movement
| Key | Action |
|---|---|
| W / A / S / D | Move forward / left / backward / right (fly mode) |
| Q / E | Move up / down |
| Left Shift | Fly faster (3x speed) |
| Left Ctrl | Fly slower (0.25x speed) |
Center & Radius
| Key | Action |
|---|---|
| F | Set center point at crosshair position (only when no center is set yet) |
| X | Reset center point (allows placing a new one with F) |
| R | Set radius to distance between center and crosshair |
| Scroll Up | Increase radius by 5m (+ Shift = 25m, + Ctrl = 1m) |
| Scroll Down | Decrease radius by 5m (+ Shift = 25m, + Ctrl = 1m) |
History
| Key | Action |
|---|---|
| Z | Undo last action (up to 50 steps) |
| Y | Redo last undone action |
General
| Key | Action |
|---|---|
| G | Toggle marker preview |
| Enter | Confirm the circle zone |
| Backspace | Cancel and exit the creator |
How It Works
- Enter fly mode — your player becomes invisible
- Aim at the ground and press F to set the center point (green crosshair)
- A blue circle outline with radius lines appears around the center
- Adjust the radius using Scroll Up/Down or press R to set it to the distance from center to your crosshair
- Use Z / Y to undo or redo center and radius changes
- Press G to preview the zone marker
- Press Enter to confirm — data is sent back to the admin panel
Radius Limits
| Constraint | Value |
|---|---|
| Creator minimum | 0.1 m |
| Server validation minimum | 10.0 m |
| Maximum radius | 500.0 m |
| Default step | 5.0 m |
| Shift step | 25.0 m |
| Ctrl step | 1.0 m |
The in-game creator allows placing a radius as small as 0.1m, but the server rejects zones with a radius below 10m during validation. Always use a radius of at least 10m when saving a zone.
Editing Existing Zones In-Game
Both creators support an edit mode for modifying existing zones. When launched from the admin panel while editing a zone, the creator starts with the existing zone data pre-loaded.
How Edit Mode Works
- Open the Admin Panel and click Edit on a zone
- Click Use In-Game Creator — the creator launches with the zone's existing data:
- Polygon zones: All existing points are loaded and displayed as editable markers
- Circle zones: The existing center point and radius are pre-set
- You are automatically teleported to the zone's location
- Make your changes using the standard creator controls
- Press Enter to confirm — the updated data is sent back to the admin panel
- Press Backspace to cancel and discard changes
Polygon Edit Mode Features
- Point selection: Use Tab to cycle through existing points, Space to deselect
- Point movement: Select a point with Tab, then press F to move it to the crosshair position
- Point deletion: Select a point and press Delete to remove it (minimum 3 must remain)
- Add new points: With no point selected, press F to append a new point
- Auto-level: When edit mode starts, the Z coordinates of all existing points are automatically adjusted to match the ground level at each position
Notifications
Both creators display on-screen notifications for all actions — point added, point moved, point deleted, undo/redo, center set, radius changed, etc. Notifications are throttled to avoid spam (one per 300ms).
Creating via Admin Panel
The admin panel provides a visual interface for creating zones. See Admin Panel for full details.
- Open the panel with
/szadmin - Click "Create Zone"
- Choose zone type (circle or polygon)
- Click "Use In-Game Creator" to launch the appropriate creator, or enter coordinates manually
- Configure all zone options (protection, markers, blips)
- Save the zone
Zones created through the admin panel are saved to data/zones.json and persist across server restarts.
Static Configuration
Define zones directly in config.lua for zones that should always exist and never be deleted through the admin panel.
Config.Safezones = {
{
name = "Legion Square",
type = "circle",
coords = vector3(195.17, -933.77, 29.7),
radius = 50.0,
minZ = -50,
maxZ = 150,
showBlip = true,
showMarker = true,
blipName = "Safe Zone - Legion Square",
enableInvincibility = true,
enableGhosting = true,
preventVehicleDamage = true,
disableVehicleWeapons = true,
collisionDisabled = false,
renderDistance = 50.0
},
-- Add more zones here
}
Config zones cannot be deleted through the admin panel. They can only be modified by editing config.lua and restarting the resource. To remove a config zone, delete it from the Config.Safezones table.
Zone Validation
All zones (created via the admin panel or zones.json) are validated server-side before being accepted.
Name Rules
- Length: 3–50 characters
- Sanitization: Only letters, numbers, spaces, hyphens (
-), and underscores (_) are kept — all other characters are stripped automatically - Uniqueness: Case-insensitive — "Hospital" and "hospital" are considered duplicates
Circle Constraints
| Field | Constraint |
|---|---|
coords.x, coords.y, coords.z | Required, must be numeric |
radius | 10.0 – 500.0 (server rejects values outside this range) |
Polygon Constraints
| Field | Constraint |
|---|---|
points | Minimum 3 points, each with numeric x and y |
minZ | Required, must be numeric |
maxZ | Required, must be numeric, must be greater than minZ |
Marker Config Validation
If markerConfig is provided:
typemust be a valid key inConfig.MarkerTypes(1–6), otherwise defaults toConfig.DefaultMarker.typecolor.r,color.g,color.bare required and clamped to 0–255color.adefaults to 100 if not provided, clamped to 0–255
Save System
Custom zone data is persisted to data/zones.json with the following reliability features:
- Debounced writes — saves are delayed by 1 second to batch rapid changes (e.g., multiple edits in quick succession)
- Automatic backup — a
data/zones.json.backupis created before each write - Restore on failure — if the write fails, the system automatically restores from the backup
Zone activation states are stored separately in data/zone_states.json and are also persisted immediately on change.
Custom Zones File
Zones created through the admin panel are stored in data/zones.json. This file is automatically managed — you generally don't need to edit it manually, but you can.
[
{
"name": "My Custom Zone",
"type": "polygon",
"points": [
{"x": 236.45, "y": -1064.96},
{"x": 204.24, "y": -1049.54},
{"x": 213.88, "y": -1023.30}
],
"minZ": 26.1,
"maxZ": 30.3,
"showBlip": true,
"showMarker": true,
"enableInvincibility": true,
"enableGhosting": true,
"createdBy": "AdminName",
"createdAt": 1771680006
}
]
See Save System above for details on backup and restore behavior.
Zone Activation States
Zone activation states (active/inactive) are stored separately in data/zone_states.json. This allows you to temporarily disable zones without deleting them.
{
"Legion Square": true,
"My Custom Zone": false
}
See Also
- Zone Types — all available zone fields and options
- Admin Panel — full admin interface guide
- Configuration — global marker and system settings