Custom servers
On this page
bridge/client.lua and bridge/server.lua are open in every edition. They hold everything SAF Traffic asks
your server. The better place for your changes is custom/: updates never touch it.
How custom/ works
Files in custom/ load after config.lua and bridge/, so anything defined there replaces the original.
| Folder | Use it for |
|---|---|
custom/shared/*.lua | Changing Config values |
custom/client/*.lua | Replacing any client Bridge.* function |
custom/server/*.lua | Replacing any server Bridge.* function |
To pick a framework by hand, set Config.Framework in a custom/shared/ file.
custom/shared/config.lua
Config.SpeedUnit = 'kmh'
Config.Schedule.Enabled = trueServer hooks
| Function | What it does | Default |
|---|---|---|
Bridge.IsStaff(src) | Who can use the panel and staff commands | Console, traffic.staff ACE and Config.StaffGroups |
Bridge.GetName(src) | Name shown in the log | The player's FiveM name, console for the console |
Bridge.Log(src, by, text) | Where changes are logged | Server console |
Bridge.Notify(src, msg, kind) | A message to the player | Sent to the client notify |
Bridge.Announce(targets, title, text) | How players hear about a closure or jam. targets is a list of player ids, or -1 for everyone | Sent to each target's client |
Client hooks
| Function | What it does | Default |
|---|---|---|
Bridge.Notify(msg, kind, title) | Notification style | ox_lib, then the framework's own, then the GTA feed |
Bridge.Announce(title, text) | How an announcement shows | A warning notification |
Your own staff system
custom/server/staff.lua
local base = Bridge.IsStaff
function Bridge.IsStaff(src)
if exports['my-admin']:IsAdmin(src) then return true end
return base(src)
endSend changes to Discord
custom/server/log.lua
local hook = 'https://discord.com/api/webhooks/your/webhook'
function Bridge.Log(src, by, text)
print(('[saf-traffic] %s: %s'):format(by, text))
PerformHttpRequest(hook, function() end, 'POST',
json.encode({ content = ('**%s**: %s'):format(by, text) }),
{ ['Content-Type'] = 'application/json' })
endAnnouncements on your CAD or news ticker
custom/server/announce.lua
function Bridge.Announce(targets, title, text)
exports['my-cad']:PostBolo(title .. ': ' .. text)
TriggerClientEvent('saf-traffic:client:announce', -1, title, text)
end