Exports
The public API of Aurora HUD, for hiding the HUD, pushing statuses and feeding widgets from your own scripts.
The resource is named aurora_hud, so every call is exports.aurora_hud:.... These are
state changes, not stop/start: the HUD keeps running throughout.
Showing and hiding
Section titled “Showing and hiding”Hides the whole HUD without stopping it: cutscenes, admin cameras, events.
exports.aurora_hud:SetHudVisible(false)exports.aurora_hud:SetHudVisible(true)
local newState = exports.aurora_hud:ToggleHud() -- returns the new state (boolean)local enabled = exports.aurora_hud:IsHudEnabled() -- reads the switch, ignoring pauselocal ready = exports.aurora_hud:IsHudReady() -- true once everything has loadedexports.aurora_hud:SetHudVisible(playerId, false) -- one playerexports.aurora_hud:SetHudVisible(-1, true) -- everyone (-1 or nil)The HUD is drawn only when enabled and ready and the game is not paused. Closing the pause menu does not undo a hide.
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.
Body status
Section titled “Body status”For standalone servers, or a separate hunger and stress system. Values are clamped to 0–100.
exports.aurora_hud:SetStatus({ hunger = 80, thirst = 60, stress = 20 })exports.aurora_hud:SetStatus(source, { hunger = 80, thirst = 60, stress = 20 })The server form returns true/false, failing on an invalid source or a second
argument that is not a table.
On a framework server these are a nudge rather than a source, the same as money: the framework’s next hunger, thirst or stress update overwrites them.
Player info
Section titled “Player info”Feeds the job and wallet widgets. Sending a field switches on the matching widget.
exports.aurora_hud:SetPlayerInfo({ jobLabel = 'Police', cash = 1500 })exports.aurora_hud:SetPlayerInfo(source, { jobLabel = 'Police', jobGrade = 'Sergeant', cash = 1500, bank = 42000,})cash and bank are clamped to integers ≥ 0; jobLabel and jobGrade are cut at 48
characters.
Stress
Section titled “Stress”Effective only while the HUD’s stress engine is on, set in /hud → Admin. Otherwise
stress comes from framework metadata and these are ignored.
exports.aurora_hud:AddStress(10) -- add, or subtract with a negativeexports.aurora_hud:SetStress(50) -- absolute, 0–100local s = exports.aurora_hud:GetStress() -- current value-- 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”Turn the HUD’s version off in /hud → Admin first.
exports.aurora_hud:SetSeatbelt(true)exports.aurora_hud:SetSignal(2) -- 0 off, 1 left, 2 right, 3 hazardsexports.aurora_hud:SetCruise(true, 90) -- active, km/hEach returns true if applied, or false if the HUD’s own version of that feature is on.
For the reverse, reacting when the HUD drives these, use the
Custom.OnSeatbeltChanged / OnSignalChanged / OnCruiseChanged hooks in
config/client.lua.
The widget reads pma-voice by default. SaltyChat and TokoVoip are wired in
config/client.lua, as is the call icon for lb-phone, qs-smartphone, gksphone and
roadphone.
exports.aurora_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: sending only onCall leaves range and talking coming from
pma-voice.
For a script that exposes reads rather than firing events, define Custom.GetVoice() in
config/client.lua returning the same table. It is called from the HUD’s existing state
loop, 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. Any
other inventory must report what is in hand:
exports.aurora_hud:SetWeapon({ name = 'WEAPON_PISTOL', label = 'Pistol', ammoType = 'ammo-9', -- item counted as reserve, optional durability = 100, -- optional: jerrycan / extinguisher level melee = false,})
exports.aurora_hud:SetWeapon(nil) -- holstered, hide itDowned state
Section titled “Downed state”A player counts as down when a qb-style statebag says so (isdead, inlaststand, …) or
when the ped dies. For an ambulance script using neither:
exports.aurora_hud:SetDowned(true)exports.aurora_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. Nothing is polled; the value is sent only when it changes.
exports.aurora_hud:SetCustomStatus('safezone', true) -- static, on/offexports.aurora_hud:SetCustomStatus('radiation', 73) -- numbered, 0–100exports.aurora_hud:SetCustomStatus(playerId, 'safezone', true)Whether a status is static or numbered is decided in the menu, at definition time; this
export only delivers the value. Only number, boolean or nil are accepted, and
anything else is ignored.
Widget lock items
Section titled “Widget lock items”The item that unlocks a locked widget or relieves stress must report its use to the HUD. How depends on the inventory.
ox_inventory: point the item’s client.export at the HUD:
['gps'] = { label = 'GPS', client = { export = 'aurora_hud.useWidgetItem', },},QBCore / Qbox / ESX: nothing to wire. The HUD registers the item name from the menu as a usable item itself.
Another inventory: carried by the adapter in config/server.lua, through the
inventory’s own exports or a hand-written OnUse. See
Inventories.
Every use is validated server-side: the player must hold the item, and rapid repeats are dropped. Consumed or toggle is set per widget in the menu.
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:
exports.aurora_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.