thunder-stallExports and Events
Client Events
You can adapt your HUD to display the number of collisions the vehicle has. It is updated whenever a player enters the vehicle and whenever the value is updated.
thunder-stall:hud
This event receives a parameter containing the number of collisions.
Example implementation in your HUD:
-- param: int collisions
RegisterNetEvent("thunder-stall:hud")
AddEventHandler("thunder-stall:hud",function(collisions)
SendNUIMessage({ Action = "UpdateStall", Collisions = collisions })
end)
thunder-stall:forceUpdateHud
When executing a ResetStall, for optimization purposes the command will not update the HUD collision counter for those inside the vehicle. Therefore, you should trigger this event through a fixed command, for example on the server-side.
The "thunder-stall:hud" is always triggered when entering a vehicle or changing seats, updating the HUD. Use the force event carefully if needed.
-- param: number -- source -- source of player in server-side
TriggerClientEvent("thunder-stall:forceUpdateHud", source)