Dependencies
Installation
1
Install PolyZone
Download PolyZone and place it in your
resources directory. Start it before sh-zones in server.cfg.2
Add sh-zones to your server
Place the
sh-zones folder inside your resources directory.3
Configure your zones
Open
config.lua and define your Green Zones and Red Zones. See the Configuration section below for the full options reference.4
Start sh-zones in server.cfg
server.cfg
Configuration
All zone settings live in a singleconfig.lua file. The file is divided into global speed settings, a global Red Zone toggle, and the zone coordinate list.
config.lua
Global Options
number
default:"25.0"
Maximum vehicle speed in metres per second enforced inside every Green Zone. This is applied via
SetEntityMaxSpeed and affects all vehicles, including those driven by NPC peds owned by the player.number
default:"120.0"
Maximum vehicle speed in metres per second applied to the player’s vehicle when they leave a Green Zone. Set this to a high value to effectively remove the speed cap outside zones.
boolean
default:"true"
Globally enables or disables all Red Zones. Set to
false to remove all Red Zone blips and effects without deleting the zone definitions from the config.Zone Entry Format
Each entry inGreenZones or RedZones takes the following fields:
vector3
required
The world-space centre point of the circular zone. Use F8 in-game or a coords resource to find the exact position.
string
required
A display name shown to players in the on-screen HUD text when they enter the zone. Also used as the blip label on the minimap.
number
required
The radius of the circular zone in metres. The PolyZone CircleZone and the minimap blip overlay both use this value.
Default Zones
sh-zones ships with the following pre-configured zones so your server has safe areas from day one.- Green Zones (Default)
- Red Zones (Default)
Adding a New Zone
To add a zone, openconfig.lua, copy an existing entry from the appropriate list, and update the coords, name, and radius fields.
config.lua
Green Zone Enforcement Details
Vehicle speed cap
Vehicle speed cap
The speed cap is enforced client-side using
SetEntityMaxSpeed. The value in Config.inGreenZone (default 25.0 m/s, roughly 56 mph) applies to the vehicle the player is currently driving. When the player exits the Green Zone the cap is immediately raised to Config.outGreenZone.Combat and weapon lockdown
Combat and weapon lockdown
Inside a Green Zone, the following player actions are disabled:
- Opening the weapon wheel
- Firing any weapon
- Reloading
- Melee attacks
Player invincibility and collisions
Player invincibility and collisions
While inside a Green Zone, each player is set to invincible (
SetEntityInvincible) and player-to-player collisions are disabled. Both states are reverted the moment the player exits the zone.