Custom servers
On this page
bridge/server.lua and bridge/client.lua hold everything SAF Pursuit asks your server. They are open in
every edition. Keep your changes in custom/ so updates never overwrite them.
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 client Bridge.* functions |
custom/server/*.lua | Replacing server Bridge.* functions |
Pick the framework by hand
custom/shared/framework.lua
Config.Framework = 'esx'Config overrides
custom/shared/pursuit.lua
Config.Pit.Assist = 'off'
Config.Pit.MaxMph = 45
Config.Hud.Position = 'bottom-left'
Config.Vehicles.Models = { 'police4', 'fbi', 'fbi2' }Server hooks
| Function | What it does | Default |
|---|---|---|
Bridge.IsPolice(src) | Who can use modes and the PIT assist | pursuit.use ACE, or a police job on duty |
Bridge.GetJob(src) | The player's job and duty, as { name, type, onduty } | Read from the framework |
Bridge.IsPursuitVehicle(src, veh, class) | Which vehicles take a mode | Emergency class or a listed model |
Bridge.PursuitModels() | Extra model hashes that count, sent to every client | From Config.Vehicles.Models |
Bridge.Log(src, kind, msg) | Where mode changes (kind = 'mode') and PITs ('pit') go | Server console |
Bridge.OnJobChange(cb) | Framework events that change police status | Qbox, QBCore, ESX, ND Core and ox_core job and load events |
Client hooks
| Function | What it does | Default |
|---|---|---|
Bridge.Notify(msg, kind) | Notification style. kind is 'inform', 'success' or 'error' | ox_lib, then the framework's own, then the game feed |
Your own police check
custom/server/police.lua
function Bridge.IsPolice(src)
return exports['my-mdt']:IsOnDuty(src)
endIf your duty system changes without a framework event, the player's pursuitAllowed state may lag behind.
Call the callback from Bridge.OnJobChange when duty changes:
custom/server/duty.lua
function Bridge.OnJobChange(cb)
AddEventHandler('my-mdt:dutyChanged', function(src) cb(src) end)
endSend logs to Discord
custom/server/log.lua
function Bridge.Log(src, kind, msg)
print(('[saf-pursuit] %s'):format(msg))
exports['my-logs']:Send('pursuit', msg)
end