Server
React to key race lifecycle hooks emitted by Nexure Racing.
Tap into these events to log state changes, sync external systems, or trigger framework-specific logic.
nx_racing:server:raceCreated
Internal Event
Emitted by Nexure Racing. Do not trigger it yourself.
AddEventHandler('nx_racing:server:raceCreated', function(raceData)
-- inspect raceData
end)| Field | Type | Description |
|---|---|---|
raceId | string | Unique race identifier. |
trackId | string | Track identifier. |
laps | number | Lap count. |
startTime | number | Unix timestamp for the scheduled start. |
phasingOn | boolean | Whether phasing starts enabled. |
phasingTime | number | Initial phasing duration (seconds). |
buyIn | number | Entry fee. |
camera | string | "unset" or "first". |
class | number | Allowed vehicle class. |
Use this hook to log upcoming races or notify Discord bots that a lobby opened.
nx_racing:server:raceStarted
Internal Event
This event is produced by Nexure Racing. Never emit it manually.
AddEventHandler('nx_racing:server:raceStarted', function(raceData)
-- handle raceData
end)| Field | Type | Description |
|---|---|---|
raceId | string | Race identifier. |
raceType | string | "timeTrial", "circuit", or "sprint". |
trackId | string | Track identifier. |
trackName | string | Track name. |
trackType | string | "circuit" or "sprint". |
trackLaps | number | Lap count (circuit only). |
racerCount | number | Players in the grid. |
racers | any[] | Player source list. |
class | number | Allowed vehicle class. |
moneyPrize | number | Prize pool. |
phasingOn | boolean | Phasing enabled. |
phasingTime | number | Phasing duration (seconds). |
camera | string | "unset" or "first". |
React here to broadcast notifications or enforce racing-only restrictions.
nx_racing:server:raceFinished
Internal Event
Consume this event to track race completions; never emit it manually.
AddEventHandler('nx_racing:server:raceFinished', function(raceData)
-- distribute rewards, log stats, etc.
end)| Field | Type | Description |
|---|---|---|
raceId | number | Unique race identifier. |
raceType | string | "ranked" or "unranked". |
trackId | number | Track identifier. |
trackName | string | Track name. |
trackType | string | "circuit" or "sprint". |
trackLaps | number | Laps when applicable. |
racerCount | number | Participants. |
racers | array | Per-racer data (source, name, time, vehicle, class, position, dnf). |
raceLength | number | Duration in milliseconds. |
raceDistance | number | Total distance in meters. |
class | number | Vehicle class index. |
moneyPrize | number | Prize pool. |
phasingOn | boolean | Whether phasing ran. |
phasingTime | number | Phasing duration in milliseconds. |
camera | string | "unset" or "first". |
Great for payouts, leaderboard tracking, or analytics pipelines.