Custom servers
On this page
bridge/client.lua and bridge/server.lua are open in every edition. They hold everything SAF Scenes asks
your framework and inventory, one short function each. You can edit them, but the better place for your
changes is custom/: updates never touch it.
Pick by hand
If you renamed your framework or inventory resource, auto detection can miss it:
custom/shared/config.lua
Config.Framework = 'esx'
Config.Inventory = 'ox_inventory'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 |
Server hooks
| Function | What it does |
|---|---|
Bridge.GetIdentity(src) | Who the player is: { id, name }, or nil when not loaded. Scenes are saved under id, so it must stay the same across sessions |
Bridge.IsStaff(src) | Who counts as staff |
Bridge.ItemCount(src, item) | How many of an item the player has |
Bridge.RegisterUsableItem(item, cb) | What happens when a player uses an item |
Bridge.Notify(src, msg, kind) | A message to the player |
Client hooks
| Function | What it does | Default |
|---|---|---|
Bridge.Notify(msg, kind) | A message to this player | ox_lib notify |
Bridge.Progress(label, ms) | Progress bar while spraying or cleaning. Return true when finished, false when cancelled | ox_lib progress bar |
Your own framework and inventory
custom/server/myframework.lua
function Bridge.GetIdentity(src)
local p = exports['my-core']:GetPlayer(src)
if not p then return nil end
return { id = p.charId, name = p.name }
end
function Bridge.ItemCount(src, item)
return exports['my-inventory']:Count(src, item)
endYour own progress bar
custom/client/progress.lua
function Bridge.Progress(label, ms)
return exports['my-progress']:Start({ label = label, duration = ms, canCancel = true })
endConfig overrides
custom/shared/config.lua
Config.MaxPerPlayer = 10
Config.BlockedWords = { 'badword' }
Config.Webhook = 'https://discord.com/api/webhooks/...'