nx_racing:server:raceCreated Event Listener Guide

The nx_racing:server:raceCreated event is a server-side event that signals the creation of a new race. This event provides details about the race configuration, including track settings, lap count, and participant requirements.

โš ๏ธ

The nx_racing:server:raceCreated event is internal to the Nexure Racing System and should NEVER be triggered by other scripts.


Event Listener Setup

To handle this event in your server script, add the following event handler:

AddEventHandler('nx_racing:server:raceCreated', 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.
  • trackId (string): The unique identifier of the track being used.
  • laps (number): The number of laps for the race.
  • startTime (number): The scheduled start time of the race in Unix Timestamp Format.
  • phasingOn (boolean): Indicates if collision phasing is enabled at the start of the race.
  • phasingTime (number): The duration of collision phasing in seconds.
  • buyIn (number): The entry fee required to participate in the race.
  • camera (string): Camera setting for the race, either "unset" (playerโ€™s choice) or "first" (forced first-person).
  • class (number): The vehicle class allowed for the race.

Example raceData Structure

Here is an example of the data received in the raceData object:

{
    raceId = "race_002",
    trackId = "track_456",
    laps = 3,
    startTime = 1733424346,
    phasingOn = true,
    phasingTime = 15,
    buyIn = 1000,
    camera = "unset",
    class = "super",
}

Notes

  • This event is used internally by the Nexure Racing System to manage race creation workflows.
  • Avoid manipulating this event or its data from external scripts to maintain system integrity.