Skip to content

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.

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 pause
local ready = exports.aurora_hud:IsHudReady() -- true once everything has loaded

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.

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

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.

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

exports.aurora_hud:SetPlayerInfo({ jobLabel = 'Police', cash = 1500 })

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

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 negative
exports.aurora_hud:SetStress(50) -- absolute, 0–100
local s = exports.aurora_hud:GetStress() -- current value

Turn the HUD’s version off in /hud → Admin first.

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

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

Client
exports.aurora_hud:SetVoice({
range = 2, -- 1 whisper, 2 normal, 3 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.

The widget reads the weapon in hand and its ammo from the game, so it works whichever inventory you run, or with none. The reserve beside the clip is the ammo the character carries for that weapon.

ox_inventory also reports which ammo item the weapon uses, through ox_inventory:currentWeapon, and the reserve is then counted from that item through Custom.GetItemCount. To do the same from another inventory, report the weapon when it is equipped:

Client
exports.aurora_hud:SetWeapon({
name = 'WEAPON_PISTOL', -- the game's weapon name: applies while that weapon is in hand
label = 'Pistol',
ammoType = 'ammo-9', -- item counted as reserve, optional
durability = 100, -- optional: jerrycan / extinguisher level
melee = false, -- optional: read from the game when left out
})
exports.aurora_hud:SetWeapon(nil) -- holstered: back to what the game reports

A player counts as down when a state bag key listed in Custom.downed says so, when the framework’s data says so, or when the ped dies. For an ambulance script that uses none of these:

Client
exports.aurora_hud:SetDowned(true)
exports.aurora_hud:SetDowned(false)

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/off
exports.aurora_hud:SetCustomStatus('radiation', 73) -- numbered, 0–100

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.

For an inventory that fires events rather than answering questions, from your own script or from an adapter in config/client.lua:

Client
exports.aurora_hud:SetItemCount('ammo-9', 42) -- after every count change
exports.aurora_hud:ItemUsed('joint') -- the player used an item

After the first SetItemCount, the HUD asks the inventory once per item and trusts the pushes from then on, so an inventory that does not report every change should not use it. ItemUsed feeds the stress items. With ox_inventory the HUD does both on its own.

The item that unlocks a locked widget must exist in your inventory and report its use to the HUD. How depends on the inventory.

ox_inventory, which every Qbox server runs: point the item’s client.export at the HUD, then restart ox_inventory:

ox_inventory/data/items.lua
['gps'] = {
label = 'GPS',
client = {
export = 'aurora_hud.useWidgetItem',
},
},

QBCore or ESX with the framework’s inventory: 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.

useWidgetItem is for widget locks only. For stress items, see Stress.

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