Custom servers
On this page
bridge/server.lua and bridge/client.lua hold everything SAF Weather 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
Config.Framework = 'auto' finds Qbox, QBCore, ESX, ND Core and ox_core on its own. If you renamed your
framework resource, set it by hand:
custom/shared/framework.lua
Config.Framework = 'qb'Config overrides
custom/shared/config.lua
Config.Temperature.Unit = 'C'
Config.Time.DayLength = 96
Config.Commands.PanelKey = 'F9'Server hooks
| Function | What it does | Default |
|---|---|---|
Bridge.IsStaff(src) | Who can use the panel and staff commands | weather.staff ACE, plus groups in Config.StaffGroups |
Bridge.GetName(src) | Name shown in the console and the panel's change log | The player's FiveM name, console for the server console |
Bridge.Log(src, by, text) | Where every change is logged | Server console |
Bridge.Notify(src, msg, kind) | A message to the player | Sent to the client's Bridge.Notify |
Client hooks
| Function | What it does | Default |
|---|---|---|
Bridge.Notify(msg, kind) | How messages reach the player | ox_lib, then the framework's own, then the GTA feed |
Your own staff system
Wrap the original so the default checks still apply:
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 base = Bridge.Log
function Bridge.Log(src, by, text)
base(src, by, text)
exports['my-logs']:Send('weather', ('%s: %s'):format(by, text))
end