Dependencies
Installation
Install PolyZone
Download PolyZone and place it in your
resources directory. Start it before sh-zones in server.cfg.Configure your zones
Open
config.lua and define your Green Zones and Red Zones. See the Configuration section below for the full options reference.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
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.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.
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:
The world-space centre point of the circular zone. Use F8 in-game or a coords resource to find the exact position.
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.
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)
| Zone Name | Coordinates | Radius |
|---|---|---|
| Observatory | -418.96, 1147.28, 325.98 | 120.0 m |
| Casino | 1039.9, 53.78, 69.06 | 140.0 m |
| Sandy Shores | 1725.72, 3462.73, 38.06 | 20.0 m |
| Sandy Hospital | 1762.38, 3645.93, 34.85 | 40.0 m |
| Hayes Auto | -1418.61, -443.86, 35.91 | 40.0 m |
| Hospital | 314.11, -590.09, 43.28 | 55.0 m |
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.