gta6_hud keeps the event names of qb-hud, so scripts that already talk to qb-hud or qbx_hud work unchanged. Everything below is client-side unless stated otherwise.
Client events (net events)
| Event | Arguments | Framework | Effect |
|---|
hud:client:UpdateNeeds | hunger, thirst | QBCore | Sets both values |
hud:client:UpdateStress | stress | QBCore, QBox | Sets the stress value (the server relay sends this) |
hud:client:UpdateNitrous | QBCore: level, active · QBox: _, level, active | QBCore, QBox | Nitro bar level (0–100) and the "active" glow |
hud:client:UpdateHarness | hp | QBCore, QBox | Harness HP; the bar shows hp × 5 |
hud:client:OnMoneyChange | type, amount, isMinus | QBCore, QBox | Plays the money-change animation with the current balances |
hud:client:ShowAccounts | type, amount | QBCore, QBox | Flashes one account (cash or bank) for 3.5 s |
seatbelt:client:ToggleSeatbelt | – | QBCore | Toggles the seatbelt state |
seatbelt:client:ToggleCruise | – | QBCore, QBox | Toggles the cruise-control chip |
qb-admin:client:ToggleDevmode | – | QBCore, QBox | Toggles the developer chip |
hud:client:ToggleHealth | – | all | Toggles the health switch, saves the settings and pushes the new value to the NUI. With the switch off the health bar stays on screen inside vehicles |
hud:client:ToggleShowSeatbelt | – | all | Shows or hides the seatbelt chip (for example while a seatbelt script is disabled) |
hud:client:LoadMap | – | all | Re-runs the minimap setup (mask, position, colour, zoom). Fire it after another resource changed the radar |
hud:client:Notify | text, type, length | all | Routes a notification through HUD.Notify, so it lands in gta6_notify when that resource runs and in the framework's notify function otherwise. The server uses it for the two stress messages |
On QBox the needs, stress, seatbelt and harness values come from state bags instead of the first events; see Framework Compatibility.
Example: a nitro script (QBCore)
TriggerEvent('hud:client:UpdateNitrous', nitroLevel, true)
Local events the HUD listens to
| Event | Source |
|---|
pma-voice:radioActive (state) | pma-voice; colours the voice chip pink while transmitting |
esx_status:onTick (data) | esx_status; hunger and thirst on ESX |
esx:setAccountMoney, esx:playerLoaded, esx:onPlayerLogout, esx:exitedVehicle | es_extended |
QBCore:Client:OnPlayerLoaded, QBCore:Client:OnPlayerUnload, QBCore:Player:SetPlayerData | qb-core / qbx_core |
Server events
| Event | Arguments | Framework | Effect |
|---|
hud:server:GainStress | amount | QBCore, QBox | Adds stress (clamped 0–100), unless the job is whitelisted or stress is disabled. amount must be a number greater than 0 and at most 100; anything else, including NaN, is dropped |
hud:server:RelieveStress | amount | QBCore, QBox | Removes stress. The same validation applies to amount |
Example: relieve stress from another resource (client)
TriggerServerEvent('hud:server:RelieveStress', 10)
Exports
| Export | Side | Framework | Purpose |
|---|
exports.gta6_hud:SeatbeltState(state) | client | ESX | Called by esx_cruisecontrol; true = buckled |
exports.gta6_hud:CruiseControlState(state) | client | ESX | Called by esx_cruisecontrol; true = cruise active |
The two exports exist only when the ESX adapter is active. There are no other exports.
Commands and key mapping
| Command | Side | Framework | Effect |
|---|
/hudmenu | client | all | Opens the settings menu. Bound to Config.OpenMenu (default I) through RegisterKeyMapping under the label from the menu_keymap locale key |
/resethud | client | all | Clears every change cache and sends the settings, the config message and the minimap setup again, with a notification at each end |
/cash, /bank | server | QBCore, QBox | Show the account balance for 3.5 s |
/dev | server | QBCore, QBox | Toggles the developer chip; needs admin (QBCore) or the ACE command.dev (QBox) |
Optional resource hooks
| Resource | How gta6_hud uses it |
|---|
gta6_notify | exports.gta6_notify:Notify(text, type, length) whenever the resource is started, on every framework. Only without it does the HUD fall back to the framework's notify function. The framework patch described in the gta6_notify installation is still what routes other scripts' notifications here |
LegacyFuel | exports['LegacyFuel']:GetFuel(vehicle) inside a pcall, so a missing resource is harmless |
interact-sound | TriggerServerEvent('InteractSound_SV:PlayOnSource', name, volume) for menu sounds |
NUI messages
For reference when editing the UI. Messages are sent with SendNUIMessage and dispatched on action:
| Action | Sent by | Content |
|---|
hudtick | client/player.lua | 26 player fields (visibility, the eight dynamic switches, health, dead flag, armour, thirst, hunger, stress, armed, oxygen, parachute, nitro level and active flag, cruise, harness, harness HP, engine, developer flag, underwater) |
car | client/player.lua | 12 vehicle fields (visibility, seatbelt, speed, fuel, altitude, aircraft flag, seatbelt-chip flag, make, model, zone, navigation code, navigation distance). Leaving a vehicle sends { show = false, left = true }, which is what tells the NUI to replay the vehicle tile on the next entry |
voice | client/voice.lua | Proximity level, talking flag, radio channel and radio-active flag for the microphone chip. Sent from its own 50 ms loop, and only when one of the four values changes |
update | client/compass.lua | Heading in degrees |
baseplate | client/compass.lua | Compass visibility, street names and the four compass switches |
weapon | client/weapon.lua | Visibility and { icon, clip, reserve } or { icon, count } |
show, updatemoney | client/core.lua | Money block |
config | client/core.lua | Speed unit, health and status timing, locale code, navigation texts and units, and the whole menu text table |
open | client/core.lua | Opens the menu |
setting | client/core.lua | One settings switch, as { key, value } |
NUI callbacks registered in Lua: nuiReady (sent once the page has loaded; the HUD answers by clearing its change caches and re-sending the settings, the config message and the minimap setup), closeMenu, restartHud, resetStorage, cinematicMode, and one callback per switch generated from the toggles table in client/core.lua (showOutMap, showOutCompass, showFollowCompass, showFuelAlert, showCinematicNotif, dynamicHealth, dynamicArmor, dynamicHunger, dynamicThirst, dynamicStress, dynamicOxygen, changeFPS, dynamicEngine, dynamicNitro, showCompassBase, showStreetsNames, showPointerIndex, showDegreesNum, changeCompassFPS, openMenuSounds, resetHudSounds, checklistSounds, HideMap).