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

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:

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

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:

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.

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:

ox_inventory/data/items.lua
['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.

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.