Orbit StudiosOrbit Studios
Orbit Studios Resourcesorbit-dynamichud-v2

Events and State Bags

Supported Orbit Dynamic HUD 2.0 integration events, control-panel navigation IDs, and replicated state bags.

Events and State Bags

Use exports for direct client integrations when one exists. Events are provided for compatibility bridges, server-to-client UI calls, configurable phone hooks, and common framework resources. State bags are preferred for continuously owned gameplay state because they replicate and survive resource boundaries cleanly.

Public events

EventContextParametersPurpose
orbit-dynamichud:notifyclientdataShow a notification. May be sent with TriggerClientEvent from the server.
orbit-dynamichud:showTextUIclienttext, options?Show or replace Text UI. May be sent with TriggerClientEvent.
orbit-dynamichud:hideTextUIclientnoneHide Text UI. May be sent with TriggerClientEvent.
orbit-dynamichud:openControlPanelclientcategory?, subcategory?Open the control panel, optionally at an enabled page.
orbit-dynamichud:client:openOnboardingclientnoneOpen an incomplete onboarding flow; intended for manual onboarding integrations.
orbit-dynamichud:client:closeOnboardingclientnoneClose the current onboarding flow and clear its onboarding state and focus.
hud:server:toggleHudserver network eventvisibleSet the calling player's replicated HUD visibility. Client export use is preferred.
orbit-dynamichud:standalone:playerLoadedclientnoneTell a standalone installation to reload normalized player data after login.
orbit-dynamichud:progressBarOverlocal client eventresultObserve a progress-bar NUI result. The blocking export return is preferred.
orbit-dynamichud:skillCheckOverlocal client eventresultObserve a skill-check NUI result. The blocking export return is preferred.

See Interface APIs for notification, Text UI, progress bar, and skill-check payloads.

Trigger and close onboarding

From another client resource:

resources/[custom]/client/main.lua
TriggerEvent('orbit-dynamichud:client:openOnboarding')

Close the current flow from another client resource:

resources/[custom]/client/main.lua
TriggerEvent('orbit-dynamichud:client:closeOnboarding')

From the server, target the player after your character, spawn, or tutorial flow is complete:

resources/[custom]/server/main.lua
TriggerClientEvent(
    'orbit-dynamichud:client:openOnboarding',
    source
)

-- The same event can be targeted later if an external flow must close it.
TriggerClientEvent(
    'orbit-dynamichud:client:closeOnboarding',
    source
)

The open event never forces onboarding onto a client that already completed it. Start requests are ignored when onboarding is disabled or settings are locked, and manual starts do not create the automatic first-run polling thread. The close event is idempotent and may be called even when onboarding is already closed. Prefer the matching startOnboarding and closeOnboarding client exports when integrating from another local resource. See Onboarding for the complete mode and lifecycle guide.

Open a control-panel page

resources/[custom]/client/main.lua
TriggerEvent('orbit-dynamichud:openControlPanel', 'customize', 'shape_selector')

From a server script, target the player:

resources/[custom]/server/main.lua
TriggerClientEvent(
    'orbit-dynamichud:openControlPanel',
    source,
    'settings',
    'audio'
)

Supported category and subcategory IDs are:

CategorySubcategories
customizecolor_picker, status_selector, shape_selector, player_info_selector, speedometer_selector
musicplay, playlists, music_settings
car_controlnone
settings_sharenone
settingsdisplay, audio, performance_settings, edit_mode, panel_theme

The requested category and subcategory must be enabled by Config.ControlPanel. The car-control category opens only while the player is in a vehicle. Settings Share does not open while settings are locked or its launcher is disabled. Omitting IDs opens the normal/default control-panel page.

Phone open and close events

The event names are configurable in Config.PhoneOffset:

resources/[orbit]/orbit-dynamichud-v2/shared/config.lua
Config.PhoneOffset = {
    enabled = true,
    side = 'right',
    offset = 18.0,
    openEvent = 'orbit-dynamichud:phoneOpened',
    closeEvent = 'orbit-dynamichud:phoneClosed'
}

Trigger the configured events from the phone resource:

resources/[phone]/client/main.lua
TriggerEvent('orbit-dynamichud:phoneOpened', 'right')
TriggerEvent('orbit-dynamichud:phoneClosed')

The open payload may be "left", "right", or a table with side or position. A valid payload overrides the configured side for that opening. The events are registered as network events, so server resources may target a client when necessary.

Framework compatibility events

These events exist for compatibility with common ESX, QB, and QBX resources. New standalone integrations should prefer the state bags in the next section.

EventParametersBehavior
esx:setAccountMoneyaccountUpdates money, bank, black_money, or dirty from account.name and account.money.
esx_status:onTickstatusesReads hunger and thirst percentages from the ESX status array.
hud:client:OnMoneyChangeaccount, amount, isMinusApplies a cash, bank, dirty, or black-money delta.
hud:client:UpdateNeedshunger, thirstReplaces QB/QBX needs values.
hud:client:UpdateStressstressReplaces the stress value.
QBCore:Client:OnPlayerLoadednoneReloads normalized HUD player data after the QB player is ready.
esx:onPlayerSpawnxPlayer, skinReloads normalized HUD player data after an ESX spawn.
seatbelt:client:ToggleSeatbeltnoneRe-reads the local seatbelt or harness state.
seatbelt:client:ToggleCruisenoneToggles the compatibility cruise value. A cruiseControl state bag is preferred.
hud:client:UpdateNitrousunused, level, activeDeprecated QB-style nitrous update. Vehicle state bags are preferred.
resources/[custom]/client/needs.lua
TriggerEvent('hud:client:UpdateNeeds', 82, 64)
TriggerEvent('hud:client:UpdateStress', 15)

State bags

Player state

KeyValuePurpose
hud:showHudbooleanMaster HUD visibility.
hud:deathState1, 2, or 31 alive, 2 last stand, 3 dead.
hungernumberHunger percentage/value.
thirstnumberThirst percentage/value.
stressnumberStress percentage/value.
invOpenbooleanHides the HUD while an inventory is open.
seatbeltbooleanSeatbelt indicator.
harnessbooleanCompatibility fallback read with seatbelt state.
cruiseControlbooleanCruise-control indicator.
qbx_medical:deathStateframework valueMirrored into hud:deathState by the QBX bridge.
proximitytableReads the pma-voice-compatible mode value for voice range.
disableRadionumberpma-voice-compatible radio availability state.
radioChannelnumberCurrent pma-voice-compatible radio channel.

Set authoritative player state on the server with replication enabled:

resources/[custom]/server/main.lua
Player(source).state:set('hud:deathState', 2, true)
Player(source).state:set('stress', 35, true)
Player(source).state:set('hud:showHud', true, true)

A client-owned vehicle resource can update its local state when appropriate:

resources/[custom]/client/seatbelt.lua
LocalPlayer.state:set('seatbelt', true, true)
LocalPlayer.state:set('cruiseControl', false, true)

Do not write unchanged state every frame. Update only when the value changes.

Vehicle state

DynamicHUD reads these state bags from the current vehicle:

KeyValuePurpose
nitronumberCurrent nitrous level.
nitroFlamesbooleanWhether nitrous is actively firing.
hasNeonstableInstalled neon sides used by Car Control (neonLeft, neonRight, neonFront, and neonBack).
resources/[custom]/client/nitrous.lua
local vehicle = cache.vehicle
if vehicle then
    Entity(vehicle).state:set('nitro', 75, true)
    Entity(vehicle).state:set('nitroFlames', true, true)
end

DynamicHUD checks that the changed vehicle matches the player's current vehicle before updating the speedometer.

Global state

DynamicHUD publishes server population values for its own player-count UI. Other resources may read them without polling GetPlayers():

KeyValuePurpose
GlobalState.currentPlayersnumberCurrent connected player count.
GlobalState.maxPlayersnumbersv_maxclients, initialized when the HUD resource starts.

These values are outputs owned by DynamicHUD. Do not overwrite them from another resource.

Inventory and death handlers

For inventories that publish invOpen, no extra hide/show event is needed. Otherwise, use the server toggleHud export in your inventory's server handlers:

resources/[custom]/server/inventory.lua
AddEventHandler('my_inventory:opened', function(source)
    exports['orbit-dynamichud-v2']:toggleHud(source, false)
end)

AddEventHandler('my_inventory:closed', function(source)
    exports['orbit-dynamichud-v2']:toggleHud(source, true)
end)

For custom medical resources, set hud:deathState rather than calling internal NUI events.

The editable server/handlers.lua file contains starter hooks for common inventory, QB hospital, and ESX death events. Event names and signatures vary between resource versions, so keep only the handlers that match your server and adapt them to the state/export patterns above.

Internal events

Sound synchronization, Settings Share callbacks, car-control status, NUI callbacks, and orbit-dynamichud:client:updateSound are internal implementation details. Do not call them from third-party resources. Their payloads are validated for the owning UI flow and can change without being part of the public API.

On this page