Framework Compatibility
client/core.lua defines a global HUD table with default values and a handful of functions. Each adapter file starts with a guard on HUD.Framework and, when it matches, overrides those functions and fills HUD.Data from the framework. Only one adapter is active at a time.
Detection
Checked once when the client scripts load, in this order:
| Order | Resource checked | HUD.Framework |
|---|---|---|
| 1 | qbx_core started | qbx |
| 2 | qb-core started | qb |
| 3 | es_extended started | esx |
| – | none of them | none, and a warning is printed to the client console |
The server script does the same for qbx_core and qb-core and returns immediately on ESX or without a framework.
What the core provides without a framework
| Function | Default behaviour |
|---|---|
HUD.IsLoggedIn() | Always true |
HUD.IsDead() | Always false (the HUD still checks IsEntityDead on the ped) |
HUD.Notify(text, type, length) | Calls exports.gta6_notify:Notify if gta6_notify is started, otherwise does nothing |
HUD.MoneyChange(...), HUD.ShowAccount(...) | Send the money animation to the NUI |
HUD.ApplySettings() | Loads the KVP settings, sends the config message to the NUI and fires hud:client:LoadMap. Runs when the NUI reports itself ready, on /resethud and two seconds after the player loads |
QBCore (client/adapter_qb.lua)
| Data | Source |
|---|---|
| Logged in | LocalPlayer.state.isLoggedIn |
| Dead | metadata.isdead or metadata.inlaststand |
| Hunger, thirst, stress | PlayerData.metadata, read once when the adapter loads and again on QBCore:Client:OnPlayerLoaded and QBCore:Player:SetPlayerData, plus hud:client:UpdateNeeds(hunger, thirst) and hud:client:UpdateStress(stress). The read at load is what keeps the values correct after restart gta6_hud |
| Cash, bank | PlayerData.money.cash / .bank |
| Money animation | hud:client:OnMoneyChange(type, amount, isMinus) |
/cash, /bank display | hud:client:ShowAccounts(type, amount) |
| Seatbelt | seatbelt:client:ToggleSeatbelt (toggles) |
| Cruise control | seatbelt:client:ToggleCruise (toggles) |
| Nitro | hud:client:UpdateNitrous(level, active) |
| Harness | An item named harness in PlayerData.items, scanned every second while in a vehicle; harness HP from hud:client:UpdateHarness(hp) |
| Developer-mode chip | qb-admin:client:ToggleDevmode |
| Notifications | QBCore.Functions.Notify(text, type, length), used only when gta6_notify is not running |
On QBCore:Client:OnPlayerLoaded the adapter waits 2 s and calls HUD.ApplySettings(). On QBCore:Client:OnPlayerUnload the cached player data is cleared.
QBox (client/adapter_qbx.lua)
| Data | Source |
|---|---|
| Player data | exports.qbx_core:GetPlayerData(), read once when the adapter loads and again on QBCore:Client:OnPlayerLoaded and QBCore:Player:SetPlayerData |
| Hunger, thirst, stress, seatbelt, harness | State-bag change handlers on player:<serverId> for the keys hunger, thirst, stress, seatbelt, harness, plus the initial values from LocalPlayer.state |
Cash, bank, money animation, /cash, /bank | Same events as QBCore |
| Cruise control | seatbelt:client:ToggleCruise (from qbx_cruise) |
| Nitro | hud:client:UpdateNitrous(_, level, active), the QBox signature with a leading unused argument |
| Harness HP | hud:client:UpdateHarness(hp) |
| Developer-mode chip | qb-admin:client:ToggleDevmode |
| Notifications | exports.qbx_core:Notify(text, type, length), used only when gta6_notify is not running |
QBox support was written against the official qbx_core, qbx_hud, qbx_smallresources and qbx_medical repositories but has not been tested on a live QBox server. If something does not update, compare the event names above with your qbx resources.
ESX (client/adapter_esx.lua)
| Data | Source |
|---|---|
| Logged in | ESX.PlayerLoaded, then esx:playerLoaded / esx:onPlayerLogout |
| Dead | IsPedDeadOrDying(ped, true) |
| Hunger, thirst | esx_status:onTick (the percent field of the hunger and thirst statuses, floored) |
| Stress | Not available on ESX; the bar stays at 0 and the stress scripts are not loaded |
| Cash, bank | The money and bank accounts, read from ESX.PlayerData when the adapter loads, from xPlayer.accounts on esx:playerLoaded, then from esx:setAccountMoney |
| Money animation | Computed from the difference between the previous and the new balance in esx:setAccountMoney. The money account is shown as cash |
| Seatbelt, cruise control | Exports SeatbeltState(bool) and CruiseControlState(bool) called by esx_cruisecontrol (set HudResource = 'gta6_hud' there). Both reset on esx:exitedVehicle |
| Notifications | ESX.ShowNotification(text, type, length), used only when gta6_notify is not running |
/cash and /bank do not exist on ESX; the money block appears only on balance changes.
Server side (server/main.lua)
Runs on QBCore and QBox only.
| Feature | QBCore | QBox |
|---|---|---|
/cash, /bank | Registered with QBCore.Commands.Add, no permission | Native RegisterCommand, no permission |
/dev | QBCore.Commands.Add with the admin permission | Native RegisterCommand marked restricted, so it needs the ACE command.dev |
| Player lookup | QBCore.Functions.GetPlayer(src) | exports.qbx_core:GetPlayer(src) |
The three commands send hud:client:ShowAccounts (with Player.PlayerData.money[type]) or qb-admin:client:ToggleDevmode back to the caller.
Stress relay
| Event (server) | What it does |
|---|---|
hud:server:GainStress(amount) | Ignored if Config.DisableStress is on or the player's job name or job type is in Config.WhitelistedJobs. Otherwise adds amount to the stress metadata (clamped to 0–100), sends hud:client:UpdateStress and a hud:client:Notify client event with the stress_gain locale string (error, 1500 ms). amount must be a number greater than 0 and at most 100, so a client cannot send a negative value to zero its own stress |
hud:server:RelieveStress(amount) | Ignored if stress is disabled. Subtracts amount (clamped, and validated the same way), sends hud:client:UpdateStress and a hud:client:Notify client event with the stress_removed locale string |
The client (client/stress.lua, QBCore and QBox only) triggers hud:server:GainStress with a random 1 to 3:
- every 10 s while driving a vehicle whose class is enabled in
Config.VehClassStressat or above the speed threshold (Config.MinimumSpeed, orConfig.MinimumSpeedUnbuckledwithout a seatbelt in anything but a motorcycle); - every frame while shooting a weapon not listed in
Config.WhitelistedWeaponStress, with probabilityConfig.StressChance.
Screen effects run on the client from the stress value: at Config.MinimumStress (50) and above, a screen blur whose length comes from Config.Intensity.blur; at 100 the blur is followed by a ragdoll fall and two to four black fades. The pause between effects comes from Config.EffectInterval.
Other scripts (for example qb-ambulancejob or a meditation script) can trigger hud:server:RelieveStress themselves.