Installation
On this page
SAF Traffic needs OneSync, which is on by default on current servers. It uses it for the extra jam cars and the props. No database is needed.
Steps
- Put the
saf-trafficfolder in yourresourcesfolder. - Add it to
server.cfg, after your framework:server.cfgensure saf-traffic - Stop other density scripts. SAF Traffic prints a warning in the console when it finds one.
- Give your staff access:Framework admins (server.cfg
add_ace group.admin traffic.staff allowadmin,god,superadmininConfig.StaffGroups) also count. - Start the server and do the first road scan (below).
Other density scripts
Two scripts setting density fight each other every frame. Before you start:
- qb-smallresources: remove its density loop, or set its values to
1.0. Otherwise it caps traffic every frame. - vMenu: leave its density options alone.
- Any other script that calls the density natives every frame: turn it off.
First time: scan the roads
The map isn't a picture. It is built from GTA's own road network, so it lines up exactly with what the closures and jams do in game. Your server needs to read it once.
- Join, open
/trafficand press Scan roads. - Your game walks the map in 408 tiles of 512 m and sends each one to the server. It runs in the background, so you can close the panel and keep playing. A progress bar shows the tiles done and the time left. Expect about 5 to 10 minutes on a normal PC.
- When it's done the server writes
roads.json(a few hundred KB) and every staff member gets the map.
The scan is resumable. If you leave, crash or press Pause, the next Scan roads carries on from the last tile. Only one person can scan at a time.
Postals on the map
Set Config.Postals.Resource to the resource that has your postal file and Config.Postals.File to its path
inside it. The file needs a list of { code, x, y }, the format most postal scripts use.
Config.Postals.Resource = 'nearest-postal'
Config.Postals.File = 'new-postals.json'Files it writes
| File | What it is |
|---|---|
roads.json | The scanned road map. Keep it, it saves a rescan |
scan.json | Scan progress while a scan is unfinished |
state.json | Density, schedule and items (with Config.Save.Items on) |
Updating
Replace every file except your custom/ folder and the three files above. Keep config changes in
custom/shared/ so a new config.lua doesn't undo them.