Skip to content

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.

Hides the whole HUD without stopping it — cutscenes, admin cameras, events.

-- Client
exports.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 pause
local ready = exports.hud:IsHudReady() -- true once everything has loaded
-- Server
exports.hud:SetHudVisible(playerId, false) -- one player
exports.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.

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.

-- Server
exports.hud:SetStatus(source, { hunger = 80, thirst = 60, stress = 20 })
-- Client
exports.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.

Feeds the job and wallet widgets. Sending a field switches on the matching widget.

-- Server
exports.hud:SetPlayerInfo(source, {
jobLabel = 'Police',
jobGrade = 'Sergeant',
cash = 1500,
bank = 42000,
})
-- Client
exports.hud:SetPlayerInfo({ jobLabel = 'Police', cash = 1500 })

cash and bank are clamped to integers ≥ 0; jobLabel and jobGrade are cut at 48 characters.

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.

-- Client
exports.hud:AddStress(10) -- add, or subtract with a negative
exports.hud:SetStress(50) -- absolute, 0–100
local s = exports.hud:GetStress() -- current value
-- Server: a deliberately non-net event, so only server code can reach it
TriggerEvent('aurora_hud:server:addStress', source, 10)

For servers already running their own. Turn the HUD’s version off in /hud → Admin first.

-- Client
exports.hud:SetSeatbelt(true)
exports.hud:SetSignal(2) -- 0 off, 1 left, 2 right, 3 hazards
exports.hud:SetCruise(true, 90) -- active, km/h

Each 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.

-- Client
exports.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.

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:

-- Client
exports.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 it

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:

-- Client
exports.hud:SetDowned(true)
exports.hud:SetDowned(false)

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.

-- Client
exports.hud:SetCustomStatus('safezone', true) -- static, on/off
exports.hud:SetCustomStatus('radiation', 73) -- numbered, 0–100
-- Server
exports.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.

Other resources can add a line to the support report when they hit a problem with their HUD integration:

-- Client and server, same signature
exports.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.