Create hunting zones
Draw, edit and delete hunting zones in game with the zone editor, and how zones rotate.
Hunting zones are the areas where animals spawn. Hunting comes with 15 zones across the countryside. You draw your own in game with the zone editor. Every change is saved to the database and reaches all players at once, with no restart.
1. Make yourself an admin
Open gg_hunting/utility.lua and put your own identifier in admins:
admins = {
["license2:your_license_here"] = true,
}
Find it in txAdmin: open Players, select yourself and copy the identifier that starts with license2: or license:. Remove the example entries.
Players with the admin permission on QBCore or Qbox are admins too. On ESX, add yourself to admins.
Restart gg_hunting after you change the file, then join the server.
2. Open the zone editor
In game, type this in the F8 console or the chat:
/gg_hunting:zoneEditor
The hunting tablet opens on the map with the editor next to it. The same command closes it. Admins get the command when they join or when gg_hunting starts.
3. Draw a zone
- Select Create New Zone.
- Type a name in Zone Name, up to 100 characters.
- Click the map to add the corners of the zone, at least three. Click and hold a point to drag it. Undo removes the last point.
- Select Save Zone.
The zone appears under Zones In Database. Cancel or Esc stops drawing without saving.
Draw zones over open countryside such as forest, fields and hills. Animals spawn around the hunter on natural ground inside the zone, so a zone over roads, water or a town spawns few animals.
Edit or delete a zone
Under Zones In Database, hover a zone to see it on the map.
- To edit it, select the pencil. Rename it, drag or add points, then select Update Zone.
- To delete it, select the bin. The zone is removed at once, with no confirmation.
Keep at least one zone. With no zones left, admins who join don't get the command. If that happens, restart gg_hunting while you are in the server. After about a minute the command works again, and you can draw a new zone.
How zones rotate
Five zones are open at a time. Each open zone gets three animals, picked by their spawn weight, and each animal rolls a density: low, normal or high. Every two hours a new set of zones opens.
Saving or deleting a zone starts a new rotation at once, so players may see different zones open.
The numbers are in huntingZones in config/shared/settings.lua:
| Setting | Default | What it does |
|---|---|---|
activeZones | 5 | How many zones are open at a time |
zoneDuration | 120 | Minutes before the open zones rotate |
enterDelay | 60 | Seconds a player stays in a zone before it counts them as inside |
maxZoneSpawns | 7 | Most live animals in one zone |
maxPlayerSpawns | 2 | Most live animals one player can have in a zone |
requireKillsWithinZone | false | When true, kills outside an open zone don't count |
Each animal's spawn weight is spawnProbability in config/shared/animals.lua.
Where zones are stored
Zones live in the gg_hunting_zones database table. The 15 default zones come from base/build/zone_data.json, which Hunting reads only on its very first start. Editing that file afterwards changes nothing, so use the zone editor.
