Exports
The resource is named hud, so every call is exports.hud:....
These are state changes, never a stop/start. The HUD keeps running; switching
something back on restores it immediately.
Showing and hiding
Section titled “Showing and hiding”Hides the whole HUD without stopping it — cutscenes, admin cameras, events.
-- Clientexports.hud:SetHudVisible(false)exports.hud:SetHudVisible(true)
local newState = exports.hud:ToggleHud() -- returns the new state (boolean)local enabled = exports.hud:IsHudEnabled() -- reads the switch, ignoring pauselocal ready = exports.hud:IsHudReady() -- true once everything has loaded-- Serverexports.hud:SetHudVisible(playerId, false) -- one playerexports.hud:SetHudVisible(-1, true) -- everyone (-1 or nil)Real visibility combines three things: the HUD is drawn only if it is enabled AND ready AND the game is not paused. Hiding it is not undone by closing the pause menu.
Ready means the player has joined, every server setting has answered, and the ped has
spawned. Until then the HUD is not drawn and /hud refuses to open — so nobody catches it
showing default values.
Body status
Section titled “Body status”For standalone servers, or your own hunger and stress systems. Values are clamped to 0–100, and only the fields you pass are sent on.
-- Serverexports.hud:SetStatus(source, { hunger = 80, thirst = 60, stress = 20 })-- Clientexports.hud:SetStatus({ hunger = 80, thirst = 60, stress = 20 })The server form returns true/false — it fails if source is invalid or the second
argument is not a table.
Player info
Section titled “Player info”Feeds the job and wallet widgets. Sending a field switches on the matching widget.
-- Serverexports.hud:SetPlayerInfo(source, { jobLabel = 'Police', jobGrade = 'Sergeant', cash = 1500, bank = 42000,})-- Clientexports.hud:SetPlayerInfo({ jobLabel = 'Police', cash = 1500 })cash and bank are clamped to integers ≥ 0; jobLabel and jobGrade are cut at 48
characters.
Stress
Section titled “Stress”Only effective while the HUD’s own stress engine is on, which is set in /hud → Admin.
Otherwise stress comes from framework metadata and these are ignored.
-- Clientexports.hud:AddStress(10) -- add, or subtract with a negativeexports.hud:SetStress(50) -- absolute, 0–100local s = exports.hud:GetStress() -- current value-- Server: a deliberately non-net event, so only server code can reach itTriggerEvent('aurora_hud:server:addStress', source, 10)Seatbelt, indicators and cruise control
Section titled “Seatbelt, indicators and cruise control”For servers already running their own. Turn the HUD’s version off in /hud → Admin first.
-- Clientexports.hud:SetSeatbelt(true)exports.hud:SetSignal(2) -- 0 off, 1 left, 2 right, 3 hazardsexports.hud:SetCruise(true, 90) -- active, km/hEach returns true if it was applied, or false if the HUD’s own version of that
feature is on — in which case the HUD is the source of truth and external values are
ignored.
Going the other way — reacting in your scripts when the HUD drives these — use the
Custom.OnSeatbeltChanged / OnSignalChanged / OnCruiseChanged hooks in
config/client.lua.
By default the voice widget reads pma-voice. SaltyChat and TokoVoip are already wired
in config/client.lua, as is the call icon for lb-phone, qs-smartphone, gksphone and
roadphone.
-- Clientexports.hud:SetVoice({ range = 1, -- 0 whisper, 1 normal, 2 shout talking = true, radioChannel = 42, -- 0 = radio off radioTalking = false, onCall = false,})The override is per field. Send only onCall and range and talking keep coming from
pma-voice — which is how an external phone lights the call icon without replacing the rest
of the voice stack.
If your script only exposes reads rather than firing events, define Custom.GetVoice() in
config/client.lua returning the same table. The HUD’s 250 ms state loop calls it, so no
extra thread is created.
Weapon widget
Section titled “Weapon widget”With ox_inventory the widget follows ox_inventory:currentWeapon and counts reserve ammo
through Custom.GetItemCount. With any other inventory, tell the HUD what is in hand:
-- Clientexports.hud:SetWeapon({ name = 'WEAPON_PISTOL', label = 'Pistol', ammoType = 'ammo-9', -- item counted as reserve, optional durability = 100, -- optional: jerrycan / extinguisher level melee = false,})
exports.hud:SetWeapon(nil) -- holstered, hide itDowned state
Section titled “Downed state”The HUD treats a player as down when a qb-style statebag says so (isdead,
inlaststand, …) or when the ped actually dies. If your ambulance script uses neither:
-- Clientexports.hud:SetDowned(true)exports.hud:SetDowned(false)Custom statuses
Section titled “Custom statuses”Pushes the value of a custom status whose source is set to Push in the /hud menu
builder. No polling — you send only when the value changes.
-- Clientexports.hud:SetCustomStatus('safezone', true) -- static, on/offexports.hud:SetCustomStatus('radiation', 73) -- numbered, 0–100-- Serverexports.hud:SetCustomStatus(playerId, 'safezone', true)Whether a status is static or numbered is decided when you define it in the menu; here you
only deliver the value. Only number, boolean or nil are accepted — anything else is
ignored.
Reporting an error
Section titled “Reporting an error”Other resources can add a line to the support report when they hit a problem with their HUD integration:
-- Client and server, same signatureexports.hud:LogError('my-script', 'could not read value X')Entries are grouped by message with a counter, and the report keeps the 15 most recent from each side. It never includes player identifiers or database contents.