F5 StudioF5 Studio
Skip to main content

Events & Exports

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)

EventArgumentsFrameworkEffect
hud:client:UpdateNeedshunger, thirstQBCoreSets both values
hud:client:UpdateStressstressQBCore, QBoxSets the stress value (the server relay sends this)
hud:client:UpdateNitrousQBCore: level, active · QBox: _, level, activeQBCore, QBoxNitro bar level (0–100) and the "active" glow
hud:client:UpdateHarnesshpQBCore, QBoxHarness HP; the bar shows hp × 5
hud:client:OnMoneyChangetype, amount, isMinusQBCore, QBoxPlays the money-change animation with the current balances
hud:client:ShowAccountstype, amountQBCore, QBoxFlashes one account (cash or bank) for 3.5 s
seatbelt:client:ToggleSeatbeltQBCoreToggles the seatbelt state
seatbelt:client:ToggleCruiseQBCore, QBoxToggles the cruise-control chip
qb-admin:client:ToggleDevmodeQBCore, QBoxToggles the developer chip
hud:client:ToggleHealthallToggles 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:ToggleShowSeatbeltallShows or hides the seatbelt chip (for example while a seatbelt script is disabled)
hud:client:LoadMapallRe-runs the minimap setup (mask, position, colour, zoom). Fire it after another resource changed the radar
hud:client:Notifytext, type, lengthallRoutes 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

EventSource
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:exitedVehiclees_extended
QBCore:Client:OnPlayerLoaded, QBCore:Client:OnPlayerUnload, QBCore:Player:SetPlayerDataqb-core / qbx_core

Server events

EventArgumentsFrameworkEffect
hud:server:GainStressamountQBCore, QBoxAdds 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:RelieveStressamountQBCore, QBoxRemoves stress. The same validation applies to amount
Example: relieve stress from another resource (client)
TriggerServerEvent('hud:server:RelieveStress', 10)

Exports

ExportSideFrameworkPurpose
exports.gta6_hud:SeatbeltState(state)clientESXCalled by esx_cruisecontrol; true = buckled
exports.gta6_hud:CruiseControlState(state)clientESXCalled 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

CommandSideFrameworkEffect
/hudmenuclientallOpens the settings menu. Bound to Config.OpenMenu (default I) through RegisterKeyMapping under the label from the menu_keymap locale key
/resethudclientallClears every change cache and sends the settings, the config message and the minimap setup again, with a notification at each end
/cash, /bankserverQBCore, QBoxShow the account balance for 3.5 s
/devserverQBCore, QBoxToggles the developer chip; needs admin (QBCore) or the ACE command.dev (QBox)

Optional resource hooks

ResourceHow gta6_hud uses it
gta6_notifyexports.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
LegacyFuelexports['LegacyFuel']:GetFuel(vehicle) inside a pcall, so a missing resource is harmless
interact-soundTriggerServerEvent('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:

ActionSent byContent
hudtickclient/player.lua26 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)
carclient/player.lua12 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
voiceclient/voice.luaProximity 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
updateclient/compass.luaHeading in degrees
baseplateclient/compass.luaCompass visibility, street names and the four compass switches
weaponclient/weapon.luaVisibility and { icon, clip, reserve } or { icon, count }
show, updatemoneyclient/core.luaMoney block
configclient/core.luaSpeed unit, health and status timing, locale code, navigation texts and units, and the whole menu text table
openclient/core.luaOpens the menu
settingclient/core.luaOne 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).