nx_racing:server:raceStarted
Event Listener Guide
The nx_racing:server:raceStarted
event is a server-side event that signals the start of a race. It provides comprehensive race information, including track details, participant data, race conditions, and more.
โ ๏ธ
The nx_racing:server:raceStarted
event is internal to the Nexure Racing System and should NEVER be triggered by other scripts or resources.
Event Listener Setup
To capture this event in your server script, add the following event handler:
AddEventHandler('nx_racing:server:raceStarted', function(raceData)
-- Event handler logic here, using `raceData` fields.
end)
Event Data Structure
The raceData
object contains the following fields:
raceId
(string): A unique identifier for the race session.raceType
(string): The type of race, either"timeTrial"
,"circuit"
, or"sprint"
.trackId
(string): The unique identifier of the track being used.trackName
(string): The name of the track where the race is held.trackType
(string): The type of track, either"circuit"
(laps) or"sprint"
(point-to-point).trackLaps
(number): The number of laps for the race (only applicable for"circuit"
tracks).racerCount
(number): The total number of players participating in the race.racers
(array): An array of all the race sources.class
(number): The vehicle class allowed for the race.moneyPrize
(number): The total prize money awarded to the winner(s).phasingOn
(boolean): Indicates if collision phasing is enabled during the race.phasingTime
(number): The duration of collision phasing in seconds (if enabled).camera
(string): Camera setting for the race, either"unset"
(playerโs choice) or"first"
(forced first-person).
Example raceData
Structure
Here is an example of the data received in the raceData
object:
{
raceId = "race_001",
raceType = "circuit",
trackId = "track_123",
trackName = "Los Santos Circuit",
trackType = "circuit",
trackLaps = 5,
racerCount = 12,
racers = { 1, 2, 3 },
class = "sports",
moneyPrize = 5000,
phasingOn = true,
phasingTime = 10,
camera = "unset",
}
Notes
- This event is used internally by the Nexure Racing System to signal the start of a race.
- Avoid manipulating this event or its data from external scripts to maintain system integrity.