Events


🔹 Client-Side Events

These events are triggered on the client (player’s game).

1️⃣ scoreboard:updatePlayerList

📌 Description: Updates the player list on the scoreboard.

TriggerEvent('scoreboard:updatePlayerList', players, totalPlayers)
  • players (table): List of connected players.

  • totalPlayers (number): Total number of players.

💡 Usage in Other Scripts:

TriggerEvent('scoreboard:updatePlayerList', {
    {id = 1, name = "John Doe"},
    {id = 2, name = "Jane Doe"}
}, 2)

2️⃣ scoreboard:clientUpdateLEO

📌 Description: Updates the count of law enforcement officers (LEO) on the scoreboard.

TriggerEvent('scoreboard:clientUpdateLEO', leoCount)
  • leoCount (number): Number of police officers online.

💡 Usage in Other Scripts:

TriggerEvent('scoreboard:clientUpdateLEO', 5) -- Shows 5 police officers online

3️⃣ scoreboard:clientUpdateAmbulance

📌 Description: Updates the count of ambulance/EMS personnel on the scoreboard.

TriggerEvent('scoreboard:clientUpdateAmbulance', ambulanceCount)
  • ambulanceCount (number): Number of EMS online.

💡 Usage in Other Scripts:

TriggerEvent('scoreboard:clientUpdateAmbulance', 3) -- Shows 3 EMS online

4️⃣ scoreboard:updateRobberyBoxes

📌 Description: Updates robbery information on the scoreboard.

TriggerEvent('scoreboard:updateRobberyBoxes', data)
  • data.leoCount (number): Number of police officers online.

  • data.robberies (table): Active robberies.

💡 Usage in Other Scripts:

TriggerEvent('scoreboard:updateRobberyBoxes', {
    leoCount = 4,
    robberies = {
        { name = "Main Bank", minPolice = 5 },
        { name = "Vangelico", minPolice = 3 }
    }
})

5️⃣ scoreboard:updateMyInfo

📌 Description: Updates a player's personal information on the scoreboard.

TriggerEvent('scoreboard:updateMyInfo', playerInfo)
  • playerInfo.playerName (string): Player’s name.

  • playerInfo.dob (string): Player’s date of birth.

  • playerInfo.cash (number): Cash amount.

  • playerInfo.bank (number): Bank balance.

  • playerInfo.job (string): Player’s job.

  • playerInfo.grade (string): Player’s job rank.

💡 Usage in Other Scripts:

TriggerEvent('scoreboard:updateMyInfo', {
    playerName = "John Doe",
    dob = "1990-05-21",
    cash = 500,
    bank = 20000,
    job = "Police",
    grade = "Sergeant"
})

6️⃣ scoreboard:update4YouTeam

📌 Description: Updates the special 4YouTeam list.

TriggerEvent('scoreboard:update4YouTeam', teamPlayers)
  • teamPlayers (table): List of players in the 4YouTeam.

💡 Usage in Other Scripts:

TriggerEvent('scoreboard:update4YouTeam', {
    { id = 3, name = "AdminPlayer", group = "Admin" },
    { id = 7, name = "Moderator", group = "Mod" }
})

🔹 Server-Side Events

These events run on the server and send data to clients.

7️⃣ scoreboard:requestPlayerList

📌 Description: Requests the list of players for the scoreboard.

TriggerServerEvent('scoreboard:requestPlayerList')

🔹 How it Works:

  • The client triggers this event.

  • The server responds with scoreboard:updatePlayerList.


8️⃣ scoreboard:requestLEO

📌 Description: Requests the count of police officers online.

TriggerServerEvent('scoreboard:requestLEO')

🔹 How it Works:

  • The client triggers this event.

  • The server responds with scoreboard:clientUpdateLEO.


9️⃣ scoreboard:requestAmbulance

📌 Description: Requests the count of EMS personnel online.

TriggerServerEvent('scoreboard:requestAmbulance')

🔹 How it Works:

  • The client triggers this event.

  • The server responds with scoreboard:clientUpdateAmbulance.


🔟 scoreboard:requestMyInfo

📌 Description: Requests the player's personal information for the scoreboard.

TriggerServerEvent('scoreboard:requestMyInfo')

🔹 How it Works:

  • The client triggers this event.

  • The server responds with scoreboard:updateMyInfo.


1️⃣1️⃣ scoreboard:requestRobberyData

📌 Description: Requests robbery-related scoreboard information.

TriggerServerEvent('scoreboard:requestRobberyData')

🔹 How it Works:

  • The client triggers this event.

  • The server responds with scoreboard:updateRobberyBoxes.


1️⃣2️⃣ scoreboard:request4YouTeam

📌 Description: Requests the list of 4YouTeam members.

TriggerServerEvent('scoreboard:request4YouTeam')

🔹 How it Works:

  • The client triggers this event.

  • The server responds with scoreboard:update4YouTeam.


1️⃣3️⃣ scoreboard:sendConfig

📌 Description: Sends configuration settings to the client.

TriggerServerEvent('scoreboard:sendConfig')

🔹 How it Works:

  • The client triggers this event.

  • The server sends back configuration settings.


🔹 How to Use These Events in Other Scripts

Here’s an example of integrating the scoreboard with another script:

-- Request to show police count when opening another UI
RegisterCommand('showPolice', function(source)
    TriggerServerEvent('scoreboard:requestLEO') -- Requests police count
end)

-- Listen for update and print to console
RegisterNetEvent('scoreboard:clientUpdateLEO')
AddEventHandler('scoreboard:clientUpdateLEO', function(leoCount)
    print("Current LEO count:", leoCount)
end)

Final Notes

  • All client events (scoreboard:updatePlayerList, scoreboard:updateMyInfo, etc.) only update the UI.

  • All server events (scoreboard:requestLEO, scoreboard:requestPlayerList) request data from the server.

  • You can trigger these events from other scripts to integrate the scoreboard with new features.

Last updated