server/edit.lua
Owner-editable server hooks — identity, money, admin, vehicles, Discord, announcements, dispatch.
Do not rename these globals. Core server code calls them by name.
Discord webhook
Config.DiscordWebhook = '' -- empty disables sendingEnable with Config.SendDiscordNotifications = true in shared config. Full setup and example posts: Discord webhook.
Cover photo upload (FiveManage)
Standalone GS Racing can freecam-capture track covers and upload them to FiveManage. Configure upload in this file (server-only) — never put tokens in shared/config.lua.
Config.PhotoUpload = {
enabled = true,
--- Leave empty to use the bundled escrowed fallback (server/upload.lua).
apiToken = '', -- or 'YOUR_FIVEMANAGE_MEDIA_TOKEN' to override
multipartEndpoint = 'https://api.fivemanage.com/api/v3/file',
path = 'gs_racing/covers',
cooldownSeconds = 8,
}If apiToken is empty, the server uses a bundled escrowed fallback token. Set your own Media API token to override it. Requires screenshot-basic.
Freecam UI is controlled by Config.CoverCamera in shared config (enabled = false → URL input only on standalone). When GS Racing is opened through lb-tablet, covers use lb-tablet’s gallery entirely — this upload path is not used there.
Identity & money
| Function | Purpose |
|---|---|
GetPlayer / GetPlayerIdentifier / GetPlayerByIdentifier | Framework player + citizenid/identifier |
GetPlayerSource / GetPlayerName | Online source / display names (incl. offline DB fallback) |
GetPlayerMoney / GivePlayerMoney / RemovePlayerMoney | Bank for fees & prizes |
PayOffline | Credit players who finished but went offline |
Notify | Server → client notifications |
IsAdmin | ACE + framework + Config.AdminIdentifiers |
RegisterUsableItem | Tablet item usable registration |
RegisterFrameworkCommand | Optional framework command helper |
Vehicles
| Function | Purpose |
|---|---|
ResolveVehicleClass(model) | Map model → racing class (default: Config.Vehicles) |
HasIllegalTune(plate) | Block join when plate is illegally tuned (default: always legal) |
function HasIllegalTune(plate)
return exports['your-mechanic']:IsIllegal(plate)
endSide effects
| Function | Purpose |
|---|---|
OnRacingRepChanged(identifier, delta, total) | Sync phone skills / metadata after rep changes |
OnRacingAnnouncement(announcement) | Notify online players about auto races / meetups (email, phone mail, push, …) |
OnPoliceRaceDispatch(alert) | Custom dispatch pack (bundled packs already handled) |
Race / meetup announcements
Auto events and meetups call OnRacingAnnouncement with a ready-made subject / message. The shipped hook emails online players via lb-phone (when Config.EnableLBPhone is on) and uses qb-phone’s sendNewMailToOffline export when that resource is started.
function OnRacingAnnouncement(announcement)
-- announcement.kind = 'race' | 'meetup'
-- announcement.subject, .message, .sender
-- announcement.race or announcement.meetup
endSet Config.AutoEvents.announceNewRaces = false or Config.Meetups.announceMeetups = false to skip the hook entirely.
Bundled dispatch targets: ps-dispatch, cd_dispatch / cd_dispatch3d, qs-dispatch, rcore_dispatch, core_dispatch, lb-tablet. Set Config.Dispatch.resource = 'auto' to pick the first started pack.
