F5 StudioF5 Studio
Skip to main content

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:

OrderResource checkedHUD.Framework
1qbx_core startedqbx
2qb-core startedqb
3es_extended startedesx
none of themnone, 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

FunctionDefault 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)

DataSource
Logged inLocalPlayer.state.isLoggedIn
Deadmetadata.isdead or metadata.inlaststand
Hunger, thirst, stressPlayerData.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, bankPlayerData.money.cash / .bank
Money animationhud:client:OnMoneyChange(type, amount, isMinus)
/cash, /bank displayhud:client:ShowAccounts(type, amount)
Seatbeltseatbelt:client:ToggleSeatbelt (toggles)
Cruise controlseatbelt:client:ToggleCruise (toggles)
Nitrohud:client:UpdateNitrous(level, active)
HarnessAn item named harness in PlayerData.items, scanned every second while in a vehicle; harness HP from hud:client:UpdateHarness(hp)
Developer-mode chipqb-admin:client:ToggleDevmode
NotificationsQBCore.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)

DataSource
Player dataexports.qbx_core:GetPlayerData(), read once when the adapter loads and again on QBCore:Client:OnPlayerLoaded and QBCore:Player:SetPlayerData
Hunger, thirst, stress, seatbelt, harnessState-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, /bankSame events as QBCore
Cruise controlseatbelt:client:ToggleCruise (from qbx_cruise)
Nitrohud:client:UpdateNitrous(_, level, active), the QBox signature with a leading unused argument
Harness HPhud:client:UpdateHarness(hp)
Developer-mode chipqb-admin:client:ToggleDevmode
Notificationsexports.qbx_core:Notify(text, type, length), used only when gta6_notify is not running
note

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)

DataSource
Logged inESX.PlayerLoaded, then esx:playerLoaded / esx:onPlayerLogout
DeadIsPedDeadOrDying(ped, true)
Hunger, thirstesx_status:onTick (the percent field of the hunger and thirst statuses, floored)
StressNot available on ESX; the bar stays at 0 and the stress scripts are not loaded
Cash, bankThe money and bank accounts, read from ESX.PlayerData when the adapter loads, from xPlayer.accounts on esx:playerLoaded, then from esx:setAccountMoney
Money animationComputed from the difference between the previous and the new balance in esx:setAccountMoney. The money account is shown as cash
Seatbelt, cruise controlExports SeatbeltState(bool) and CruiseControlState(bool) called by esx_cruisecontrol (set HudResource = 'gta6_hud' there). Both reset on esx:exitedVehicle
NotificationsESX.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.

FeatureQBCoreQBox
/cash, /bankRegistered with QBCore.Commands.Add, no permissionNative RegisterCommand, no permission
/devQBCore.Commands.Add with the admin permissionNative RegisterCommand marked restricted, so it needs the ACE command.dev
Player lookupQBCore.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.VehClassStress at or above the speed threshold (Config.MinimumSpeed, or Config.MinimumSpeedUnbuckled without a seatbelt in anything but a motorcycle);
  • every frame while shooting a weapon not listed in Config.WhitelistedWeaponStress, with probability Config.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.