# Orbit Studios Documentation (/docs)
# Orbit Studios Documentation [#orbit-studios-documentation]
Welcome to the official Orbit Studios documentation. These guides cover setup, configuration, and integration notes for Orbit Studios FiveM resources.
## Navigate the documentation [#navigate-the-documentation]
### Choose a resource [#choose-a-resource]
Open a resource from the cards below or expand **Resources** in the left sidebar. Each resource has its own installation, configuration, integration, command, export, and troubleshooting pages where they are relevant.
### Start with installation and dependencies [#start-with-installation-and-dependencies]
Read the resource's **Installation** page first, then open **Dependencies** before changing its configuration. These pages explain the required download, folder name, start order, supported integrations, and first-run checks.
### Follow the page outline [#follow-the-page-outline]
Use the page outline to jump between sections in a longer guide. On smaller screens, open the navigation controls to reach the resource sidebar and page outline.
### Search across every guide [#search-across-every-guide]
Use **Search** in the top navigation to find resource names, configuration keys, commands, exports, or error messages across the entire documentation site.
### Select your framework [#select-your-framework]
Framework-specific instructions are grouped into **ESX**, **QB-Core**, **QBX**, and **Standalone** tabs. Select the tab that matches your server and use the same option throughout the documentation.
### Check file labels before editing [#check-file-labels-before-editing]
Code-block titles show the file path where each example belongs. Read nearby callouts before replacing code, and use the resource's **Troubleshooting** page if the verification steps do not pass.
## Support and webstore [#support-and-webstore]
For product and technical support, join the Orbit Studios Discord first. If Discord is unavailable, email `support@orbitstudios.net` and include the resource name, your framework, relevant console errors, and a short explanation of what you already tried.
Every page is also available through `/llms.txt`, `/llms-full.txt`, and the copyable Markdown link in the page toolbar.
## Resource guides [#resource-guides]
# Commands (/docs/orbit-studios-resources/orbit-craftingsystem/commands)
# Commands [#commands]
Commands are typed in the FiveM chat by a player with permission, or executed from the server console when supported. The crafting system currently exposes one developer command for giving blueprint items during setup and testing.
## Command availability [#command-availability]
`createblueprint` is only available when developer mode is enabled.
```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua"
Config.DeveloperMode = true
```
Turn developer mode back off after setup if you do not want this test command available on production servers.
## Parameters [#parameters]
```text title="FiveM console"
/createblueprint 12 weapon_pistol
/createblueprint 12 weapon_pistol 3
```
The first example gives player ID `12` one blueprint that unlocks `weapon_pistol`. The second example gives the same player three blueprint items.
`blueprintName` must match a key in `Config.Blueprints.items`, not the display label. If you use `Config.CustomBlueprints`, the command still receives the original blueprint content name, such as `weapon_pistol`.
## Permissions and production use [#permissions-and-production-use]
The command is registered as restricted and developer-mode gated. If the chat suggestion appears but nothing happens, check the server console for the developer-mode warning first, then confirm the player running the command has permission to use restricted commands.
`Config.DeveloperMode` can expose setup tooling intended for controlled testing. Set it back to `false`, restart the resource, and verify `/createblueprint` is unavailable before opening a production server.
# Configuration (/docs/orbit-studios-resources/orbit-craftingsystem/configuration)
# Configuration [#configuration]
`orbit-craftingsystem` has two public config files. Use `shared/config.lua` for gameplay and recipes. Use `server/config.lua` for server-only logging, image paths, and Discord webhooks.
Put craftable items, benches, stations, blueprints, XP, and access rules in `shared/config.lua`. Put webhook URLs and logging callbacks in `server/config.lua`.
## File map [#file-map]
## Setup workflow [#setup-workflow]
### Choose where the item belongs [#choose-where-the-item-belongs]
Use a station item when the recipe should be available at a fixed world location. Use a bench non-blueprint item when the recipe should always be available on a portable bench. Use a blueprint item when players must own or install a blueprint first.
### Add the inventory items first [#add-the-inventory-items-first]
Every final item and every required material must exist in your inventory or framework item list before testing. If the inventory does not know `metalscrap`, `steel`, or `weapon_pistol`, the crafting system cannot add or remove them correctly.
### Add one recipe and test it [#add-one-recipe-and-test-it]
Add one recipe to `shared/config.lua`, restart the resource, open the station or bench, and test one craft. After that works, duplicate the same structure for the rest of your recipes.
### Enable logging [#enable-logging]
Add your Discord webhook URL in `server/config.lua`, then keep or customize `Config.Server.OnCraft` and `Config.Server.SuspiciousActivity`.
## Shared config shape [#shared-config-shape]
`shared/config.lua` is read in this order. Keeping the same order makes it much easier to compare your file with the shipped config when you update the resource.
```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua"
Config = Config or {}
Config.DeveloperMode = false
Config.CraftingWithWheel = true
Config.NuiState = function(bool)
if not Config.DeveloperMode then return end
print("NUI Open:", bool)
end
Config.Celebration = {
animDict = "anim@mp_player_intcelebrationmale@air_guitar",
animName = "air_guitar"
}
Config.BenchAnimations = {
putting_down_bench = {
duration = 5000,
animDict = "amb@world_human_hammering@male@base",
anim = "base",
flag = 1
},
moving_bench = {
duration = 1000,
animDict = "amb@world_human_hammering@male@base",
anim = "base",
flag = 1
}
}
Config.LevelValues = {
xpGainMultiplier = 10,
levelUpXPMultiplier = 100,
loseMultiplier = 0.5
}
Config.MainRoutingBucket = 0
Config.Benches = {}
Config.Blueprints = {}
Config.CustomBlueprints = {}
Config.Stations = {}
```
The empty tables above are only an outline. In your real file, `Config.Benches`, `Config.Blueprints`, and `Config.Stations` contain the actual bench types, blueprint recipes, fixed stations, recipes, targets, and access groups.
## Add bench items to inventory [#add-bench-items-to-inventory]
Every key inside `Config.Benches.benchTypes` must also exist as an inventory item. The default config includes `weapon-crafting_bench` and `medical_bench`, so those item names need to be added before players can place those benches.
If the bench type is `["weapon-crafting_bench"]`, the inventory item must also be `weapon-crafting_bench`. Bench item names cannot start with `weapon_` and must include `bench`.
Add the bench item inside your inventory resource. For ESX servers using `ox_inventory`, this is usually `ox_inventory/data/items.lua`.
```lua title="resources/[standalone]/ox_inventory/data/items.lua"
["weapon-crafting_bench"] = {
label = "Weapon Crafting Bench",
weight = 1000,
stack = false,
close = true,
description = "Places a weapon crafting bench."
},
["medical_bench"] = {
label = "Medical Crafting Bench",
weight = 1000,
stack = false,
close = true,
description = "Places a medical crafting bench."
},
```
If your ESX server uses a different inventory, add the same item names using that inventory's item format. The important part is that the item name exactly matches the bench key in `Config.Benches.benchTypes`.
Add the bench item in QBCore's shared item file, not inside the crafting resource.
```lua title="resources/[qb]/qb-core/shared/items.lua"
["weapon-crafting_bench"] = {
name = "weapon-crafting_bench",
label = "Weapon Crafting Bench",
weight = 1000,
type = "item",
image = "weapon-crafting_bench.png",
unique = true,
useable = true,
shouldClose = true,
combinable = nil,
description = "Places a weapon crafting bench."
},
["medical_bench"] = {
name = "medical_bench",
label = "Medical Crafting Bench",
weight = 1000,
type = "item",
image = "medical_bench.png",
unique = true,
useable = true,
shouldClose = true,
combinable = nil,
description = "Places a medical crafting bench."
},
```
`unique = true` is recommended because benches can carry metadata, especially when `Config.Blueprints.store = "bench"`.
Add the bench item inside your inventory resource. For most Qbox/QBX servers this is the inventory item file, for example `ox_inventory/data/items.lua`.
```lua title="resources/[standalone]/ox_inventory/data/items.lua"
["weapon-crafting_bench"] = {
label = "Weapon Crafting Bench",
weight = 1000,
stack = false,
close = true,
description = "Places a weapon crafting bench."
},
["medical_bench"] = {
label = "Medical Crafting Bench",
weight = 1000,
stack = false,
close = true,
description = "Places a medical crafting bench."
},
```
If you rename or add a bench type in `Config.Benches.benchTypes`, add the same item name here too.
The crafting system registers each bench type as a usable item through `orbit-lib`. That means players use the inventory item, the resource previews the bench prop, and then the bench is placed if the player confirms the position.
## Where to add items [#where-to-add-items]
Craftable items can live in three places. The recipe shape is mostly the same, but the location decides how the player accesses it.
Put fixed-location recipes inside `Config.Stations[stationId].items`.
```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua"
Config.Stations = {
HideStationDistance = 50,
["weapon_station"] = {
title = "Weapon Crafting Station",
secondaryTitle = "Orbit Studios",
blip = {
haveBlip = true,
sprite = 110,
color = 1,
scale = 0.8,
coords = vector3(502.64, -1338.17, 29.31)
},
target = {
type = "npc",
model = "s_m_m_ammucountry",
coords = vector3(502.64, -1338.17, 29.31),
heading = 37.18
},
groups = {
jobs = {},
gangs = {}
},
items = {
["weapon_pistol"] = {
type = "weapon",
itemLevel = 1,
baseOdds = 50,
maxOdds = 90,
amountToCraft = 1,
requirements = {
{ item = "plastic", amount = 5, removeOnSuccess = true, removeOnFail = true },
{ item = "iron", amount = 5, removeOnSuccess = true, removeOnFail = false }
}
}
}
}
}
```
Leave `groups.jobs` and `groups.gangs` empty for a public station. Add job or gang names only when the station should be restricted.
Put bench recipes that do not need blueprints inside `Config.Benches.benchTypes[benchItemName].nonBlueprintItems`.
```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua"
Config.Benches = {
onlyOwnerCanMove = true,
enableBenches = true,
enablePersistentBenches = true,
HideBenchDistance = 50,
benchTypes = {
["weapon-crafting_bench"] = {
benchProp = "prop_tool_bench02",
benchLabel = "Weapon Bench",
title = "Weapon Crafting Bench",
secondaryTitle = "Orbit Studios",
nonBlueprintItems = {
["weapon_knife"] = {
type = "weapon",
itemLevel = 1,
baseOdds = 50,
maxOdds = 90,
amountToCraft = 1,
requirements = {
{ item = "metalscrap", amount = 10, removeOnSuccess = true, removeOnFail = true },
{ item = "steel", amount = 5, removeOnSuccess = true, removeOnFail = false }
}
}
}
}
}
}
```
The bench type key, such as `weapon-crafting_bench`, must match the bench inventory item name. Bench item names cannot start with `weapon_` and must include `bench`.
Put blueprint-locked recipes inside `Config.Blueprints.items`.
```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua"
Config.Blueprints = {
store = "bench",
items = {
["weapon_pistol"] = {
bench = "weapon-crafting_bench",
type = "weapon",
itemLevel = 1,
baseOdds = 60,
maxOdds = 90,
amountToCraft = 1,
requirements = {
{ item = "metalscrap", amount = 10, removeOnSuccess = true, removeOnFail = true },
{ item = "steel", amount = 5, removeOnSuccess = true, removeOnFail = false }
}
}
}
}
```
`store = "bench"` stores learned blueprints on the bench. `store = "player"` stores learned blueprints on the player. The `bench` value must match a key in `Config.Benches.benchTypes`.
Use `Config.CustomBlueprints` when the physical inventory item has a different name from the recipe key.
```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua"
Config.Blueprints = {
store = "bench",
items = {
["weapon_pistol"] = {
bench = "weapon-crafting_bench",
type = "weapon",
itemLevel = 1,
baseOdds = 60,
maxOdds = 90,
requirements = {
{ item = "metalscrap", amount = 10, removeOnSuccess = true, removeOnFail = true }
}
}
}
}
Config.CustomBlueprints = {
["weapon_pistol"] = {
customBlueprintName = "blueprint_weapon_pistol"
}
}
```
In this example, the blueprint content is still `weapon_pistol`, but the inventory item given to the player is `blueprint_weapon_pistol`.
## Recipe fields [#recipe-fields]
Every recipe uses the same core fields whether it is placed in a station, bench, or blueprint list.
```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua"
["firstaid"] = {
itemLevel = 2,
baseOdds = 40,
maxOdds = 90,
amountToCraft = 2,
requirements = {
{ item = "bandage", amount = 5, removeOnSuccess = true, removeOnFail = true },
{ item = "painkillers", amount = 2, removeOnSuccess = true, removeOnFail = true }
}
}
```
Set `removeOnSuccess` and `removeOnFail` explicitly for each requirement while learning the config. That makes it obvious whether materials disappear on a successful craft, a failed craft, or both.
## Core shared options [#core-shared-options]
### Crafting wheel [#crafting-wheel]
`Config.CraftingWithWheel` decides how strict the crafting level system is.
```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua"
Config.CraftingWithWheel = true
```
When this is `true`, players use the success-percentage crafting wheel. `itemLevel`, `baseOdds`, and `maxOdds` decide how difficult the craft is and how much the chance can improve.
When this is `false`, crafting becomes level-gated. Players can craft items at their level or below their level, and the percentage wheel is not used.
### NUI state callback [#nui-state-callback]
`Config.NuiState` runs whenever the crafting UI opens or closes. Use it when another resource needs to know that the player is inside the crafting interface.
```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua"
Config.NuiState = function(bool)
if not Config.DeveloperMode then return end
print("NUI Open:", bool)
end
```
`bool = true` means the UI opened. `bool = false` means it closed.
Set it to `nil` if you do not need this callback:
```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua"
Config.NuiState = nil
```
### Celebration animation [#celebration-animation]
`Config.Celebration` is the animation played after a successful craft.
```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua"
Config.Celebration = {
animDict = "anim@mp_player_intcelebrationmale@air_guitar",
animName = "air_guitar"
}
```
To change the animation, replace both values with a valid GTA animation dictionary and animation name. To disable the celebration, set both values to `nil`.
```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua"
Config.Celebration = {
animDict = nil,
animName = nil
}
```
### Bench animations [#bench-animations]
`Config.BenchAnimations` is used by the `orbit-lib` progress integration when a player places or moves a bench.
```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua"
Config.BenchAnimations = {
putting_down_bench = {
duration = 5000,
animDict = "amb@world_human_hammering@male@base",
anim = "base",
flag = 1
},
moving_bench = {
duration = 1000,
animDict = "amb@world_human_hammering@male@base",
anim = "base",
flag = 1
}
}
```
`duration` is in milliseconds. `animDict`, `anim`, and `flag` are passed to the progress animation. If you make the duration very short, bench placement will feel instant and players may not understand that the bench is being placed.
### Level values [#level-values]
```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua"
Config.LevelValues = {
xpGainMultiplier = 10,
levelUpXPMultiplier = 100,
loseMultiplier = 0.5
}
```
`loseMultiplier = 0.5` means a failed craft gives half of the XP the craft would normally give.
## Bench placement [#bench-placement]
Bench placement controls where portable benches can be placed.
Blacklist mode allows bench placement everywhere except inside listed zones.
```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua"
Config.Benches.benchPlacement = {
enabled = true,
mode = "blacklist",
zones = {
{
vectors = {
vector3(494.22, -1328.00, 29.00),
vector3(494.70, -1333.96, 29.00),
vector3(500.11, -1335.09, 29.00)
},
height = 10
}
}
}
```
Whitelist mode blocks bench placement everywhere except inside listed zones.
```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua"
Config.Benches.benchPlacement = {
enabled = true,
mode = "whitelist",
zones = {
{
vectors = {
vector3(493.93, -1335.25, 29.00)
},
radius = 5.0
}
}
}
```
Use `vectors` plus `height` for polygon zones. Use `vectors` plus `radius` for sphere zones. Use `vectors` plus `size = vec3(...)` for box zones.
```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua"
{
vectors = {
vector3(493.93, -1335.25, 29.00)
},
size = vec3(2, 2, 2)
}
```
## Station access [#station-access]
Access groups live inside each station. Leave both tables empty for public use.
```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua"
groups = {
jobs = {},
gangs = {}
}
```
Restrict by job or gang name with a minimum grade:
```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua"
groups = {
jobs = {
["police"] = 0,
["ambulance"] = 2
},
gangs = {
["lostmc"] = 1
}
}
```
`["ambulance"] = 2` means the player must have the ambulance job at grade 2 or higher. Job and gang names must match the data returned by your framework through `orbit-lib`.
## Server config [#server-config]
`resources/[orbit]/orbit-craftingsystem/server/config.lua` is server-only. This is where inventory image URLs, Discord webhooks, and logging callbacks live.
## Inventory image URLs [#inventory-image-urls]
Use `Config.Server.CustomImageURL` when item images are missing in the crafting UI.
```lua title="resources/[orbit]/orbit-craftingsystem/server/config.lua"
Config.Server.CustomImageURL = false
```
For `ox_inventory`, this is a common value:
```lua title="resources/[orbit]/orbit-craftingsystem/server/config.lua"
Config.Server.CustomImageURL = "cfx-nui-ox_inventory/web/images/"
```
The image file name should match the inventory item name. For example, `weapon_pistol` normally needs an image named like `weapon_pistol.png` in the configured image directory.
## Webhooks [#webhooks]
Add your Discord webhook URL in `server/config.lua`. Do not put webhook URLs in `shared/config.lua`, because shared files can be loaded client-side.
```lua title="resources/[orbit]/orbit-craftingsystem/server/config.lua"
Config.Server.Webhook = {
url = "https://discord.com/api/webhooks/...",
username = nil,
avatar = nil
}
```
Use `username` and `avatar` only if you want to override the Discord webhook defaults:
```lua title="resources/[orbit]/orbit-craftingsystem/server/config.lua"
Config.Server.Webhook = {
url = "https://discord.com/api/webhooks/...",
username = "Orbit Crafting Logs",
avatar = "https://example.com/logo.png"
}
```
The included sender uses Discord embeds:
```lua title="resources/[orbit]/orbit-craftingsystem/server/config.lua"
function Config.Server.SendWebhook(embed)
local webhook = Config.Server.Webhook
if not webhook.url or webhook.url == "" then return end
PerformHttpRequest(
webhook.url,
function() end,
"POST",
json.encode({
username = webhook.username,
avatar_url = webhook.avatar,
embeds = { embed }
}),
{ ["Content-Type"] = "application/json" }
)
end
```
## Crafting log webhook [#crafting-log-webhook]
`Config.Server.OnCraft` runs after a valid crafting attempt. It receives the player, station or bench ID, item name, crafted amount, item level, and whether the craft succeeded.
```lua title="resources/[orbit]/orbit-craftingsystem/server/config.lua"
Config.Server.Colors = {
success = "#2ecc71",
failed = "#e74c3c",
suspicious = "#ff0000"
}
local function HexToDecimal(hex)
return tonumber(hex:gsub("#", ""), 16)
end
Config.Server.OnCraft = function(source, stationId, itemName, craftedAmount, itemLevel, isWin)
local playerName = GetPlayerName(source) or "Unknown"
local playerId = source
local embed = {
title = isWin and "Crafting Successful" or "Crafting Failed",
description = isWin and "The player successfully crafted an item." or "The crafting attempt failed.",
color = HexToDecimal(isWin and Config.Server.Colors.success or Config.Server.Colors.failed),
author = {
name = playerName .. " (" .. playerId .. ")"
},
fields = {
{
name = "Station or Bench",
value = tostring(stationId),
inline = false
},
{
name = "Item",
value = tostring(itemName),
inline = true
},
{
name = "Amount",
value = tostring(craftedAmount),
inline = true
},
{
name = "Item Level",
value = tostring(itemLevel),
inline = true
}
},
footer = {
text = "Orbit Crafting System"
},
timestamp = os.date("!%Y-%m-%dT%H:%M:%SZ")
}
Config.Server.SendWebhook(embed)
end
```
Set `Config.Server.OnCraft = nil` if you want to disable normal crafting logs entirely:
```lua title="resources/[orbit]/orbit-craftingsystem/server/config.lua"
Config.Server.OnCraft = nil
```
## Suspicious activity webhook [#suspicious-activity-webhook]
`Config.Server.SuspiciousActivity` runs when the server detects an invalid crafting attempt. This is useful for exploit attempts, invalid items, missing requirements, or other rejected craft requests.
```lua title="resources/[orbit]/orbit-craftingsystem/server/config.lua"
Config.Server.SuspiciousActivity = function(source, stationId, itemName, craftedAmount, reason, isWin)
local playerName = GetPlayerName(source) or "Unknown"
local playerId = source
local embed = {
title = "Suspicious Crafting Activity",
description = "Potential exploit or invalid crafting attempt detected.",
color = HexToDecimal(Config.Server.Colors.suspicious),
author = {
name = playerName .. " (" .. playerId .. ")"
},
fields = {
{
name = "Station or Bench",
value = tostring(stationId),
inline = false
},
{
name = "Item",
value = tostring(itemName),
inline = true
},
{
name = "Attempted Amount",
value = tostring(craftedAmount),
inline = true
},
{
name = "Reason",
value = tostring(reason),
inline = false
}
},
footer = {
text = "Orbit Crafting System - monitor recommended"
},
timestamp = os.date("!%Y-%m-%dT%H:%M:%SZ")
}
Config.Server.SendWebhook(embed)
end
```
Set `Config.Server.SuspiciousActivity = nil` if you want to disable suspicious activity logs:
```lua title="resources/[orbit]/orbit-craftingsystem/server/config.lua"
Config.Server.SuspiciousActivity = nil
```
## Webhook testing [#webhook-testing]
### Add the webhook URL [#add-the-webhook-url]
Paste the Discord webhook URL into `Config.Server.Webhook.url` in `server/config.lua`.
### Keep `OnCraft` enabled [#keep-oncraft-enabled]
Make sure `Config.Server.OnCraft` is a function, not `nil`.
### Craft one test item [#craft-one-test-item]
Join the server, open a station or bench, and craft an item. Discord should receive a success or failure embed.
### Check the server console [#check-the-server-console]
If no message arrives, confirm the URL is not empty, outbound HTTP is allowed, and the config file is saved on the server.
## Apply and verify [#apply-and-verify]
1. Save both config files and validate their Lua syntax.
2. Restart Orbit Crafting System so shared recipes, target interactions, item data, and server hooks reload together.
3. Test one unrestricted station recipe before testing jobs, gangs, levels, blueprints, or placed benches.
4. Confirm every requirement and reward exists in the selected inventory and has a loadable image.
5. Test success and failure paths, including material removal, XP, celebration, progress, and NUI callbacks.
6. Place one bench and use one blueprint through the framework/inventory setup selected in Orbit Lib.
7. Send one craft and one suspicious-activity log before relying on the webhook in production.
## Common mistakes [#common-mistakes]
Make sure the recipe is inside the correct table: `Config.Stations[stationId].items`, `Config.Benches.benchTypes[benchName].nonBlueprintItems`, or `Config.Blueprints.items`. Also confirm the player has access to the station or bench.
Confirm the final item and every requirement item exists in your inventory or framework item list. Also check `removeOnSuccess` and `removeOnFail` so required materials are handled the way you expect.
Put the URL in `Config.Server.Webhook.url`, keep `Config.Server.OnCraft` or `Config.Server.SuspiciousActivity` enabled, and make sure the webhook URL is valid. Webhook code belongs in `server/config.lua`, not `shared/config.lua`.
Job and gang names must match the values returned by your framework through `orbit-lib`. Remove access groups temporarily to confirm the station itself works, then add restrictions back one at a time.
# Dependencies (/docs/orbit-studios-resources/orbit-craftingsystem/dependencies)
# Dependencies [#dependencies]
Orbit Crafting System needs its database, library, inventory, target, framework bridge, and selected interface providers available before players begin crafting.
## Required [#required]
| Dependency | Why it is needed | Link |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| `ox_lib` | Loads `@ox_lib/init.lua`, locales, callbacks, UI helpers, notifications, and target helper utilities used by the resource. | [overextended/ox\_lib](https://github.com/overextended/ox_lib) |
| `oxmysql` | Loads `@oxmysql/lib/MySQL.lua` and stores persistent crafting data such as progression and bench data. | [overextended/oxmysql](https://github.com/overextended/oxmysql) |
| `orbit-lib` | Provides the framework, inventory, target, notification, progress, player, item, and metadata bridge used by Orbit resources. | [orbit-lib](/docs/orbit-studios-resources/orbit-lib) |
| Supported inventory | Required for checking materials, removing requirements, giving crafted items, blueprint metadata, and bench items. | [Supported inventories](/docs/orbit-studios-resources/orbit-lib/configuration#inventories) |
| Supported target | Required for station and bench interactions. Use `ox_target` or `qb-target` through `orbit-lib`. | [ox\_target](https://github.com/overextended/ox_target), [qb-target](https://github.com/qbcore-framework/qb-target) |
## Supported inventories [#supported-inventories]
The inventory is selected in `orbit-lib`, not inside the crafting resource.
| `Config.Inventory` | Inventory |
| ------------------ | --------------------------------------------------------------------------------- |
| `ox_inventory` | [overextended/ox\_inventory](https://github.com/overextended/ox_inventory) |
| `qb-inventory` | [qbcore-framework/qb-inventory](https://github.com/qbcore-framework/qb-inventory) |
| `ps-inventory` | [Project-Sloth/ps-inventory](https://github.com/Project-Sloth/ps-inventory) |
| `lj-inventory` | [loljoshie/lj-inventory](https://github.com/loljoshie/lj-inventory) |
| `qb-like` | Custom QB-style inventory exports |
| `ox-like` | Custom OX-style inventory exports |
## Optional integrations [#optional-integrations]
| Integration | What it adds | Link |
| --------------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| `orbit-dynamichud-v2` | Can provide notifications, progress bars, Text UI, and skill checks selected through Orbit Lib. | [Interface APIs](/docs/orbit-studios-resources/orbit-dynamichud-v2/interface) |
| Discord webhook | Craft result and suspicious-activity logs configured only in `server/config.lua`. | [Webhooks](/docs/orbit-studios-resources/orbit-craftingsystem/configuration#webhooks) |
## Start order [#start-order]
```properties title="server.cfg"
ensure oxmysql
ensure ox_lib
ensure [framework-resources]
ensure [inventory]
ensure [target]
ensure orbit-lib
ensure orbit-craftingsystem
```
If the crafting UI opens but materials or rewards fail, check the inventory provider in `orbit-lib` first. If stations or benches do not show, check the target provider and start order.
## Feature failure behavior [#feature-failure-behavior]
* Missing `ox_lib` or `oxmysql` prevents required runtime, callback, locale, or persistence behavior.
* A missing or mismatched inventory can leave materials unreadable, prevent removal, or block crafted rewards and bench items.
* A missing or mismatched target prevents station and placed-bench interactions from appearing.
* Incorrect Orbit Lib framework data breaks job, gang, player, and usable-item behavior even if the crafting UI loads.
* A missing selected notification, progress, Text UI, or skill-check provider affects only the interface call until that provider is corrected.
* An empty or invalid webhook URL disables external logging but should not be treated as a replacement for server-side validation.
# Exports (/docs/orbit-studios-resources/orbit-craftingsystem/exports)
# Exports [#exports]
Use server exports from another server script and client exports from another client script. Calling a client export from server code, or a server export from client code, will not work.
Call exports through the exact resource name `orbit-craftingsystem`. Renaming the folder breaks the examples and can invalidate dependencies or escrow expectations.
## Server examples [#server-examples]
```lua title="resources/[custom]/server/main.lua"
local source = source
local created = exports['orbit-craftingsystem']:CreateBlueprint(source, 'weapon_pistol', 1)
if not created then
print('[my-resource] Blueprint could not be created')
end
```
```lua title="resources/[custom]/server/main.lua"
local level, xp = exports['orbit-craftingsystem']:getPlayerLevel(source)
print(('Player level: %s, XP: %s'):format(level, xp))
```
```lua title="resources/[custom]/server/main.lua"
local itemData = exports['orbit-craftingsystem']:getItemData(true, 'weapon_station', 'weapon_pistol', false)
if itemData then
print(('Base odds: %s'):format(itemData.baseOdds))
end
```
## Client examples [#client-examples]
```lua title="resources/[custom]/client/main.lua"
exports['orbit-craftingsystem']:previewProp('weapon-crafting_bench', 'prop_tool_bench02', nil, nil)
```
```lua title="resources/[custom]/client/main.lua"
exports['orbit-craftingsystem']:checkNearbyBenches('weapon_pistol', nil, nil)
```
The client helpers are mainly useful for advanced integrations. For normal setup, let the included bench item and blueprint item handlers call them automatically.
## Integration checklist [#integration-checklist]
1. Call the export from the correct client or server context.
2. Start Orbit Crafting System before the custom resource that calls it.
3. Validate player IDs, item names, blueprint names, metadata, and amounts before passing them.
4. Handle `false`, `nil`, or missing item data instead of assuming every call succeeds.
5. Keep normal bench and blueprint behavior on the included handlers unless the custom integration genuinely needs direct control.
# Installation (/docs/orbit-studios-resources/orbit-craftingsystem)
# Orbit Crafting System [#orbit-crafting-system]
Orbit Crafting System is a configurable FiveM crafting resource for fixed stations, portable benches, blueprints, crafting levels, XP, access rules, and optional crafting minigame odds.
For the official preview, showcase video, and store listing, start with the [Introduction](/docs/orbit-studios-resources/orbit-craftingsystem/introduction).
Install and use this resource only when it was obtained for your account through the official Cfx.re Portal. Support requires both the matching Cfx.re Portal entitlement and the original Tebex purchase ID; a Portal entitlement by itself is not sufficient proof of purchase. Copies from Discord, leaked packs, file-sharing sites, source repositories, or another customer are unauthorized and unsupported.
## Installation [#installation]
1. Download the current release from the Cfx.re Portal account that owns the license.
2. Stop the server and extract the folder as `orbit-craftingsystem` without an extra nested directory.
3. Install `ox_lib`, `oxmysql`, the included Orbit Lib, a supported inventory, and a supported target resource.
4. Configure Orbit Lib for ESX, QB-Core, QBX, or standalone mode before configuring crafting.
5. Add every final item, material, bench item, and blueprint item to the selected inventory or framework item list.
6. Edit `shared/config.lua` for gameplay and `server/config.lua` for image paths, webhooks, and server hooks.
7. Start the resources in dependency order, then test one unrestricted station before adding all recipes.
```properties title="server.cfg"
ensure oxmysql
ensure ox_lib
ensure [framework-resources]
ensure [inventory]
ensure [target]
ensure orbit-lib
ensure orbit-craftingsystem
```
## Resource structure [#resource-structure]
Use `shared/config.lua` for craftable items, benches, stations, blueprint requirements, levels, XP, animations, access rules, and NUI behavior. Use `server/config.lua` for inventory image URLs, Discord webhooks, and server-side crafting or suspicious-activity hooks. Runtime files are shown so you can verify that the release extracted correctly; edit only documented public files.
## Framework setup [#framework-setup]
Configure ESX in Orbit Lib. Add normal and bench items to the inventory or ESX item store used by your server. Job access names and grades must match ESX data.
Configure QB-Core in Orbit Lib. Add item definitions, including bench items, to `qb-core/shared/items.lua`, then add their images to the selected inventory. Job and gang names must match QBCore data.
Configure QBX in Orbit Lib. Add items and bench items through the selected inventory, commonly `ox_inventory/data/items.lua`. Job and gang access uses normalized QBX data.
Configure standalone player, job, gang, and usable-item adapters in Orbit Lib. Crafting can run without a framework, but every restricted feature depends on the normalized data those adapters return.
## First-run verification [#first-run-verification]
1. Confirm the database, library, framework, inventory, target, and Orbit Lib start without errors.
2. Open one station with job and gang restrictions temporarily removed.
3. Verify every displayed recipe has a clear label and non-missing inventory image.
4. Craft one successful and one failed attempt and confirm material removal follows the configured rules.
5. Place and reopen one bench item, then test one blueprint-gated recipe.
6. Verify crafting level and XP changes persist after reconnecting.
7. Test the configured notification, progress, NUI state, celebration, and bench animations.
8. Send one test craft log and confirm webhook URLs remain only in `server/config.lua`.
## Related Orbit resources [#related-orbit-resources]
* [Orbit Lib](/docs/orbit-studios-resources/orbit-lib) is required for framework, inventory, target, notification, and progress bridges.
* [Orbit Dynamic HUD 2.0](/docs/orbit-studios-resources/orbit-dynamichud-v2) can provide notifications, progress bars, Text UI, and skill checks selected through Orbit Lib.
## Support [#support]
When requesting support, include the client/server console error, framework, inventory and target names, relevant config section, one affected recipe or bench, reproduction steps, the matching Cfx.re Portal entitlement, and the original Tebex purchase ID. Both purchase records are required. Never post the complete paid resource or webhook credentials publicly.
# Introduction (/docs/orbit-studios-resources/orbit-craftingsystem/introduction)
# Orbit Crafting System [#orbit-crafting-system]
Orbit Crafting System lets a FiveM server offer fixed crafting stations and portable benches. You can configure recipes, required materials, blueprints, progression, access rules, and how workstations are placed and used.
## Video showcase [#video-showcase]
## What it includes [#what-it-includes]
* Fixed stations and persistent portable crafting benches.
* Recipes with materials, blueprint requirements, crafting levels, and XP.
* Job, gang, zone, and routing-bucket access controls.
* Configurable crafting animations, minigame odds, and notifications.
* Inventory integrations, webhook logging, and locale support.
## Get started [#get-started]
# Language Support (/docs/orbit-studios-resources/orbit-craftingsystem/language-support)
# Language Support [#language-support]
Orbit Crafting System uses the ox\_lib locale system. The active locale supplies crafting UI text, target labels, errors, progress messages, command text, and server notifications.
## Included Locales [#included-locales]
| Language | Locale | File |
| -------- | ------ | ----------------- |
| English | `en` | `locales/en.json` |
| German | `de` | `locales/de.json` |
| Spanish | `es` | `locales/es.json` |
| French | `fr` | `locales/fr.json` |
| Italian | `it` | `locales/it.json` |
| Swedish | `sv` | `locales/sv.json` |
| Turkish | `tr` | `locales/tr.json` |
## Select A Locale [#select-a-locale]
Set the replicated ox\_lib locale before starting the resource.
```properties title="server.cfg"
setr ox:locale en
ensure ox_lib
ensure orbit-lib
ensure orbit-craftingsystem
```
For Swedish, use `setr ox:locale sv`. Restart Orbit Crafting System after changing the convar or a locale file.
## Customize Existing Text [#customize-existing-text]
Edit values in the active JSON file while preserving its keys, nesting, placeholders, and value types.
```json title="resources/[orbit]/orbit-craftingsystem/locales/en.json"
{
"example_key": "Example text"
}
```
Keep JSON valid: use double quotes, place commas between entries, and do not add a trailing comma after the final entry.
Do not delete untranslated or apparently unused keys. Copy the complete English structure when adding a language so UI, command, target, and server paths can resolve every value.
## Add A Language [#add-a-language]
1. Copy `locales/en.json` to a new file such as `locales/pt.json`.
2. Translate values only; preserve every key and nested object.
3. Keep interpolation placeholders such as `%s`, `{name}`, or `{value}` unchanged when present.
4. Validate the file as JSON.
5. Set `setr ox:locale pt` and restart Orbit Crafting System.
6. Test station, bench, blueprint, progress, success, failure, and command text.
If a key is missing, ox\_lib may fall back or expose the unresolved key depending on the call path. Keeping locale files structurally aligned prevents mixed-language crafting flows.
# Troubleshooting (/docs/orbit-studios-resources/orbit-craftingsystem/troubleshooting)
# Troubleshooting [#troubleshooting]
Start with the client F8 console and server console. Resolve the first dependency, Lua, database, inventory, or target error before debugging later UI behavior.
Confirm `orbit-lib`, `ox_lib`, the target resource, inventory, and `oxmysql` start before `orbit-craftingsystem`. Then test one station with no job or gang restriction. If that opens, the problem is likely station access rules instead of the UI itself.
Set `Config.Server.CustomImageURL` in `server/config.lua` when your inventory image directory differs from the default inventory image path. Use a path that the NUI can load, such as `cfx-nui-ox_inventory/web/images/`, and make sure the image filename matches the item name.
Check `HideStationDistance`, `HideBenchDistance`, target model, coords, heading, routing bucket, and access groups. Start by standing very close to the configured coords. If the target appears only after removing `groups.jobs` or `groups.gangs`, the access rule names or grades do not match your framework data.
Enable `Config.DeveloperMode = true` in `shared/config.lua`. The command is disabled when developer mode is off. The second parameter must be a key from `Config.Blueprints.items`, for example `weapon_pistol`, not the label shown to players.
Confirm the bench item exists in the selected framework/inventory item list and that its item name exactly matches the configured bench name. QB-Core definitions belong in `qb-core/shared/items.lua`; QBX and ESX setups normally define the item through their selected inventory. Then check placement blacklist/whitelist zones, model name, ground collision, metadata, and nearby-bench limits.
Confirm the blueprint content name matches a key in `Config.Blueprints.items`. If `Config.CustomBlueprints` changes the physical item name, keep the stored blueprint content name and custom item mapping consistent. Verify metadata survives when the inventory gives, moves, and uses the blueprint item.
Keep the webhook URL in `server/config.lua`, verify `Config.Server.OnCraft` or `Config.Server.SuspiciousActivity` is still a function, and test a real craft after restarting the resource. Check the server console for invalid URLs or outbound HTTP errors. Never place webhook credentials in shared config or client code.
Use [Dependencies](/docs/orbit-studios-resources/orbit-craftingsystem/dependencies) for startup failures, [Configuration](/docs/orbit-studios-resources/orbit-craftingsystem/configuration) for recipe and webhook structure, and [Commands](/docs/orbit-studios-resources/orbit-craftingsystem/commands) or [Exports](/docs/orbit-studios-resources/orbit-craftingsystem/exports) for callable integrations.
# Configuration (/docs/orbit-studios-resources/orbit-dynamichud-stress/configuration)
# Configuration [#configuration]
All public stress behavior lives in `resources/[orbit]/orbit-dynamichud-stress/config.lua`.
Stress is stored from `0` to `100`. The client can add stress from speeding and weapon usage, while server events can add or remove stress from other integrations.
Avoid running multiple resources that independently gain, relieve, or overwrite the same `stress` state. Integrate other gameplay through the documented events or replicated state value.
## File map [#file-map]
## Core settings [#core-settings]
```lua title="resources/[orbit]/orbit-dynamichud-stress/config.lua"
Config.Stress.stressSpeedFormat = 'kmh'
Config.Stress.minForSpeeding = 1000
Config.Stress.minForSpeedingUnbuckled = 50
```
`stressSpeedFormat` decides whether the thresholds are read as KMH or MPH. `minForSpeeding` is used while the player is buckled, and `minForSpeedingUnbuckled` is used while unbuckled. The default buckled value is very high, which effectively makes normal buckled speeding much less likely to add stress.
```lua title="resources/[orbit]/orbit-dynamichud-stress/config.lua"
Config.Stress.chance = 0.1
Config.Stress.whitelistedWeapons = {
'weapon_petrolcan',
'weapon_hazardcan',
'weapon_fireextinguisher',
}
```
`chance` is a decimal chance from `0` to `1`. For example, `0.1` means a 10 percent chance per eligible shot. Weapons in `whitelistedWeapons` never add weapon stress.
```lua title="resources/[orbit]/orbit-dynamichud-stress/config.lua"
Config.Stress.minForShaking = 50
Config.Stress.blurIntensity = {
[1] = { min = 50, max = 60, intensity = 1500 },
[2] = { min = 60, max = 70, intensity = 2000 },
[3] = { min = 70, max = 80, intensity = 2500 },
[4] = { min = 80, max = 90, intensity = 2700 },
[5] = { min = 90, max = 100, intensity = 3000 },
}
```
`minForShaking` is the first stress value where effects can run. Each `blurIntensity` range controls how strong blur can be for that stress band. Each matching `effectInterval` range controls how often the effect can repeat.
```lua title="resources/[orbit]/orbit-dynamichud-stress/config.lua"
Config.Stress.whitelistedJobs = {
'police'
}
```
Whitelisted jobs skip server-side stress gain from `hud:server:GainStress`. They can still have their state changed directly by custom code that writes to `Player(source).state.stress`.
## Framework setup [#framework-setup]
Whitelisted jobs should match the ESX job names returned by `orbit-lib`.
Whitelisted jobs should match `PlayerData.job.name`.
The stress logic is adapted from the QBX HUD stress system and keeps the same state-bag style integration.
Whitelisted jobs are based on the job data returned by `Config.Standalone.fetchJob` in `orbit-lib`, or the `Config.Standalone.defaultJob` fallback.
## Apply and verify [#apply-and-verify]
1. Save `config.lua` and restart the stress resource.
2. Confirm the local replicated stress state initializes between `0` and `100`.
3. Test speeding once buckled and once unbuckled with the configured speed unit.
4. Test one eligible and one whitelisted weapon.
5. Test `hud:server:GainStress` as both a whitelisted and non-whitelisted job.
6. Move through each effect range and tune one blur or interval band at a time.
7. Test relief through the documented event or one configured usable item.
# Dependencies (/docs/orbit-studios-resources/orbit-dynamichud-stress/dependencies)
# Dependencies [#dependencies]
`orbit-dynamichud-stress` manages the replicated stress state used by DynamicHUD 2.0. Source and releases are available on [GitHub](https://github.com/orbitstudiossoftware/orbit-dynamichud-stress).
## Required [#required]
| Dependency | Why it is needed | Link |
| --------------------- | --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| `ox_lib` | Loads `@ox_lib/init.lua` and cache helpers used by the client-side stress logic. | [overextended/ox\_lib](https://github.com/overextended/ox_lib) |
| `orbit-lib` | Provides normalized player/job data so whitelisted jobs and framework data work consistently. | [orbit-lib](/docs/orbit-studios-resources/orbit-lib) |
| `orbit-dynamichud-v2` | Displays the stress value and reacts to the replicated `stress` state. | [orbit-dynamichud-v2](/docs/orbit-studios-resources/orbit-dynamichud-v2) |
## Optional integrations [#optional-integrations]
| Dependency | What it adds | Link |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `orbit-dynamichud-addons` | Provides `LocalPlayer.state.seatbelt`, which the stress resource uses to choose buckled or unbuckled speeding thresholds. | [Docs](/docs/orbit-studios-resources/orbit-dynamichud-addons) / [GitHub](https://github.com/orbitstudiossoftware/orbit-dynamichud-addons) |
| Inventory usable items | Lets consumable items reduce stress through the stress relief item examples. | [Stress relief items](/docs/orbit-studios-resources/orbit-dynamichud-stress/stress-relief-items) |
## Start order [#start-order]
```properties title="server.cfg"
ensure ox_lib
ensure [framework-resources]
ensure orbit-lib
ensure orbit-dynamichud-v2
ensure orbit-dynamichud-addons
ensure orbit-dynamichud-stress
```
`orbit-dynamichud-addons` is optional, but without a seatbelt state provider the stress resource cannot know whether the player is buckled.
## Feature failure behavior [#feature-failure-behavior]
* Missing ox\_lib prevents the client cache and shared runtime helpers from initializing.
* Missing Orbit Lib prevents normalized player/job checks, including the configured job whitelist, from working correctly.
* Missing DynamicHUD 2.0 leaves the stress state without its tailored HUD display, even when the state still changes.
* Missing seatbelt state makes speeding logic use the unbuckled path because it cannot confirm that the player is buckled.
* Missing usable-item integration does not break base stress gain or effects; it only removes that relief method.
# Events (/docs/orbit-studios-resources/orbit-dynamichud-stress/events)
# Events [#events]
Stress is stored as a replicated state bag value from 0 to 100.
Use the server events when you want the stress resource to handle clamping and whitelist checks. Read the state bag when you only need to display or react to the current value.
Prefer server events or a server-side player-state write for gameplay changes. A client should request a change rather than treating a local-only assignment as authoritative.
```lua title="resources/[custom]/client/main.lua"
local stress = LocalPlayer.state.stress or 0
```
```lua title="resources/[custom]/server/main.lua"
local src = source
local stress = Player(src)?.state?.stress or 0
Player(src)?.state:set("stress", 25, true)
```
## Client integration [#client-integration]
```lua title="resources/[custom]/client/main.lua"
TriggerServerEvent('hud:server:GainStress', 10)
TriggerServerEvent('hud:server:RelieveStress', 15)
```
Use client triggers for gameplay actions that happen locally, such as a minigame failure, consuming an item, or a custom vehicle script detecting stressful behavior.
## Server-side admin or script integration [#server-side-admin-or-script-integration]
```lua title="resources/[custom]/server/main.lua"
local src = 12
local stress = math.max(0, math.min(100, 25))
Player(src)?.state:set("stress", stress, true)
```
Use direct state writes when server code already knows the target player ID, such as an admin command or another server-only system. Clamp the value yourself so it stays between `0` and `100`.
`hud:server:GainStress` clamps at `100`. `hud:server:RelieveStress` clamps at `0`. `hud:server:GainStress` also checks `Config.Stress.whitelistedJobs`.
## Integration checklist [#integration-checklist]
1. Validate and clamp externally calculated values to `0-100`.
2. Use `hud:server:GainStress` when the configured job whitelist should apply.
3. Use `hud:server:RelieveStress` for normal relief so the addon owns the resulting state.
4. Use direct replicated state writes only when server code intentionally bypasses normal gain/relief policy.
5. Avoid triggering an event and writing the resulting state for the same action, which applies the change twice.
# Installation (/docs/orbit-studios-resources/orbit-dynamichud-stress)
# Orbit DynamicHUD Stress [#orbit-dynamichud-stress]
Orbit DynamicHUD Stress manages the replicated stress value displayed by DynamicHUD 2.0. It can increase stress from speeding and weapon usage, reduce it through custom integrations, and apply blur or ragdoll effects at high stress levels.
This resource is adapted and isolated from the QBX `qbx_hud` stress system. Credit remains with the QBX project and contributors, and the resource is provided as-is without official support.
## Installation [#installation]
1. Download or clone [orbitstudiossoftware/orbit-dynamichud-stress](https://github.com/orbitstudiossoftware/orbit-dynamichud-stress).
2. Stop the server and extract the folder as `orbit-dynamichud-stress`.
3. Install ox\_lib, Orbit Lib, and Orbit Dynamic HUD 2.0.
4. Review the public `config.lua` for stress gain, speed units, thresholds, whitelisted jobs, weapon exclusions, and effects.
5. Start the stress addon after DynamicHUD 2.0 and after the optional seatbelt state provider.
6. Add relief items only after the base stress state initializes and displays correctly.
```properties title="server.cfg"
ensure ox_lib
ensure [framework-resources]
ensure orbit-lib
ensure orbit-dynamichud-v2
# Optional seatbelt state provider.
ensure orbit-dynamichud-addons
ensure orbit-dynamichud-stress
```
## Resource structure [#resource-structure]
Use `config.lua` to change stress gain chance, speeding thresholds, whitelisted jobs, blur strength, effect timing, and weapon exclusions. Use [Stress Relief Items](/docs/orbit-studios-resources/orbit-dynamichud-stress/stress-relief-items) when cigarettes, consumables, or other inventory items should reduce stress.
## Framework setup [#framework-setup]
Configure ESX in Orbit Lib. Whitelisted jobs must match the ESX job names returned by the normalized player bridge.
Configure QB-Core in Orbit Lib. Whitelisted jobs must match `PlayerData.job.name`; state-based stress integrations remain compatible with common QB HUD events.
Configure QBX in Orbit Lib. The stress system is adapted from QBX HUD behavior and uses the same replicated player-state integration style.
Configure `Config.Standalone.fetchJob` in Orbit Lib when job whitelisting is needed. Otherwise the configured default job is used.
The stress addon reads `LocalPlayer.state.seatbelt` to choose its buckled or unbuckled speeding threshold. Orbit DynamicHUD Addons publishes this state; another seatbelt resource can publish the same boolean instead.
## First-run verification [#first-run-verification]
1. Confirm ox\_lib, Orbit Lib, DynamicHUD 2.0, and the stress addon start without errors.
2. Join with a fully loaded character and verify `LocalPlayer.state.stress` becomes a number from `0` to `100`.
3. Confirm DynamicHUD 2.0 has its stress value enabled and displays the replicated state.
4. Test unbuckled and buckled speeding with thresholds temporarily set to safe test values.
5. Fire an eligible weapon and verify whitelisted weapons do not add stress.
6. Test a whitelisted and non-whitelisted job through `hud:server:GainStress`.
7. Set stress into each configured effect range and tune blur or interval values one range at a time.
8. Test one relief integration and confirm stress never falls below `0` or rises above `100`.
## Related Orbit resources [#related-orbit-resources]
* [Orbit Dynamic HUD 2.0](/docs/orbit-studios-resources/orbit-dynamichud-v2) displays and reacts to the replicated stress value.
* [Orbit DynamicHUD Addons](/docs/orbit-studios-resources/orbit-dynamichud-addons) provides the compatible seatbelt state used by speeding thresholds.
* [Orbit Lib](/docs/orbit-studios-resources/orbit-lib) provides normalized framework and job data.
## Support [#support]
This resource is provided as-is. For reproducible issues, include the client/server console error, framework, relevant stress config, current stress and seatbelt state values, and exact reproduction steps when reporting through the [GitHub repository](https://github.com/orbitstudiossoftware/orbit-dynamichud-stress). Keep the original QBX attribution with redistributed copies.
# Stress Relief Items (/docs/orbit-studios-resources/orbit-dynamichud-stress/stress-relief-items)
# Stress Relief Items [#stress-relief-items]
Stress relief items lower the replicated `stress` state value that DynamicHUD 2.0 reads. The examples below show where the item logic belongs for each inventory or framework style.
The `ox_inventory` example uses the same server-side item export pattern as the GitBook docs. Put the export in `ox_inventory/modules/items/server.lua`, not in a custom client export.
## Requirements [#requirements]
* The base stress resource must initialize `Player(source).state.stress` before the item is tested.
* The item name must exist in the selected inventory or framework item list.
* The server-side usable-item handler and inventory definition must use the same item name.
* Relief values should remain positive; the stress event or state write must clamp the final result at `0`.
## Implementation by framework [#implementation-by-framework]
Add the item handler in `ox_inventory/modules/items/server.lua`:
```lua title="ox_inventory/modules/items/server.lua"
exports('cigarette', function(event, item, inventory, slot, data)
local src = inventory.id
-- Player is attempting to use the item
if event == 'usingItem' then
local currentStress = Player(src)?.state?.stress or 0
local relief = math.random(5, 10)
local newStress = math.max(currentStress - relief, 0)
Player(src)?.state:set("stress", newStress, true)
end
-- Player finished using the item
if event == 'usedItem' then
TriggerClientEvent('ox_lib:notify', src, {
description = 'You feel better already'
})
end
end)
```
Then define the usable item in `ox_inventory/data/items.lua`:
```lua title="ox_inventory/data/items.lua"
cigarette = {
label = "Cigarette",
weight = 10,
stack = true,
consume = 1
}
```
`usingItem` runs when the player starts using the item. The handler reads the current stress state, removes a random amount from 5 to 10, clamps the result so it never goes below 0, and replicates the new value with `Player(src)?.state:set("stress", newStress, true)`.
`usedItem` runs after the item finishes consuming. The GitBook implementation uses this event to show an `ox_lib` notification.
To change the relief amount, only change the `relief` line:
```lua title="ox_inventory/modules/items/server.lua"
local relief = 10
```
```lua title="ox_inventory/modules/items/server.lua"
local relief = math.random(5, 10)
```
```lua title="ox_inventory/modules/items/server.lua"
local relief = math.random(20, 30)
```
Use this pattern when your server uses QBCore usable items instead of `ox_inventory` item exports. Put the server callback in any started server resource, then trigger the stress resource server event with the amount you want to remove.
```lua title="resources/[custom]/server/main.lua"
QBCore.Functions.CreateUseableItem('stress_relief', function(source)
TriggerClientEvent('my_resource:client:relieveStress', source, 20)
end)
```
```lua title="resources/[custom]/client/main.lua"
RegisterNetEvent('my_resource:client:relieveStress', function(amount)
TriggerServerEvent('hud:server:RelieveStress', amount)
end)
```
Add the item to your QB inventory item list using the same item name, `stress_relief`. If the inventory item name does not match the usable item name, the callback will never run.
Use this pattern when your server uses ESX usable items. The ESX callback runs on the server, sends a small client event to the player, and the client asks the stress addon to remove stress.
```lua title="resources/[custom]/server/main.lua"
ESX.RegisterUsableItem('stress_relief', function(source)
TriggerClientEvent('my_resource:client:relieveStress', source, 20)
end)
```
```lua title="resources/[custom]/client/main.lua"
RegisterNetEvent('my_resource:client:relieveStress', function(amount)
TriggerServerEvent('hud:server:RelieveStress', amount)
end)
```
Add the `stress_relief` item to your ESX inventory or item database before testing the usable item callback.
## Testing checklist [#testing-checklist]
1. Give the item to a test player and confirm the inventory recognizes it as usable.
2. Set the player's stress above the configured relief amount.
3. Use one item and confirm only one item is consumed.
4. Verify the replicated stress value decreases once and never falls below `0`.
5. Confirm DynamicHUD 2.0 updates without reconnecting.
6. Test the success notification and any progress/animation owned by the inventory or framework.
7. Repeat at `0` stress and with an invalid player/item path to confirm the integration fails safely.
# Troubleshooting (/docs/orbit-studios-resources/orbit-dynamichud-stress/troubleshooting)
# Troubleshooting [#troubleshooting]
Start with the client F8 and server consoles. Confirm the resource order, then inspect `LocalPlayer.state.stress`, `LocalPlayer.state.seatbelt`, and the normalized player job before tuning effects or thresholds.
Confirm `orbit-dynamichud-v2` starts before the stress addon and that `Config.EnabledValues.stress` is enabled in the HUD config. Then check that `LocalPlayer.state.stress` becomes a number after joining the server. If it stays nil, the stress resource is not initializing the player state.
Match `Config.Stress.stressSpeedFormat` to the unit you used for thresholds, then check whether your seatbelt resource sets `LocalPlayer.state.seatbelt`. When that state is false or missing, the resource uses `Config.Stress.minForSpeedingUnbuckled`.
Check that the job name in `Config.Stress.whitelistedJobs` exactly matches the job name returned by `orbit-lib`. The whitelist only affects `hud:server:GainStress`; custom scripts that set `Player(source).state.stress` directly bypass the whitelist.
Increase `Config.Stress.effectInterval` timeouts or reduce `Config.Stress.blurIntensity` values for the affected stress ranges. Change one stress range at a time, restart the resource, and test with `/setstress` so you know which range feels wrong.
Confirm the item callback actually runs, then verify it triggers `hud:server:RelieveStress` or writes the replicated server player state. With ox\_inventory, keep the documented server-side item export in `ox_inventory/modules/items/server.lua` and use the same item name in `data/items.lua`.
Disable duplicate stress resources and search custom scripts for direct writes to `Player(source).state.stress` or calls to common QB HUD stress events. Keep one authority for each gameplay action so it does not both trigger a gain event and directly set the resulting state.
Use [Dependencies](/docs/orbit-studios-resources/orbit-dynamichud-stress/dependencies) for startup problems, [Configuration](/docs/orbit-studios-resources/orbit-dynamichud-stress/configuration) for thresholds and effects, [Events](/docs/orbit-studios-resources/orbit-dynamichud-stress/events) for state integration, and [Stress Relief Items](/docs/orbit-studios-resources/orbit-dynamichud-stress/stress-relief-items) for inventory examples.
# Configuration (/docs/orbit-studios-resources/orbit-dynamichud-addons/configuration)
# Configuration [#configuration]
All public configuration lives in `resources/[orbit]/orbit-dynamichud-addons/config.lua`.
This resource is client-heavy. Most settings affect how the local player toggles seatbelt or cruise control, what DynamicHUD 2.0 receives through state bags, and when GTA's windscreen ejection behavior is allowed.
Do not run two resources that both own seatbelt, ejection, or cruise-control state. Choose one owner and make any external harness integration publish `LocalPlayer.state.harness`.
## File map [#file-map]
## Core settings [#core-settings]
```lua title="resources/[orbit]/orbit-dynamichud-addons/config.lua"
Config.Seatbelt = {
enable = true,
keybind = 'B',
useMPH = false,
minSpeedUnbuckled = 20.0,
minSpeedBuckled = 160.0,
harness = {
disableFlyingThroughWindscreen = true,
minSpeed = 200.0
}
}
```
`useMPH` changes how `minSpeedUnbuckled`, `minSpeedBuckled`, and harness speed values are interpreted. Set it to `true` only when you want those thresholds written as miles per hour.
`harness.disableFlyingThroughWindscreen = true` prevents windscreen ejection while a harness is active. If you set it to `false`, `harness.minSpeed` becomes the ejection threshold while harnessed.
```lua title="resources/[orbit]/orbit-dynamichud-addons/config.lua"
Config.Cruise = {
enable = true,
keybind = 'Y'
}
```
Cruise can only enable when the player is driving, the vehicle is moving forward, and the vehicle class is supported by the client script.
```lua title="resources/[orbit]/orbit-dynamichud-addons/config.lua"
Config.Notify = function(message, type)
TriggerEvent("orbit-dynamichud:notify", {
description = message,
type = type or 'info',
duration = 3000
})
end
```
Replace this function if you do not use DynamicHUD 2.0 notifications. Keep it client-side and keep the `(message, type)` parameters so the seatbelt and cruise scripts can call it normally.
## Locale text [#locale-text]
The addon uses `ox_lib` locales. Set the locale in `server.cfg`, then edit the matching JSON file if you want different labels or messages.
```properties title="server.cfg"
setr ox:locale en
```
```json title="resources/[orbit]/orbit-dynamichud-addons/locales/en.json"
{
"actions": {
"toggle_cruise_control": "Toggle Cruise Control"
},
"success": {
"cruise_control_enabled": "Cruise control enabled"
},
"error": {
"cruise_control_disabled": "Cruise control disabled",
"cruise_control_unavailable": "Cruise control is not available for this vehicle"
},
"seatbelt_desc": "Toggle Seatbelt"
}
```
See [Language Support](/docs/orbit-studios-resources/orbit-dynamichud-addons/language-support) for every included locale and the translation workflow.
## Apply and verify [#apply-and-verify]
1. Save `config.lua` and restart the addon.
2. Reconnect the client when testing changed default keybinds because FiveM stores player overrides locally.
3. Test seatbelt and cruise in a supported vehicle from the driver seat.
4. Confirm `LocalPlayer.state.seatbelt` and `LocalPlayer.state.cruise` match the visible DynamicHUD 2.0 indicators.
5. Test unbuckled, buckled, and harness behavior at safe test speeds.
6. Trigger each notification path and verify the active locale text.
# Dependencies (/docs/orbit-studios-resources/orbit-dynamichud-addons/dependencies)
# Dependencies [#dependencies]
`orbit-dynamichud-addons` provides seatbelt and cruise-control behavior for DynamicHUD 2.0. Source and releases are available on [GitHub](https://github.com/orbitstudiossoftware/orbit-dynamichud-addons).
## Required [#required]
| Dependency | Why it is needed | Link |
| --------------------- | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| `ox_lib` | Loads `@ox_lib/init.lua`, keybind helpers, cache helpers, and locale helpers. | [overextended/ox\_lib](https://github.com/overextended/ox_lib) |
| `orbit-dynamichud-v2` | Receives seatbelt/cruise state through events and state bags. | [orbit-dynamichud-v2](/docs/orbit-studios-resources/orbit-dynamichud-v2) |
## Optional integrations [#optional-integrations]
| Dependency | What it adds | Link |
| ----------------------- | ----------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| `orbit-lib` | Recommended when the rest of your Orbit stack uses shared notifications and framework bridging. | [orbit-lib](/docs/orbit-studios-resources/orbit-lib) |
| Custom harness resource | Can set `LocalPlayer.state.harness` for harness compatibility. | Custom resource |
## Start order [#start-order]
```properties title="server.cfg"
ensure ox_lib
ensure orbit-lib
ensure orbit-dynamichud-v2
ensure orbit-dynamichud-addons
```
If you do not use `orbit-lib` for this addon, keep `ox_lib` and `orbit-dynamichud-v2` before `orbit-dynamichud-addons`.
## Feature failure behavior [#feature-failure-behavior]
* Missing ox\_lib prevents keybind, cache, and locale helpers from initializing.
* Missing DynamicHUD 2.0 does not create a replacement HUD indicator; state bags may still change, but the tailored display and default notification event are unavailable.
* Missing Orbit Lib does not block the standalone seatbelt/cruise logic unless another installed Orbit integration expects it.
* Missing harness state makes the addon treat the player as not wearing a harness.
* Running another seatbelt or cruise resource at the same time can cause conflicting controls and state values.
# Exports and Events (/docs/orbit-studios-resources/orbit-dynamichud-addons/exports-and-events)
# Exports and Events [#exports-and-events]
The addon communicates through local player state bags and local client events. DynamicHUD 2.0 reads the same state values, so custom resources can use them too.
These state values, events, and the compatibility export belong to the client. Server resources should not assume local-only seatbelt or cruise state is automatically replicated.
## Read current state [#read-current-state]
```lua title="resources/[custom]/client/main.lua"
local seatbeltOn = LocalPlayer.state.seatbelt == true
local cruiseOn = LocalPlayer.state.cruise == true
local harnessOn = LocalPlayer.state.harness == true
```
State bag values are local booleans. They can be `nil` before the player enters a vehicle, so compare with `== true` when you need a strict boolean.
## Listen for toggles [#listen-for-toggles]
```lua title="resources/[custom]/client/seatbelt-listener.lua"
AddEventHandler('seatbelt:client:ToggleSeatbelt', function()
local seatbeltOn = LocalPlayer.state.seatbelt == true
end)
```
```lua title="resources/[custom]/client/cruise-listener.lua"
AddEventHandler('seatbelt:client:ToggleCruise', function()
local cruiseOn = LocalPlayer.state.cruise == true
end)
```
## Harness compatibility [#harness-compatibility]
`HasHarness()` is kept for older integrations, but new code should read the state bag directly.
```lua title="resources/[custom]/client/harness.lua"
local hasHarness = exports['orbit-dynamichud-addons']:HasHarness()
```
```lua title="resources/[custom]/client/harness.lua"
LocalPlayer.state.harness = true
```
## Integration checklist [#integration-checklist]
1. Compare state values with `== true` because they can be `nil` before initialization.
2. Listen for toggle events only when an immediate reaction is needed; otherwise read current state at the point of use.
3. Let one resource own writes to seatbelt and cruise state.
4. Prefer `LocalPlayer.state.harness` over the deprecated compatibility export for new integrations.
5. Clear or update external harness state when the harness is removed so ejection logic does not remain protected incorrectly.
# Installation (/docs/orbit-studios-resources/orbit-dynamichud-addons)
# Orbit DynamicHUD Addons [#orbit-dynamichud-addons]
Orbit DynamicHUD Addons provides standalone seatbelt and cruise-control behavior tailored for DynamicHUD 2.0. It uses ox\_lib keybinds and locales, publishes client state bags, and can send notifications through DynamicHUD 2.0 or a custom client function.
This addon is adapted from QBX GPL resources and is distributed under GPLv3. Keep the included license, source availability, and original QBX attribution when modifying or redistributing it.
If your server already has seatbelt or cruise control, you can skip this addon and make the existing resource publish the compatible states documented under Exports and Events.
## Installation [#installation]
1. Download or clone [orbitstudiossoftware/orbit-dynamichud-addons](https://github.com/orbitstudiossoftware/orbit-dynamichud-addons).
2. Stop the server and extract the folder as `orbit-dynamichud-addons`.
3. Install ox\_lib and Orbit Dynamic HUD 2.0.
4. Review `config.lua`, especially enabled systems, keybind defaults, speed thresholds, harness behavior, and `Config.Notify`.
5. Start the addon after ox\_lib and DynamicHUD 2.0.
6. Restart the server or reconnect the test client after changing default keybinds.
```properties title="server.cfg"
ensure ox_lib
ensure orbit-lib
ensure orbit-dynamichud-v2
ensure orbit-dynamichud-addons
```
## Resource structure [#resource-structure]
Normal setup lives in `resources/[orbit]/orbit-dynamichud-addons/config.lua`. Change keybinds, enable or disable cruise and seatbelt behavior, adjust ejection thresholds, and replace the notification function there. Keep the included GPL license and attribution files with the resource.
## Framework setup [#framework-setup]
No ESX player bridge is required. Keep the DynamicHUD 2.0 notification function or replace `Config.Notify` with a client-side ESX notification wrapper.
No QB-Core dependency is required. If an existing harness system owns harness state, make it update `LocalPlayer.state.harness` instead of running duplicate seatbelt logic.
The addon is adapted from QBX seatbelt and cruise resources, but its normal QBX core requirements were removed. Do not run overlapping QBX seatbelt/cruise resources at the same time.
No framework player data is required. Keep ox\_lib started first and configure `Config.Notify` for whichever client notification interface your server uses.
## First-run verification [#first-run-verification]
1. Confirm ox\_lib, DynamicHUD 2.0, and the addon start without errors.
2. Enter the driver seat and verify the seatbelt and cruise keybinds appear in FiveM settings.
3. Toggle the seatbelt and confirm `LocalPlayer.state.seatbelt` and the DynamicHUD 2.0 indicator update together.
4. Drive forward in a supported vehicle, toggle cruise, and confirm `LocalPlayer.state.cruise` updates.
5. Brake, reverse, leave the driver seat, and change vehicles to verify cruise disables correctly.
6. Test buckled, unbuckled, and harness ejection thresholds in a safe test environment.
7. Trigger one success and one unavailable notification and verify the active locale text.
## Related Orbit resources [#related-orbit-resources]
* [Orbit Dynamic HUD 2.0](/docs/orbit-studios-resources/orbit-dynamichud-v2) displays the seatbelt and cruise states.
* [Orbit DynamicHUD Stress](/docs/orbit-studios-resources/orbit-dynamichud-stress) can use the seatbelt state when choosing speeding thresholds.
## Support [#support]
This GPL resource is provided as-is. For reproducible issues, include the client console error, relevant config values, vehicle class, current state-bag values, and clear reproduction steps when reporting through the [GitHub repository](https://github.com/orbitstudiossoftware/orbit-dynamichud-addons). Do not remove the included license or original attribution.
# Language Support (/docs/orbit-studios-resources/orbit-dynamichud-addons/language-support)
# Language Support [#language-support]
Orbit DynamicHUD Addons uses the ox\_lib locale system. The active locale supplies seatbelt and cruise keybind labels plus success, disabled, and unavailable notifications.
## Included Locales [#included-locales]
| Language | Locale | File |
| -------- | ------ | ----------------- |
| English | `en` | `locales/en.json` |
| German | `de` | `locales/de.json` |
| Spanish | `es` | `locales/es.json` |
| French | `fr` | `locales/fr.json` |
| Swedish | `sv` | `locales/sv.json` |
| Turkish | `tr` | `locales/tr.json` |
## Select A Locale [#select-a-locale]
Set the replicated ox\_lib locale before starting the addon.
```properties title="server.cfg"
setr ox:locale en
ensure ox_lib
ensure orbit-dynamichud-v2
ensure orbit-dynamichud-addons
```
For Turkish, use `setr ox:locale tr`. Restart the addon after changing the convar or a locale file.
## Customize Existing Text [#customize-existing-text]
Edit values in the active JSON file while keeping its keys and nesting intact.
```json title="resources/[orbit]/orbit-dynamichud-addons/locales/en.json"
{
"actions": {
"toggle_cruise_control": "Toggle Cruise Control"
},
"success": {
"cruise_control_enabled": "Cruise control enabled"
}
}
```
Do not delete untranslated or apparently unused keys. Keybind registration and vehicle-state branches can resolve text that is not visible during a quick test.
## Add A Language [#add-a-language]
1. Copy `locales/en.json` to a new file such as `locales/pt.json`.
2. Translate values only and preserve every key, nested object, and placeholder.
3. Validate the file as JSON.
4. Set `setr ox:locale pt` and restart the addon.
5. Test both keybind labels and every cruise success/error notification.
Changing a default keybind label may require the client to reconnect before it appears in FiveM settings. Existing player key overrides remain client-owned.
# Troubleshooting (/docs/orbit-studios-resources/orbit-dynamichud-addons/troubleshooting)
# Troubleshooting [#troubleshooting]
Start with the client F8 console. Confirm the addon, ox\_lib, and DynamicHUD 2.0 start in order, then inspect the current local state values before debugging the HUD presentation.
Confirm `ox_lib` starts before the addon and restart the client after changing default keys. FiveM stores keybind choices per client, so changing `Config.Seatbelt.keybind` or `Config.Cruise.keybind` only changes the default for players who have not overridden it.
Confirm `orbit-dynamichud-addons` starts after `orbit-dynamichud-v2`, then inspect `LocalPlayer.state.seatbelt` and `LocalPlayer.state.cruise`. If those values change but the HUD does not, check the DynamicHUD 2.0 seatbelt and cruise compatibility events.
Cruise only enables from the driver seat, while the vehicle is moving forward, and only for supported vehicle classes. It also disables when the driver leaves the seat, the vehicle disappears, the gear is not forward, or `Config.Cruise.enable` is false.
Replace `Config.Notify` with your own client notification export or event if you are not using the default DynamicHUD 2.0 notification event. Keep the function signature as `function(message, type)` so cruise and seatbelt code can call it without changes.
Confirm `Config.Seatbelt.useMPH` matches the units used for every threshold. Test unbuckled, buckled, and harness paths separately. Another seatbelt/ejection resource can still eject the player even when this addon's thresholds are correct, so disable duplicate systems during diagnosis.
The preferred integration is `LocalPlayer.state.harness`. Confirm the external harness resource updates that exact boolean state. The deprecated `HasHarness()` export reads compatibility state; it does not automatically discover arbitrary inventory items or another resource's private variables.
Use [Dependencies](/docs/orbit-studios-resources/orbit-dynamichud-addons/dependencies) for startup problems, [Configuration](/docs/orbit-studios-resources/orbit-dynamichud-addons/configuration) for thresholds and notification behavior, and [Exports and Events](/docs/orbit-studios-resources/orbit-dynamichud-addons/exports-and-events) for state names and integrations.
# Admin HUD (/docs/orbit-studios-resources/orbit-dynamichud-v2/admin-hud)
# Admin HUD [#admin-hud]
The Admin HUD is an optional ACE-gated editor for the serializable values in `shared/config.lua`, `shared/settingsConfig.lua`, and non-secret settings in `server/config.lua`. It uses the HUD's dark interface and is separate from the player control panel.
```lua title="resources/[orbit]/orbit-dynamichud-v2/server/config.lua"
Config.AdminHud = {
enabled = true,
ace = "orbit.adminhud",
command = "adminhud",
}
```
```properties title="server.cfg"
add_ace group.admin orbit.adminhud allow
```
An authorized player can enter `/adminhud`. The server checks the ACE both when opening the page and on **every** read, save, reset, and player action. Set `enabled = false` in `server/config.lua` to disable the command and handlers, even if an old saved override says otherwise. `command` accepts a single command name without `/`, spaces, or punctuation other than `_`. Changes to this block require a resource restart; if the Admin HUD was disabled through its own editor, remove the saved override from `shared/admin-overrides.json` before restarting.
On the localhost Vite preview, the development debug panel has an **Admin HUD** button. It opens sample settings so you can inspect the layout and edit controls. Save, reset, and player actions are simulated locally; they do not contact a FiveM server or change its configuration.
## Editing config [#editing-config]
Choose a section on the left, or search by a setting's label or config key. Search results open the matching field. **Changed only** filters to your pending edits, and the undo icon beside a changed field restores its last saved value. Select **Save config** to validate and write changes to `shared/admin-overrides.json`.
Fields marked **Requires restart** are saved but do not take effect immediately. The same badge appears in search results; hover it for an explanation. The badges follow the server's live-update support list.
These settings apply immediately to connected players, without restarting the resource:
* `Debug`, `MoneyText`, `HeadingType`, and `DriverPermissionAsPassenger`.
* `EnabledValues`, `CinematicHeight`, and `PerformanceSettings`.
* `DefaultSettings`, including locked layouts and visibility policies. Unlocked player preferences are preserved; changing defaults does not force every player to use them. Use **Force HUD settings** for that.
* `ControlPanel.customize`, `ControlPanel.settings`, and `ControlPanel.carControl`.
Players who join later receive the same live configuration. In the editor, **supported settings** means exactly the live list above, not every setting the editor can save.
### Settings that require a restart [#settings-that-require-a-restart]
These editable sections are saved now but only activated after restarting `orbit-dynamichud-v2`:
| Config section | Why it is not applied live |
| ---------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Commands`, `Keybinds`, server `commands` | Commands, chat suggestions, and key mappings are registered during startup. Changing a value alone would not replace the existing registrations. |
| `Onboarding` | The trigger policy is resolved once, and automatic onboarding and command registration depend on that initial policy. |
| `WaypointNavigation` | The navigation worker and its cached options are initialized at startup. |
| `CustomLocationNames` | Street and zone replacements are registered with GTA once. Live changes would also need to restore removed replacements. |
| `PhoneOffset` | The side, distance, and enabled state are cached, and the configured phone events are registered once. |
| `DynamicBar` | Mode policy and postal support are initialized at startup. Changing the table alone would leave those cached decisions unchanged. |
| `CustomMap` | The radar worker's lifecycle depends on the startup configuration; a stopped worker is not automatically recreated. |
| `Accounts` | Money update handling is registered conditionally when the resource starts. |
| `SettingsLocked` | Several commands and services are conditionally registered or skipped based on the initial lock state. This differs from the live layout locks inside `DefaultSettings`. |
| `ControlPanel.enableControlPanel` | The master panel switch is not included in the supported live-update list. It remains staged; changing this switch live would need to handle any already-open panel and its NUI focus. |
| `ControlPanel.music` | Music services cache feature flags and initialize playback/synchronization workers from their startup options. |
| `ControlPanel.settingsShare`, server `settingsShare` | Sharing handlers, feature flags, limits, and thumbnail settings are initialized together at startup. |
| Server `adminHud` | The command, enabled state, and ACE permission are captured when the admin service starts. |
This is a boundary of the current implementation, not a FiveM restriction that makes live updates impossible. Supporting these sections live would require explicit cleanup and reinitialization of their registrations, workers, and cached state. They are staged together to avoid partially applying a change while an old service remains active.
When a save contains both kinds of changes, supported values apply immediately and the editor reports that some startup changes remain pending. Restart `orbit-dynamichud-v2` when ready to activate those remaining changes. **Reload** is not a substitute for that restart.
**Reset overrides** removes saved overrides after confirmation. Supported live settings revert immediately; any startup differences still need a restart. **Reload** fetches the latest saved configuration into the editor. It does not restart the resource or apply unsaved edits, and asks before discarding pending edits. If another admin saved while you were editing, reload before saving again.
The editor intentionally does not expose Lua functions or server-only secrets such as the FiveManage API key and upload endpoints. Edit those directly in their Lua files. The override JSON is written by the server and synced to clients so shared config changes can apply on both sides; do not put secrets in it or distribute it as a replacement for your config files. Keep `shared/admin-overrides.json` writable by the resource if you want in-game saves.
## Forcing player settings [#forcing-player-settings]
Open **Force HUD settings** and choose **One player** or **Everyone**. For one player, enter their **server ID**. Select **My current HUD** or **Configured server defaults**, then choose **Force settings**. For everyone, **Force everyone** requires a second confirmation. The server validates the submitted structure and preserves server-locked layouts and visibility policy. This affects connected players immediately and players who join while the global override is active.
**Clear override** restores one player's regular settings, or the global override if one is active. **Clear everyone** removes every forced setting, including individual overrides. Global overrides end when the resource restarts. Individual overrides also end when the player disconnects. None are saved to the config JSON.
Forcing settings does not change the server's default configuration. Test changes with a player first, then save the desired server defaults separately if they should persist.
The **Street Names** section also contains game zone aliases because GTA can use them in other on-screen labels. The Orbit HUD itself displays street names, not zone names.
# Commands (/docs/orbit-studios-resources/orbit-dynamichud-v2/commands)
# Commands [#commands]
Command names and help text come from `locales/.json`. This page uses the default English names. If a command value is translated, use that translated name in-game.
## Client commands [#client-commands]
Client commands are enabled individually in `shared/config.lua`:
```lua title="resources/[orbit]/orbit-dynamichud-v2/shared/config.lua"
Config.Commands = {
controlpanel = { enabled = true },
customize = { enabled = true },
music = { enabled = true },
carcontrol = { enabled = true },
settings = { enabled = true },
settingsshare = { enabled = true },
editmode = { enabled = true },
restarthud = { enabled = true },
engine = { enabled = true },
onboarding = { enabled = true }
}
```
| Command | Parameters | Behavior |
| --------------------------------------------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `/controlpanel` | none | Opens the control panel when at least one panel module is enabled and onboarding is not active. |
| `/customize` | none | Opens the Customize tab when it and at least one of its subtabs are enabled. |
| `/music` | none | Opens the Music tab when it and at least one of its subtabs are enabled. |
| `/carcontrol` | none | Opens Car Control when that tab is enabled and the player is in a vehicle. |
| `/settings` | none | Opens the Settings tab when it and at least one of its subtabs are enabled. |
| /settingsshare | none | Opens the standalone Settings Share page when it is enabled and settings are not locked. |
| `/editmode` | none | Opens HUD edit mode when customization and the settings/edit-mode module are enabled and settings are not locked. |
| `/restarthud` | none | Remounts the local UI, refreshes its configuration, and rebuilds map data without restarting the resource or discarding saved settings. |
| `/engine` | none | Toggles the current vehicle engine while the player occupies the driver seat. |
| `/onboarding` | none | Force-opens onboarding, including after completion, when onboarding is enabled and settings are not locked. |
Command switches and keybind switches are independent. Disabling `/music`, for example, does not disable an enabled Music keybind. Disabling the Music module prevents both entry points from registering or opening it.
## Control-panel keybinds [#control-panel-keybinds]
Every control-panel keybind can be enabled and assigned independently:
```lua title="resources/[orbit]/orbit-dynamichud-v2/shared/config.lua"
Config.Keybinds.ui_keybinds = {
focus_ui = { enabled = true, key = 'F4' },
customize = { enabled = false, key = 'F5' },
music = { enabled = false, key = 'F6' },
carcontrol = { enabled = false, key = 'F7' },
settings = { enabled = false, key = 'F9' }
}
```
`focus_ui` opens the normal/default control-panel page. The other entries open their named top-level tab. A keybind is registered only when its entry is enabled, its key is non-empty, and the target module is available. Car Control additionally checks that the player is currently in a vehicle when the key is pressed.
These are `ox_lib` keybind defaults. Players can remap registered bindings through FiveM settings. The legacy `focus_ui = 'F4'` form remains supported and is treated as enabled.
To open a specific control-panel page from another resource, use the [openControlPanel event](/docs/orbit-studios-resources/orbit-dynamichud-v2/events#open-a-control-panel-page).
`/onboarding` is independent from `Config.Onboarding.trigger`: it works in both automatic and manual modes and does not start the first-run availability watcher. Disabling `Config.Onboarding.enabled` removes both the command and public event. Disabling only `Config.Commands.onboarding.enabled` leaves manual event integrations available. See the [Onboarding guide](/docs/orbit-studios-resources/orbit-dynamichud-v2/onboarding).
## Server commands [#server-commands]
The optional `/adminhud` command opens the ACE-gated [Admin HUD](/docs/orbit-studios-resources/orbit-dynamichud-v2/admin-hud). Its name, ACE, and enabled state are set in `server/config.lua` through `Config.AdminHud`; it is not a localized client command. No Admin HUD command or request handler is registered when the feature is disabled.
Server commands use `ox_lib` command registration and are configured in `server/config.lua`:
```lua title="resources/[orbit]/orbit-dynamichud-v2/server/config.lua"
Config.Commands.cash = {
enabled = true,
allow = 'group.admin'
}
Config.Commands.bank = {
enabled = true,
allow = 'group.admin'
}
Config.Commands.setstress = {
enabled = true,
allow = 'group.admin'
}
```
| Command | Parameters | Behavior |
| ------------ | --------------------- | ------------------------------------------------------------------ |
| `/cash` | `[targetId]` | Shows the caller's cash or a target player's cash. |
| `/bank` | `[targetId]` | Shows the caller's bank balance or a target player's bank balance. |
| `/setstress` | `` | Sets the caller's replicated stress value. |
| `/setstress` | ` ` | Sets a target player's replicated stress value. |
```text title="FiveM chat/console examples"
/cash
/cash 12
/bank
/bank 12
/setstress 25
/setstress 12 25
```
Square brackets mean optional and angle brackets mean required. Stress is converted to a number and clamped between `0` and `100`.
`allow` is passed to the `ox_lib` restricted command setting. An empty string makes the command unrestricted:
```lua title="Public command example"
Config.Commands.cash = {
enabled = true,
allow = ''
}
```
The bundled `cash` and `bank` commands read QB/QBX-style `Player.PlayerData.money.cash` and `Player.PlayerData.money.bank` from the normalized `orbit-lib` player object. Disable or adapt these helper commands if your framework adapter does not expose that shape.
## Locale keys [#locale-keys]
Every locale must preserve the command keys and descriptions:
```json title="resources/[orbit]/orbit-dynamichud-v2/locales/en.json"
{
"commands": {
"cash": "cash",
"bank": "bank",
"setstress": "setstress",
"engine": "engine",
"restarthud": "restarthud",
"onboarding": "onboarding",
"controlpanel": "controlpanel",
"customize": "customize",
"music": "music",
"carcontrol": "carcontrol",
"settings": "settings",
"settingsshare": "settingsshare",
"editmode": "editmode",
"desc": {
"cash": "Check Cash Balance",
"bank": "Check Bank Balance",
"setstress": "Sets your stress level, input should be 1-100.",
"engine": "Toggle vehicle engine",
"restarthud": "Restarts HUD",
"onboarding": "Enables onboarding again",
"controlpanel": "Open the HUD control panel",
"customize": "Open HUD customization",
"music": "Open HUD music controls",
"carcontrol": "Open vehicle controls",
"settings": "Open HUD settings",
"settingsshare": "Open the HUD settings sharing interface",
"editmode": "Open HUD edit mode"
}
}
}
```
Restart the resource after changing command locale values or command configuration.
# Configuration (/docs/orbit-studios-resources/orbit-dynamichud-v2/configuration)
# Configuration [#configuration]
Orbit Dynamic HUD 2.0 keeps public server-owner configuration outside escrow. Restart the resource after changing Lua configuration.
Configure the resource through the files listed here. Do not modify compiled NUI files or protected runtime files.
## File map [#file-map]
| File | Purpose |
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `shared/config.lua` | Runtime behavior, onboarding mode, commands, keybinds, Dynamic Bar policy, modules, account/status availability, phone offsets, and performance intervals. |
| `shared/settingsConfig.lua` | Authoritative/default player settings and component layouts. |
| `shared/admin-overrides.json` | Validated changes staged in the in-game Admin HUD. Restart the resource to apply them. |
| `shared/weapons.lua` | Weapon labels, item names, ammo sources, and ammo metadata. |
| `server/config.lua` | Restricted commands, Settings Share limits, moderation ACE, throttling, and thumbnail service. |
| `server/handlers.lua` | Framework, inventory, medical, and custom integration glue. |
| `locales/*.json` | UI text and localized command names/descriptions. |
The optional [Admin HUD](/docs/orbit-studios-resources/orbit-dynamichud-v2/admin-hud) edits serializable config values in-game, with ACE authorization. [Custom street names](/docs/orbit-studios-resources/orbit-dynamichud-v2/custom-location-names) replace HUD street labels without a polling thread; optional zone aliases affect other GTA labels.
## Core settings [#core-settings]
```lua title="resources/[orbit]/orbit-dynamichud-v2/shared/config.lua"
Config.Debug = false
Config.MoneyText = '$'
Config.HeadingType = 'camera'
Config.WaypointNavigation = {
enabled = true,
idleInterval = 500,
updateInterval = 60
}
Config.Onboarding = {
enabled = true,
trigger = 'auto' -- 'auto' or 'manual'
}
Config.DriverPermissionAsPassenger = false
Config.SettingsLocked = false
Config.CinematicHeight = 0.1
```
| Setting | Values/default | Description |
| ------------------------------------------ | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Config.Debug` | `true` in the current config file | Enables development diagnostics. Set it to `false` in production, as shown above. |
| `Config.MoneyText` | `"$"` | Text displayed next to cash/account values. |
| `Config.HeadingType` | `"camera"` or `"heading"` | Use camera rotation or entity heading for the compass. |
| `Config.WaypointNavigation.enabled` | `true` | Enables GPS distance, direction, and waypoint-color updates. When false, the waypoint thread is never created. |
| `Config.WaypointNavigation.idleInterval` | `500` | Milliseconds between lightweight availability checks when no driver waypoint is active. Runtime minimum: `100`. |
| `Config.WaypointNavigation.updateInterval` | `60` | Milliseconds between route updates for a driver with an active waypoint. Runtime minimum: `30`. |
| `Config.Onboarding.enabled` | `true` | Master switch for onboarding, its event, and its command. |
| `Config.Onboarding.trigger` | `"auto"` or `"manual"` | Automatically show an incomplete first run after a logged-in, uninterrupted five-second UI availability check, or wait for an integration event. |
| `Config.DriverPermissionAsPassenger` | `false` | Gives passengers driver-style vehicle access where supported. |
| `Config.SettingsLocked` | `false` | Forces saved settings to follow `Config.DefaultSettings` and blocks user changes/imports. |
| `Config.CinematicHeight` | `0.1` | Cinematic bar height sent to the NUI. |
When `Config.SettingsLocked` is true, server defaults are the source of truth. Users cannot bypass them with onboarding, Settings Share, saved browser data, or control-panel edits.
See [Onboarding](/docs/orbit-studios-resources/orbit-dynamichud-v2/onboarding) for automatic/manual behavior, trigger examples, command semantics, and integration scenarios.
## Commands [#commands]
Client commands are independently switchable:
```lua title="resources/[orbit]/orbit-dynamichud-v2/shared/config.lua"
Config.Commands = {
controlpanel = { enabled = true },
customize = { enabled = true },
music = { enabled = true },
carcontrol = { enabled = true },
settings = { enabled = true },
settingsshare = { enabled = true },
editmode = { enabled = true },
restarthud = { enabled = true },
engine = { enabled = true },
onboarding = { enabled = true }
}
```
Cash, bank, and stress commands are configured in `server/config.lua` with an `enabled` switch and optional `ox_lib` restriction group. See [Commands](/docs/orbit-studios-resources/orbit-dynamichud-v2/commands) for every command and parameter.
## Phone offset [#phone-offset]
```lua title="resources/[orbit]/orbit-dynamichud-v2/shared/config.lua"
Config.PhoneOffset = {
enabled = false,
side = 'right',
offset = 18.0,
openEvent = 'orbit-dynamichud:phoneOpened',
closeEvent = 'orbit-dynamichud:phoneClosed'
}
```
`side` is `left` or `right`; `offset` is clamped from `0` to `50` vh. Trigger the configured events when the phone opens/closes. The open event may receive a side override. Full examples are in [Events and State Bags](/docs/orbit-studios-resources/orbit-dynamichud-v2/events#phone-open-and-close-events).
## Dynamic Bar and widgets [#dynamic-bar-and-widgets]
```lua title="resources/[orbit]/orbit-dynamichud-v2/shared/config.lua"
Config.DynamicBar = {
mode = 'free',
hourFormat = '24',
postCodes = false
}
```
| `mode` | Result |
| ------------ | ------------------------------------------------------------- |
| `disabled` | Hide both Dynamic Bar and widgets and stop their update work. |
| `free` | Let users choose `dynamicbar` or `widgets`. |
| `dynamicbar` | Force the Dynamic Bar. |
| `widgets` | Force widgets. |
`hourFormat` supports `"24"` and `"12"`. `postCodes` enables postcode loading/display. Invalid mode values print a warning and fall back to `free`.
Default widget configuration lives in `Config.DefaultSettings.dynamicbar_widgets`:
```lua title="resources/[orbit]/orbit-dynamichud-v2/shared/settingsConfig.lua"
dynamicbar_mode = 'dynamicbar',
dynamicbar_widgets = {
weather = {
enabled = true,
size = 'default' -- default or mini
},
statuses = {
{
enabled = true,
priorities = {
'song', 'laststand', 'dead', 'oxygen',
'navigation', 'drive', 'walking'
}
},
{
enabled = false,
priorities = {
'oxygen', 'song', 'laststand', 'dead',
'navigation', 'drive', 'walking'
}
}
}
}
```
Each status widget must contain every supported priority exactly once. The first item has the highest priority.
## Performance and map [#performance-and-map]
```lua title="resources/[orbit]/orbit-dynamichud-v2/shared/config.lua"
Config.PerformanceSettings = {
performance = 300,
balanced = 100,
ultra = 30
}
Config.CustomMap = {
usingCustomMap = true,
radarZoom = 1100,
waitTime = 300
}
```
Performance values are client refresh intervals in milliseconds. Lower values are more responsive and use more client time. `Config.CustomMap` repeatedly reapplies radar zoom for map resources that overwrite it; disable it when unnecessary.
`Config.WaypointNavigation` controls a separate GPS thread. When enabled, every client performs one lightweight waypoint/vehicle availability check at `idleInterval`; distance, direction, route, and color natives run only while that client is the driver and has an active waypoint. This may add a small client cost for drivers. Set `enabled = false` to avoid creating the thread and all of its waypoint work.
## Keybinds [#keybinds]
```lua title="resources/[orbit]/orbit-dynamichud-v2/shared/config.lua"
Config.Keybinds = {
indicator_keybinds = {
right_indicator_keybind = 'RIGHT',
left_indicator_keybind = 'LEFT',
hazard_indicator_keybind = 'UP'
},
ui_keybinds = {
focus_ui = { enabled = true, key = 'F4' },
customize = { enabled = false, key = 'F5' },
music = { enabled = false, key = 'F6' },
carcontrol = { enabled = false, key = 'F7' },
settings = { enabled = false, key = 'F9' }
}
}
```
These are `ox_lib` keybind defaults. Each UI entry has an independent `enabled` switch and configurable `key`. Players can remap registered keybinds through FiveM settings. Disabled or unavailable control-panel tabs do not register their tab-specific bind. The original string form, such as `focus_ui = 'F4'`, remains supported for existing configurations.
## Fuel integration [#fuel-integration]
The speedometer expects a number from `Config.GetVehicleFuelLevel`:
```lua title="Native fuel example"
Config.GetVehicleFuelLevel = function(vehicle)
if not vehicle then return 0.0 end
return GetVehicleFuelLevel(vehicle) or 0.0
end
```
Replace the function when a fuel resource owns the value:
```lua title="Custom fuel example"
Config.GetVehicleFuelLevel = function(vehicle)
return exports['my-fuel']:GetFuel(vehicle) or 0.0
end
```
Keep this getter fast because it runs in the vehicle update path.
## Statuses and accounts [#statuses-and-accounts]
```lua title="resources/[orbit]/orbit-dynamichud-v2/shared/config.lua"
Config.EnabledValues = {
health = true,
armor = true,
hunger = true,
thirst = true,
stamina = true,
stress = true
}
Config.Accounts = {
cash = true,
bank = true,
dirty = false
}
```
Set supported entries to false to remove them. Do not add arbitrary status/account keys; the frontend settings schema is strict.
## Control-panel modules [#control-panel-modules]
`Config.ControlPanel` controls both navigation visibility and whether corresponding client/server work is enabled.
```lua title="resources/[orbit]/orbit-dynamichud-v2/shared/config.lua"
Config.ControlPanel = {
enableControlPanel = true,
customize = {
enabled = true,
color_picker = true,
status_selector = true,
shape_selector = true,
player_info_selector = {
enabled = true,
current_status = true,
show_player_data_bg = true
},
speedometer_selector = true
},
music = {
enabled = true,
play = true,
playlists = true,
music_settings = true,
onlyLocalMusic = false,
dynamicSounds = true,
refreshSoundPosition = 750,
maxDistancePhone = 30.0,
maxDistanceCar = 60.0
},
carControl = {
enabled = true,
mode = "owner",
neon = true
},
settings = {
enabled = true,
display = {
enabled = true,
speed_unit = true,
active_weapon = true,
cinematic_mode = true,
show_hud_bg = true,
hud_16_9 = true,
vehicle_preview = true
},
audio = {
enabled = true,
music_enabled = true,
sounds_enabled = true
},
performance_settings = true,
edit_mode = true,
panel_theme = {
enabled = true,
center_control_panel = true
}
}
}
```
The omitted `settingsShare` group is documented on [Settings Sharing](/docs/orbit-studios-resources/orbit-dynamichud-v2/settings-sharing).
### Music behavior [#music-behavior]
* `enabled = false` disables all music features, including server-side dynamic audio.
* `onlyLocalMusic = true` keeps headphones playback in the frontend and disables phone/car modes, playlist sharing, and server 3D-audio work.
* `dynamicSounds = false` leaves local playback available but prevents server-distributed phone/car sound.
* `refreshSoundPosition` has a minimum runtime value of 50 ms.
* `maxDistancePhone` and `maxDistanceCar` are world-unit distance limits.
* Music mode is session-only and initializes as headphones mode; it is not stored in saved/default settings.
* Saved playlists live in the player's NUI storage rather than the Settings Share database. The current frontend limit is 20 saved playlists with 50 tracks per playlist.
* Playlist share codes are server-memory only, limited to one active code per player, and expire when replaced, removed, the owner disconnects, or the resource/server restarts.
* A YouTube playlist URL can add its resolved tracks in one operation; individual supported HTTPS music links can be added directly.
### Car control behavior [#car-control-behavior]
The tab is available only while in a vehicle. Runtime vehicle types are normalized to `car`, `motorcycle`, `bike`, `boat`, `plane`, or `helicopter`. `neon = false` disables neon mode independently.
`carControl.mode` supports two values:
* `"owner"` allows only the vehicle's current FiveM network owner to use car controls. This is network ownership, which FiveM may migrate between clients; it is not framework or database vehicle ownership.
* `"realistic"` gives the driver access to every control. Any occupant may switch seats, while passengers in the first three passenger seats may operate only the door and window beside their current seat.
Unknown mode values fail closed to `"owner"`. The client provides immediate feedback, and the server independently verifies the configured mode, requesting player, occupied vehicle, seat, action, value, and network owner before relaying a control. Vehicle capability, installed-neon, available door/window, seat, and driver-permission checks still apply after the UI is visible.
## Default player settings [#default-player-settings]
`shared/settingsConfig.lua` mirrors the complete frontend settings schema. Existing saved settings continue to apply unless settings are locked or the user resets them.
| Setting | Supported values/default |
| ------------------------ | -------------------------------------------------------------------------------------- |
| `preset` | `performance`, `balanced`, `ultra`; default `balanced` |
| `unit` | `kmh`, `mph`; default `kmh` |
| `shape` | `square`, `circle`, `hexagon`; default `square` |
| `hud` | `waveseries`, `serenity`, `proseries`, `proecho`, `bubblegum`, `simple` |
| `speedometer` | `Apex`, `ARCD_LINE`, `ARCD_ARC`, `Eclipse`, `Heat`, `PRO`, `ZoxOne`, `Glide`, `Motion` |
| `control_panel_theme` | `default`, `monochrome-dark`, `monochrome-light` |
| `center_control_panel` | `false`; place the control panel at screen center when enabled |
| `dynamicbar_mode` | `dynamicbar` or `widgets` when server policy is `free` |
| `player_data.variant` | `cinder_edge`, `cinder_flow`, `specter`, `gridline` |
| `player_data.color_mode` | `colored`, `monochrome` |
The settings object also contains:
* `speedometer_color` index per speedometer
* icon index, RGB color, opacity, icon RGB color, and icon opacity per status
* `active_weapon`, `hud_16_9`, `show_vehicle_preview`, `center_control_panel`, and player-data toggles
* Dynamic Bar widget configuration/priorities
* status, component, speedometer, and map layouts
* UI/music enable and volume values
* HUD/player-data background visibility
### Layout helper [#layout-helper]
Every configured layout is generated with:
```lua title="resources/[orbit]/orbit-dynamichud-v2/shared/settingsConfig.lua"
local function layout(options)
if type(options) == 'boolean' then
options = { visible = options }
end
options = options or {}
return {
x = options.x or 0,
y = options.y or 0,
scale = options.scale or 1,
rotation = options.rotation or 0,
locked = options.locked == true,
visible = options.visible ~= false,
canChangeVisibility = options.canChangeVisibility ~= false
}
end
```
`canChangeVisibility` is a server default policy and is not stored as a player preference. Set `visible = true, canChangeVisibility = false` to force an element visible. The map ignores rotation.
Do not remove layout keys. Settings Share and saved-setting validation require the complete schema.
## Framework and state sources [#framework-and-state-sources]
DynamicHUD 2.0 consumes normalized player data from `orbit-lib`, common framework events, and replicated state bags. Use [Events and State Bags](/docs/orbit-studios-resources/orbit-dynamichud-v2/events) for exact integration names.
Death-state values are:
| Value | Meaning |
| ----: | ---------- |
| `1` | Alive |
| `2` | Last stand |
| `3` | Dead |
For custom medical resources, set server-owned state:
```lua title="resources/[custom]/server/main.lua"
Player(source).state:set('hud:deathState', 3, true)
```
For inventory visibility, prefer a replicated `invOpen` player state. Alternatively call the server `toggleHud` export from open/close handlers.
## Weapons and ammo [#weapons-and-ammo]
```lua title="resources/[orbit]/orbit-dynamichud-v2/shared/weapons.lua"
Config.AmmoInfo = {
getAmmoFrom = 'inventory' -- inventory or reserve
}
Config.Weapons[`weapon_customrifle`] = {
name = 'weapon_customrifle',
label = 'Custom Rifle',
ammotype = 'ammo-rifle'
}
```
| Field | Description |
| ---------- | ------------------------------------------------------------------------------- |
| `name` | Inventory item name. |
| `label` | Displayed weapon name. The unarmed label is not localized automatically. |
| `ammotype` | Inventory ammo item or native ammo type. Use `nil` when no ammo should display. |
Use `getAmmoFrom = 'inventory'` for item-based ammo and `reserve` for GTA native reserve ammo.
## Settings Share server config [#settings-share-server-config]
Database limits, upload cooldowns, moderation permissions, and FiveManage thumbnail uploads live in `server/config.lua`. See [Settings Sharing](/docs/orbit-studios-resources/orbit-dynamichud-v2/settings-sharing) for the full matrix and security model.
# Custom Street Names (/docs/orbit-studios-resources/orbit-dynamichud-v2/custom-location-names)
# Custom Street Names [#custom-street-names]
Add aliases in `shared/config.lua`. The client registers them once when the HUD resource starts. The Orbit HUD displays street names, not zone names. Optional zone aliases change GTA text entries that other interfaces may use. A street alias can also appear in other GTA UI that uses the same text entry.
```lua title="resources/[orbit]/orbit-dynamichud-v2/shared/config.lua"
Config.CustomLocationNames = {
enabled = true,
streets = {
[0x7999837] = "My Road", -- Replace with the street's actual hash
},
zones = {}, -- Optional GTA zone aliases; not shown by the Orbit HUD
}
```
Street keys are numeric street hashes from `GetStreetNameAtCoord`. Their replacements are the text shown by `GetStreetNameFromHashKey`. Use the actual hash for the road you intend to rename.
## Find a hash [#find-a-hash]
Use the [GTA V street and zone hash reference](https://github.com/zoxile/gtav-street-zone-hashes) to find a street hash. Its street entries use hexadecimal numbers such as `0x7999837` (Route 68). If the reference is unavailable, you can also check the [public street list](https://github.com/jgscripts/gtav-street-zone-hashes/blob/main/streets.txt).
You can confirm a location in-game with a temporary **client-side** command:
```lua
RegisterCommand('streethash', function()
local coords = GetEntityCoords(PlayerPedId())
local streetHash = GetStreetNameAtCoord(coords.x, coords.y, coords.z)
print(('Street: 0x%X'):format(streetHash))
end)
```
Put the numeric hash in square brackets without quotation marks. Remove the temporary command after checking your map.
## Optional zone aliases [#optional-zone-aliases]
The Orbit HUD does not display GTA zone names. If another game interface on your server uses GTA's zone text entries, you can also add aliases to `zones`:
```lua
zones = {
AIRP = "LAX Airport", -- Code returned by GetNameOfZone
}
```
Zone keys are uppercase codes from `GetNameOfZone`, not street hashes. You can find them in the [same hash reference](https://github.com/zoxile/gtav-street-zone-hashes) or the [public zone list](https://github.com/jgscripts/gtav-street-zone-hashes/blob/main/zones.txt). The replacement is used by GTA text lookups such as `GetLabelText`; it does not add a zone field to the HUD.
Set `enabled = false` to skip registration entirely. Restart the resource after editing aliases. The Admin HUD can also stage these mappings, but its changes take effect on restart. Each mapping is limited to 512 entries and each replacement to 80 bytes when edited through the Admin HUD.
This feature changes GTA text entries, not street geometry or the road network. Other scripts reading those same game text entries may show the custom name too. Set each alias once at startup; do not call `AddTextEntryByHash` every frame.
# Dependencies (/docs/orbit-studios-resources/orbit-dynamichud-v2/dependencies)
# Dependencies [#dependencies]
## Required [#required]
| Dependency | Why it is needed | Link |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| `ox_lib` | Cache helpers, locales, callbacks, keybinds, commands, and runtime utilities. | [overextended/ox\_lib](https://github.com/overextended/ox_lib) |
| `orbit-lib` | Normalized framework player/inventory data and Orbit resource integration. | [orbit-lib docs](/docs/orbit-studios-resources/orbit-lib) |
| `oxmysql` | Required by the current resource manifest; Settings Share uses it to store presets, likes, downloads, ownership, and moderation data. | [overextended/oxmysql](https://github.com/overextended/oxmysql) |
| Supported framework | ESX, QB-Core, QBX, or the configured standalone adapter in `orbit-lib`. | [orbit-lib configuration](/docs/orbit-studios-resources/orbit-lib/configuration) |
Settings Share is enabled by default. Disabling it skips its database work, but the current manifest still lists `oxmysql` as a dependency and loads its Lua library. Start `oxmysql` before DynamicHUD 2.0; do not remove its manifest entries.
## Optional integrations [#optional-integrations]
| Dependency | Feature |
| ------------------------- | -------------------------------------------------------------------------------------------------- |
| `screenshot-basic` | One supported Settings Share capture provider. Install it only when selected in `captureProvider`. |
| `screencapture` | Alternative Settings Share capture provider. Install it only when selected in `captureProvider`. |
| FiveManage API key | Hosts uploaded preset screenshots through a server-requested presigned URL. |
| `orbit-dynamichud-addons` | Orbit seatbelt and cruise-control integration. |
| `orbit-dynamichud-stress` | Replicated stress gain, relief, and effects. |
| `pma-voice` | Voice/radio state on servers using pma-voice. |
| Supported inventory | Inventory-backed ammo, item counts, and inventory-open state. |
| Custom fuel resource | Fuel values through `Config.GetVehicleFuelLevel`. |
See [Settings Sharing](/docs/orbit-studios-resources/orbit-dynamichud-v2/settings-sharing#thumbnail-capture) before enabling screenshots, then follow [FiveManage Setup](/docs/orbit-studios-resources/orbit-dynamichud-v2/fivemanage) to create and secure the API key. Keep the key in a server convar, never in shared/client code.
## Start order [#start-order]
```properties title="server.cfg"
ensure ox_lib
ensure oxmysql
ensure [framework-resources]
ensure [inventory]
ensure orbit-lib
# Only required when preset screenshots are enabled. Start the provider
# selected by Config.SettingsShareServer.thumbnail.captureProvider.
ensure screencapture
# ensure screenshot-basic
ensure orbit-dynamichud-v2
# Optional integrations
ensure orbit-dynamichud-addons
ensure orbit-dynamichud-stress
```
Replace `[framework-resources]` and `[inventory]` with your actual resource names or folder groups; they are placeholders, not dependencies to install. Start only the screenshot provider selected in your thumbnail config, and omit both providers if custom screenshots are disabled.
The selected framework must be available before `orbit-lib`. Start optional state providers after the base HUD unless their own documentation requires otherwise.
## Feature failure behavior [#feature-failure-behavior]
* Missing `ox_lib`, `orbit-lib`, or `oxmysql` prevents the resource from starting because all three are manifest dependencies.
* A missing/mismatched capture provider or missing API credentials disables custom screenshot capture; preset uploads can continue with fallback previews.
* Setting `music.onlyLocalMusic = true` avoids all server-side dynamic-sound work and does not need an external audio resource.
# Events and State Bags (/docs/orbit-studios-resources/orbit-dynamichud-v2/events)
# Events and 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 [#public-events]
| Event | Context | Parameters | Purpose |
| ------------------------------------------ | -------------------- | ------------------------- | ----------------------------------------------------------------------------------- |
| `orbit-dynamichud:notify` | client | `data` | Show a notification. May be sent with `TriggerClientEvent` from the server. |
| `orbit-dynamichud:showTextUI` | client | `text, options?` | Show or replace Text UI. May be sent with `TriggerClientEvent`. |
| `orbit-dynamichud:hideTextUI` | client | none | Hide Text UI. May be sent with `TriggerClientEvent`. |
| `orbit-dynamichud:openControlPanel` | client | `category?, subcategory?` | Open the control panel, optionally at an enabled page. |
| `orbit-dynamichud:client:openOnboarding` | client | none | Open an incomplete onboarding flow; intended for manual onboarding integrations. |
| `orbit-dynamichud:client:closeOnboarding` | client | none | Close the current onboarding flow and clear its onboarding state and focus. |
| `hud:server:toggleHud` | server network event | `visible` | Set the calling player's replicated HUD visibility. Client export use is preferred. |
| `orbit-dynamichud:standalone:playerLoaded` | client | none | Tell a standalone installation to reload normalized player data after login. |
| `orbit-dynamichud:progressBarOver` | local client event | `result` | Observe a progress-bar NUI result. The blocking export return is preferred. |
| `orbit-dynamichud:skillCheckOver` | local client event | `result` | Observe a skill-check NUI result. The blocking export return is preferred. |
See [Interface APIs](/docs/orbit-studios-resources/orbit-dynamichud-v2/interface) for notification, Text UI, progress bar, and skill-check payloads.
## Trigger and close onboarding [#trigger-and-close-onboarding]
From another client resource:
```lua title="resources/[custom]/client/main.lua"
TriggerEvent('orbit-dynamichud:client:openOnboarding')
```
Close the current flow from another client resource:
```lua title="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:
```lua title="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](/docs/orbit-studios-resources/orbit-dynamichud-v2/onboarding) for the complete mode and lifecycle guide.
## Open a control-panel page [#open-a-control-panel-page]
```lua title="resources/[custom]/client/main.lua"
TriggerEvent('orbit-dynamichud:openControlPanel', 'customize', 'shape_selector')
```
From a server script, target the player:
```lua title="resources/[custom]/server/main.lua"
TriggerClientEvent(
'orbit-dynamichud:openControlPanel',
source,
'settings',
'audio'
)
```
Supported category and subcategory IDs are:
| Category | Subcategories |
| ---------------- | --------------------------------------------------------------------------------------------------- |
| `customize` | `color_picker`, `status_selector`, `shape_selector`, `player_info_selector`, `speedometer_selector` |
| `music` | `play`, `playlists`, `music_settings` |
| `car_control` | none |
| `settings_share` | none |
| `settings` | `display`, `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 [#phone-open-and-close-events]
The event names are configurable in `Config.PhoneOffset`:
```lua title="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:
```lua title="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 [#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.
| Event | Parameters | Behavior |
| -------------------------------- | -------------------------- | ------------------------------------------------------------------------------------------- |
| `esx:setAccountMoney` | `account` | Updates `money`, `bank`, `black_money`, or `dirty` from `account.name` and `account.money`. |
| `esx_status:onTick` | `statuses` | Reads hunger and thirst percentages from the ESX status array. |
| `hud:client:OnMoneyChange` | `account, amount, isMinus` | Applies a cash, bank, dirty, or black-money delta. |
| `hud:client:UpdateNeeds` | `hunger, thirst` | Replaces QB/QBX needs values. |
| `hud:client:UpdateStress` | `stress` | Replaces the stress value. |
| `QBCore:Client:OnPlayerLoaded` | none | Reloads normalized HUD player data after the QB player is ready. |
| `esx:onPlayerSpawn` | `xPlayer, skin` | Reloads normalized HUD player data after an ESX spawn. |
| `seatbelt:client:ToggleSeatbelt` | none | Re-reads the local `seatbelt` or `harness` state. |
| `seatbelt:client:ToggleCruise` | none | Toggles the compatibility cruise value. A `cruiseControl` state bag is preferred. |
| `hud:client:UpdateNitrous` | `unused, level, active` | Deprecated QB-style nitrous update. Vehicle state bags are preferred. |
```lua title="resources/[custom]/client/needs.lua"
TriggerEvent('hud:client:UpdateNeeds', 82, 64)
TriggerEvent('hud:client:UpdateStress', 15)
```
## State bags [#state-bags]
### Player state [#player-state]
| Key | Value | Purpose |
| ------------------------ | ---------------- | ------------------------------------------------------------ |
| `hud:showHud` | `boolean` | Master HUD visibility. |
| `hud:deathState` | `1`, `2`, or `3` | `1` alive, `2` last stand, `3` dead. |
| `hunger` | `number` | Hunger percentage/value. |
| `thirst` | `number` | Thirst percentage/value. |
| `stress` | `number` | Stress percentage/value. |
| `invOpen` | `boolean` | Hides the HUD while an inventory is open. |
| `seatbelt` | `boolean` | Seatbelt indicator. |
| `harness` | `boolean` | Compatibility fallback read with seatbelt state. |
| `cruiseControl` | `boolean` | Cruise-control indicator. |
| `qbx_medical:deathState` | framework value | Mirrored into `hud:deathState` by the QBX bridge. |
| `proximity` | table | Reads the pma-voice-compatible `mode` value for voice range. |
| `disableRadio` | number | pma-voice-compatible radio availability state. |
| `radioChannel` | number | Current pma-voice-compatible radio channel. |
Set authoritative player state on the server with replication enabled:
```lua title="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:
```lua title="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 [#vehicle-state]
DynamicHUD 2.0 reads these state bags from the current vehicle:
| Key | Value | Purpose |
| ------------- | --------- | ------------------------------------------------------------------------------------------------ |
| `nitro` | `number` | Current nitrous level. |
| `nitroFlames` | `boolean` | Whether nitrous is actively firing. |
| `hasNeons` | `table` | Installed neon sides used by Car Control (`neonLeft`, `neonRight`, `neonFront`, and `neonBack`). |
```lua title="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 2.0 checks that the changed vehicle matches the player's current vehicle before updating the speedometer.
### Global state [#global-state]
DynamicHUD 2.0 publishes server population values for its own player-count UI. Other resources may read them without polling `GetPlayers()`:
| Key | Value | Purpose |
| ---------------------------- | -------- | ---------------------------------------------------------- |
| `GlobalState.currentPlayers` | `number` | Current connected player count. |
| `GlobalState.maxPlayers` | `number` | `sv_maxclients`, initialized when the HUD resource starts. |
These values are outputs owned by DynamicHUD 2.0. Do not overwrite them from another resource.
## Inventory and death handlers [#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:
```lua title="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 [#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.
# Exports (/docs/orbit-studios-resources/orbit-dynamichud-v2/exports)
# Exports [#exports]
Exports are called from another resource. Client exports affect only the local player; the server `toggleHud` export accepts a target player source.
## Client exports [#client-exports]
| Export | Signature | Return | Purpose |
| -------------------- | --------------------------------- | ------------------ | -------------------------------------------------------------------------------------------------------------------------- |
| `notify` | `notify(data)` | none | Show a notification. |
| `Notify` | `Notify(data)` | none | Case-compatible alias of `notify`. |
| `showTextUI` | `showTextUI(text, options?)` | none | Show or replace the local Text UI prompt. |
| `hideTextUI` | `hideTextUI()` | none | Hide Text UI. |
| `isTextUIOpen` | `isTextUIOpen()` | `boolean, string?` | Return open state and current text. |
| `skillCheck` | `skillCheck(difficulty, inputs?)` | `boolean` | Run a blocking skill check. |
| `skillCheckActive` | `skillCheckActive()` | `boolean` | Test whether a skill check is active. |
| `cancelSkillCheck` | `cancelSkillCheck()` | none | Cancel the active skill check. |
| `progressBar` | `progressBar(data)` | `boolean` | Run a blocking progress action. |
| `progressActive` | `progressActive()` | `boolean` | Test whether a progress bar is active. |
| `cancelProgress` | `cancelProgress()` | none | Force-cancel the active progress bar. |
| `SeatbeltState` | `SeatbeltState(state)` | none | Set the local speedometer seatbelt indicator. |
| `CruiseControlState` | `CruiseControlState(state)` | none | Set the local speedometer cruise indicator. |
| `toggleHud` | `toggleHud(visible)` | none | Ask the server to replicate HUD visibility for the local player. |
| `getHudVisibility` | `getHudVisibility()` | `boolean` | Return whether the gameplay HUD is currently visible after temporary visibility gates are applied. |
| `getOnboardingState` | `getOnboardingState()` | `boolean` | Return the current local onboarding state. |
| `startOnboarding` | `startOnboarding()` | `boolean` | Request incomplete onboarding to start. Returns whether the request passed the client-side configuration and login guards. |
| `closeOnboarding` | `closeOnboarding()` | `boolean` | Close onboarding and return whether an active or pending onboarding state existed. |
Detailed option tables and examples for the first eleven exports are in [Interface APIs](/docs/orbit-studios-resources/orbit-dynamichud-v2/interface).
```lua title="resources/[custom]/client/main.lua"
exports['orbit-dynamichud-v2']:notify({
description = 'Saved successfully.',
type = 'success'
})
exports['orbit-dynamichud-v2']:showTextUI('[E] Interact')
local passed = exports['orbit-dynamichud-v2']:skillCheck('easy', { 'E' })
local completed = exports['orbit-dynamichud-v2']:progressBar({
label = 'Working',
duration = 3000
})
exports['orbit-dynamichud-v2']:hideTextUI()
```
## Vehicle state exports [#vehicle-state-exports]
Use the state bags described on the [Events and State Bags](/docs/orbit-studios-resources/orbit-dynamichud-v2/events#state-bags) page when your resource already owns replicated vehicle/player state. The exports are useful for older client-only integrations.
```lua title="resources/[custom]/client/seatbelt.lua"
exports['orbit-dynamichud-v2']:SeatbeltState(true)
exports['orbit-dynamichud-v2']:CruiseControlState(false)
```
`SeatbeltState` expects a truthy or false value. `CruiseControlState` forwards the supplied value to the UI. Call them only when state changes rather than every frame.
## HUD visibility [#hud-visibility]
The client export emits a source-bound server event that updates the calling player's replicated `hud:showHud` state:
```lua title="resources/[custom]/client/main.lua"
exports['orbit-dynamichud-v2']:toggleHud(false)
-- Show it again later.
exports['orbit-dynamichud-v2']:toggleHud(true)
```
Read the effective local visibility state when another resource needs to coordinate its own interface:
```lua title="resources/[custom]/client/main.lua"
local hudVisible = exports['orbit-dynamichud-v2']:getHudVisibility()
if hudVisible then
-- The gameplay HUD is currently being rendered.
end
```
This getter includes temporary visibility gates such as onboarding and game-menu state. It does not change the replicated `hud:showHud` value.
The server export accepts a player source first:
```lua title="resources/[custom]/server/main.lua"
exports['orbit-dynamichud-v2']:toggleHud(source, false)
```
## Server exports [#server-exports]
| Export | Signature | Return | Purpose |
| ----------- | ---------------------------- | ------ | ------------------------------------------------------------------- |
| `toggleHud` | `toggleHud(source, visible)` | none | Set `Player(source).state['hud:showHud']` with replication enabled. |
Validate the target source in network-facing code before calling the server export. Do not accept an arbitrary target from an untrusted client event without permission checks.
## Onboarding state and controls [#onboarding-state-and-controls]
Use the client exports when another local resource needs direct onboarding control:
```lua title="resources/[custom]/client/main.lua"
local onboardingState = exports['orbit-dynamichud-v2']:getOnboardingState()
if onboardingState then
local requested = exports['orbit-dynamichud-v2']:startOnboarding()
print(('Onboarding request accepted: %s'):format(requested))
end
-- Close the flow when an external setup or character flow takes over.
exports['orbit-dynamichud-v2']:closeOnboarding()
```
`startOnboarding` is non-forcing: it follows `Config.Onboarding`, `Config.SettingsLocked`, player-login, and completed-state guards. It does not reopen onboarding for a player who already completed it. `closeOnboarding` synchronizes the NUI state and releases onboarding focus without closing an unrelated HUD interface.
See [Onboarding](/docs/orbit-studios-resources/orbit-dynamichud-v2/onboarding) for automatic/manual modes and [Events and State Bags](/docs/orbit-studios-resources/orbit-dynamichud-v2/events#trigger-and-close-onboarding) for event-based integrations.
## Resource-stop cleanup [#resource-stop-cleanup]
Resources that show Text UI should hide it from their client `onResourceStop` handler. Cancel a skill check or progress bar only if your resource started it and still owns the active flow.
```lua title="resources/[custom]/client/main.lua"
AddEventHandler('onResourceStop', function(resourceName)
if resourceName ~= GetCurrentResourceName() then return end
exports['orbit-dynamichud-v2']:hideTextUI()
if exports['orbit-dynamichud-v2']:skillCheckActive() then
exports['orbit-dynamichud-v2']:cancelSkillCheck()
end
if exports['orbit-dynamichud-v2']:progressActive() then
exports['orbit-dynamichud-v2']:cancelProgress()
end
end)
```
# FiveManage Setup (/docs/orbit-studios-resources/orbit-dynamichud-v2/fivemanage)
# FiveManage API key setup [#fivemanage-api-key-setup]
FiveManage is required only when `Config.ControlPanel.settingsShare.thumbnails` is enabled. DynamicHUD 2.0 uses it to store player-approved Settings Share screenshots. Presets continue to work with generated fallback previews when thumbnails are disabled.
Never put the API key in `shared/config.lua`, client Lua, NUI code, frontend environment variables, screenshots, or a source repository. DynamicHUD 2.0 reads it from a server convar and never sends it to a player.
## Create the API key [#create-the-api-key]
1. [Create a FiveManage account](https://www.fivemanage.com/) or sign in to an existing account.
2. Create or select the team that should own the uploaded HUD thumbnails.
3. Open the [FiveManage dashboard](https://app.fivemanage.com/) and navigate to **Tokens**.
4. Select **Create token** and give it a recognizable name such as `Orbit Dynamic HUD 2.0 thumbnails`.
5. Choose the **Images** scope for least privilege. A **Media** token also works, but grants image, video, and audio access that this integration does not need.
6. Copy the generated token and store it as a protected server secret.
FiveManage documents the same account, team, and token flow in its [upload API first steps](https://docs.fivemanage.com/guides/uploading-files/first-steps). API keys are managed from the dashboard Tokens page.
## Configure DynamicHUD 2.0 [#configure-dynamichud-20]
Put the token in `server.cfg` before `orbit-dynamichud-v2` starts:
```properties title="server.cfg"
set orbit_fivemanage_api_key "YOUR_FIVEMANAGE_API_KEY"
```
Keep the server configuration pointed at that convar:
```lua title="resources/[orbit]/orbit-dynamichud-v2/server/config.lua"
Config.SettingsShareServer.thumbnail = {
captureProvider = 'screencapture', -- or 'screenshot-basic'
apiKey = GetConvar('orbit_fivemanage_api_key', ''),
presignedUrlEndpoint = 'https://api.fivemanage.com/api/v3/file/presigned-url',
fileEndpoint = 'https://api.fivemanage.com/api/v3/file',
deleteUnusedThumbnails = true
}
```
Enable thumbnails in the shared feature configuration:
```lua title="resources/[orbit]/orbit-dynamichud-v2/shared/config.lua"
Config.ControlPanel.settingsShare.thumbnails = true
```
Start exactly the capture provider selected in `captureProvider`, and start it before DynamicHUD 2.0:
```properties title="server.cfg"
# Choose one provider, matching server/config.lua.
ensure screencapture
# ensure screenshot-basic
ensure orbit-dynamichud-v2
```
You do not need to install the FiveManage SDK resource for this integration. DynamicHUD 2.0 requests FiveManage v3 presigned upload URLs through its own server module.
## How the key stays private [#how-the-key-stays-private]
1. The server validates the player, feature state, preset limits, cooldown, and upload request.
2. The server authenticates with FiveManage and requests a short-lived presigned URL.
3. The client captures the composed game and HUD frame and uploads only to that temporary URL.
4. The server validates the returned HTTPS host, storage marker, file path, and image bytes before saving the thumbnail.
5. When configured, the server deletes the managed file after its preset is deleted or receives a replacement thumbnail.
This follows FiveManage's recommended [presigned URL flow](https://docs.fivemanage.com/guides/uploading-files/presigned-urls): the permanent token stays on the server while the client receives temporary upload permission.
## Verify the setup [#verify-the-setup]
1. Temporarily set `Config.Debug = true`.
2. Restart `orbit-dynamichud-v2` rather than refreshing only the NUI.
3. Check the server console startup line for the selected provider, a started provider resource, and `apiKey=present`.
4. Open Settings Share, begin an upload, and capture a thumbnail.
5. Save privately or submit the preset. The staged image is uploaded only when that preset action is confirmed.
6. Confirm the thumbnail appears in the preset and in the FiveManage storage dashboard.
7. Return `Config.Debug` to its production value after verification.
## Troubleshooting [#troubleshooting]
| Symptom | Check |
| ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| API key reported missing | The `set orbit_fivemanage_api_key` line must appear before `ensure orbit-dynamichud-v2`; restart the resource after changing it. |
| Capture provider unavailable | The configured `screenshot-basic` or `screencapture` resource must be installed and started first. Names must match exactly. |
| FiveManage returns `401` | Regenerate or rotate the token and confirm it belongs to the intended team with Images or Media access. |
| Upload returns a disallowed host | Keep the default FiveManage CDN hosts, or explicitly add a trusted custom CDN hostname to `thumbnail.allowedHosts`. Never allow arbitrary hosts. |
| Capture succeeds but publishing fails | Check the server console for presigned URL, upload verification, cooldown, or database errors; check the client F8 console for capture-stage errors. |
| Repeated network timeouts | Keep retries bounded and review `uploadAttempts`, `retryDelayMs`, and `timeoutMs` rather than creating an unbounded retry loop. |
Rotate the token immediately if it is exposed. Update the convar, restart DynamicHUD 2.0, and revoke the old token in the FiveManage dashboard.
# Installation (/docs/orbit-studios-resources/orbit-dynamichud-v2)
# Orbit Dynamic HUD 2.0 [#orbit-dynamic-hud-20]
Orbit Dynamic HUD 2.0 is a configurable FiveM HUD with status variants, player information, Dynamic Bar/widgets, speedometers, vehicle controls, music, reusable interface APIs, edit mode, and database-backed settings presets.
For the official preview, showcase video, and store listing, start with the [Introduction](/docs/orbit-studios-resources/orbit-dynamichud-v2/introduction).
Install and use this resource only when it was obtained for your account through the official Cfx.re Portal. Support requires both the matching Cfx.re Portal entitlement and the original Tebex purchase ID; a Portal entitlement by itself is not sufficient proof of purchase. Copies from Discord, leaked packs, file-sharing sites, source repositories, or another customer are unauthorized and unsupported.
Use `orbit-dynamichud-v2` for the folder, `ensure` entry, exports, Orbit Lib provider selectors, and documentation URL. The v2 resource currently retains `orbit-dynamichud:*` for its public event namespace; copy those event names exactly as documented.
## Installation [#installation]
1. Download the release from the Cfx.re Portal account that owns the license.
2. Stop the server before installing or replacing resource files.
3. Extract the folder as `orbit-dynamichud-v2` without an extra nested directory.
4. Install `ox_lib`, the included `orbit-lib`, and `oxmysql`. The current resource manifest requires all three, even if Settings Share is disabled.
5. Configure `orbit-lib` for ESX, QB-Core, QBX, or standalone mode.
6. Review `shared/config.lua`, `shared/settingsConfig.lua`, and `server/config.lua`.
7. Start resources in dependency order.
8. Restart the server and join after framework player data has loaded.
```properties title="server.cfg"
ensure ox_lib
ensure oxmysql
ensure [framework-resources]
ensure [inventory]
ensure orbit-lib
ensure orbit-dynamichud-v2
```
Replace `[framework-resources]` and `[inventory]` with the actual names or folder groups on your server. See [Dependencies](/docs/orbit-studios-resources/orbit-dynamichud-v2/dependencies) for screenshot-provider start order.
The purchased release includes its compiled NUI; no frontend build step is required.
## Resource structure [#resource-structure]
Only edit documented public configuration, handler, weapon, car, and locale files. Runtime files are shown so server owners can verify that the release is complete; they are not an invitation to modify escrowed code.
## Framework setup [#framework-setup]
Configure ESX in `orbit-lib`. DynamicHUD 2.0 listens for ESX account/status/spawn events and the default handlers include ESX death-state support. Adapt `server/handlers.lua` if the medical or inventory resource uses different events.
Configure QB-Core in `orbit-lib`. DynamicHUD 2.0 supports common QB money, needs, stress, player-loaded, hospital, seatbelt, cruise, and nitrous compatibility events.
Configure QBX in `orbit-lib`. DynamicHUD 2.0 accepts common QB HUD events and QBX state bags such as medical death state and vehicle nitrous state.
Configure the standalone adapter in `orbit-lib`, then trigger `orbit-dynamichud:standalone:playerLoaded` after login and publish the documented player state bags from your resources.
## First-run verification [#first-run-verification]
1. Confirm no dependency, locale, database, or framework errors appear in either console.
2. Join with a fully loaded character and complete onboarding, or trigger it from your integration when manual mode is enabled.
3. Verify health, armor, needs, money, job, player count, and profile information.
4. Run `/controlpanel`, `/editmode`, and `/restarthud` if those commands are enabled.
5. Enter each supported vehicle type and verify speed, fuel, RPM, seatbelt, cruise, nitrous, and car control as applicable.
6. Test a notification, Text UI, skill check, and progress bar from a development resource.
7. Open `/settingsshare`, save a private preset, and test configured discovery/moderation features.
8. Verify the HUD hides/shows correctly with inventory, pause menu, death, and phone flows.
## Optional Orbit resources [#optional-orbit-resources]
* [Orbit DynamicHUD Addons](/docs/orbit-studios-resources/orbit-dynamichud-addons) for Orbit seatbelt/cruise integration
* [Orbit DynamicHUD Stress](/docs/orbit-studios-resources/orbit-dynamichud-stress) for stress gameplay and effects
## Support [#support]
When requesting support, include the client/server console error, framework and inventory names, relevant config section, reproduction steps, the matching Cfx.re Portal entitlement, and the original Tebex purchase ID. Both purchase records are required. Never post the complete paid resource publicly.
# Introduction (/docs/orbit-studios-resources/orbit-dynamichud-v2/introduction)
# Orbit Dynamic HUD 2.0 [#orbit-dynamic-hud-20]
Orbit Dynamic HUD 2.0 is a configurable FiveM HUD for player status, vehicle information, and on-screen interfaces. Players can adjust layouts and positioning, while server owners control defaults and integrations through the documented configuration files.
These pages document `orbit-dynamichud-v2`. The older DynamicHUD release is a separate resource with different configuration and is no longer supported. Keep the `-v2` resource name when installing or calling its exports.
## Video showcase [#video-showcase]
## What it includes [#what-it-includes]
* Responsive status layouts, Dynamic Bar widgets, and configurable speedometers.
* Vehicle controls and player-facing layout and positioning tools.
* Onboarding, notifications, Text UI, skill checks, and progress bars.
* Settings Share for saving and sharing layout presets when its database integration is enabled.
* ESX, QB-Core, QBX, and standalone integration through Orbit Lib.
## Get started [#get-started]
# Language Support (/docs/orbit-studios-resources/orbit-dynamichud-v2/language-support)
# Language Support [#language-support]
`orbit-dynamichud-v2` uses the `ox_lib` locale system. The same locale files supply text for the HUD, onboarding, control panel, settings sharing, interface modules, notifications, and configurable commands.
## Included Locales [#included-locales]
| Language | Locale | File |
| -------- | ------ | ----------------- |
| English | `en` | `locales/en.json` |
| German | `de` | `locales/de.json` |
| Spanish | `es` | `locales/es.json` |
| French | `fr` | `locales/fr.json` |
| Swedish | `sv` | `locales/sv.json` |
| Turkish | `tr` | `locales/tr.json` |
## Select A Locale [#select-a-locale]
Set the replicated `ox:locale` convar before starting the resource.
```properties title="server.cfg"
setr ox:locale en
ensure ox_lib
ensure orbit-lib
ensure orbit-dynamichud-v2
```
For Swedish, use `setr ox:locale sv`. Restart `orbit-dynamichud-v2` after changing the convar or a locale file.
## Customize Existing Text [#customize-existing-text]
Edit values in the active JSON file while keeping its keys and nesting intact. Frontend `defaultTranslations` is the source of truth for UI keys; `locales/en.json` is the reference structure for backend-only runtime text and commands.
```json title="locales/en.json"
{
"commands": {
"controlpanel": "controlpanel",
"customize": "customize",
"desc": {
"controlpanel": "Open the HUD control panel",
"customize": "Open HUD customization"
}
}
}
```
Command names are locale values, not hard-coded strings. Changing a command value changes the command players enter. Keep command descriptions and parameter labels translated as well.
Frontend defaults are the source of truth for UI keys. Backend-only runtime and command keys remain part of the English locale contract. Do not remove a key merely because it is not visible on the current page; validate the complete source tree first.
## Validate locale parity [#validate-locale-parity]
Frontend source builds include an automated audit that compares frontend defaults, the Lua-to-NUI bridge, all backend locale files, command nesting, and runtime usage:
```bash
npm run check:locales
```
Run it after adding, renaming, or removing a translation. The command reports unused frontend keys, missing Lua bridge entries, locale drift, and mismatched command structures. A successful result confirms that every bundled language has the same required keys.
## Add A Language [#add-a-language]
1. Copy `locales/en.json` to a new locale file such as `locales/pt.json`.
2. Translate values only. Preserve every key, object, placeholder, and value type.
3. Keep interpolation placeholders such as `%s`, `{name}`, or `{value}` unchanged when present.
4. Validate the file as JSON.
5. Set `setr ox:locale pt` and restart the resource.
If a translated key is missing, `ox_lib` may fall back or expose the unresolved key depending on where it is used. Keeping all locale files structurally aligned avoids mixed-language UI.
## API Text [#api-text]
Notification titles default to the localized `notification_info`, `notification_warning`, `notification_err`, or `notification_success` label when no title is supplied. Progress bars can use `labelTranslation` and `descriptionTranslation`; otherwise their `label` and `description` values are displayed literally.
See [Interface APIs](/docs/orbit-studios-resources/orbit-dynamichud-v2/interface) for those payloads and exact ox\_lib replacement guides, and [Commands](/docs/orbit-studios-resources/orbit-dynamichud-v2/commands) for every configurable command.
# Onboarding (/docs/orbit-studios-resources/orbit-dynamichud-v2/onboarding)
# Onboarding [#onboarding]
Orbit Dynamic HUD 2.0 can start onboarding automatically for a new player, wait for another resource to trigger it, or disable it completely. Completion is remembered by the NUI, while the backend configuration remains authoritative over whether onboarding is available.
## Configuration [#configuration]
Use the object form in `shared/config.lua`:
```lua title="resources/[orbit]/orbit-dynamichud-v2/shared/config.lua"
Config.Onboarding = {
enabled = true,
trigger = "auto", -- "auto" or "manual"
}
Config.Commands = {
controlpanel = { enabled = true },
customize = { enabled = true },
music = { enabled = true },
carcontrol = { enabled = true },
settings = { enabled = true },
settingsshare = { enabled = true },
editmode = { enabled = true },
restarthud = { enabled = true },
engine = { enabled = true },
onboarding = { enabled = true },
}
```
| Setting | Value | Effect |
| ------------------------------------ | ---------- | -------------------------------------------------------------------------------------------------------------- |
| `enabled` | `true` | Allow onboarding to start through the configured mode, public event, export, and optionally its command. |
| `enabled` | `false` | Disable onboarding starts completely. Public start calls remain safe no-ops and the command is not registered. |
| `trigger` | `"auto"` | Show onboarding automatically when an incomplete first run is ready. |
| `trigger` | `"manual"` | Keep an incomplete first run hidden until another resource triggers it. |
| `Config.Commands.onboarding.enabled` | `true` | Register the localized `/onboarding` command. |
| `Config.Commands.onboarding.enabled` | `false` | Disable only the command. The public event remains available while onboarding itself is enabled. |
The legacy boolean form is still accepted for compatibility: `true` means enabled with automatic triggering, while `false` disables onboarding. The object form is recommended because it exposes the trigger mode explicitly.
`Config.SettingsLocked = true` blocks onboarding regardless of its own configuration. This prevents onboarding from replacing server-enforced defaults.
## Automatic mode [#automatic-mode]
```lua title="resources/[orbit]/orbit-dynamichud-v2/shared/config.lua"
Config.Onboarding = {
enabled = true,
trigger = "auto",
}
```
Automatic mode is appropriate when DynamicHUD 2.0 can own the first-run flow. For an incomplete first run, the client waits until:
* normalized player data reports that the player is logged in
* another NUI is not holding focus
* the built-in Text UI is not already showing a prompt owned by another resource
Once those conditions are met, a localized Text UI notice counts down from five seconds. Only an uninterrupted five-second availability window counts. If another NUI takes focus or another Text UI prompt appears, DynamicHUD 2.0 hides only its own notice, resets the timer, and waits. The notice and full five-second countdown start again when the interface is free.
Translate the notice with the `onboarding_countdown` key in every enabled `locales/*.json` file. Keep the `%d` placeholder in the translated value; it is replaced with the current remaining second.
The countdown cannot mature in a character selector because it starts only after the normalized logged-in state becomes true. The availability watcher runs only for the initial incomplete automatic flow. Opening onboarding later through the command, event, or export bypasses both the watcher and countdown and requests focus directly.
Players who already completed onboarding do not see it automatically again.
## Manual mode [#manual-mode]
```lua title="resources/[orbit]/orbit-dynamichud-v2/shared/config.lua"
Config.Onboarding = {
enabled = true,
trigger = "manual",
}
```
Manual mode keeps first-run onboarding dormant until your login, character, spawn, or tutorial resource decides the player is ready. Trigger it after the player has loaded and the DynamicHUD 2.0 client resource has initialized.
### Trigger from a client resource [#trigger-from-a-client-resource]
```lua title="resources/[custom]/client/main.lua"
RegisterNetEvent("my-intro:client:finished", function()
TriggerEvent("orbit-dynamichud:client:openOnboarding")
end)
```
The equivalent client export returns whether the request passed the local configuration and login guards:
```lua title="resources/[custom]/client/main.lua"
local requested = exports['orbit-dynamichud-v2']:startOnboarding()
```
### Trigger from a server resource [#trigger-from-a-server-resource]
```lua title="resources/[custom]/server/main.lua"
local function finishPlayerSetup(playerSource)
TriggerClientEvent(
"orbit-dynamichud:client:openOnboarding",
playerSource
)
end
```
The event is intentionally non-forcing. It opens onboarding only when that client still has an incomplete onboarding state. Triggering it for somebody who already finished onboarding does nothing, so a server event cannot overwrite a completed player's choice.
Use manual mode when:
* a multicharacter resource must finish character selection first
* identity, apartment, or spawn selection owns the initial focus
* a server tutorial or cutscene should finish before HUD configuration
* the player starts in a routing bucket and should configure the HUD after leaving it
* framework data is not ready at the moment the HUD resource starts
Avoid triggering the event every tick or on every respawn. Call it once at the meaningful completion point in your flow. The completed-state check makes duplicate calls harmless, but they are still unnecessary work.
## Command and event behavior [#command-and-event-behavior]
| Entry point | Reopens completed onboarding | Starts automatic watcher | Requirements |
| ---------------------------------------- | ---------------------------- | ------------------------ | ------------------------------------------------------------------------- |
| Initial automatic run | No | Yes | `enabled = true`, `trigger = "auto"`, incomplete state, settings unlocked |
| `orbit-dynamichud:client:openOnboarding` | No | No | `enabled = true`, incomplete state, settings unlocked |
| `startOnboarding` export | No | No | `enabled = true`, incomplete state, player logged in, settings unlocked |
| `/onboarding` | Yes | No | onboarding enabled, command enabled, settings unlocked |
The localized `/onboarding` command is the support and testing path. It deliberately forces the flow open even after completion, but it does not change automatic/manual mode and does not create a background onboarding thread.
## Query or close onboarding [#query-or-close-onboarding]
Read the current state and close the flow from a client resource with exports:
```lua title="resources/[custom]/client/main.lua"
local onboardingState = exports['orbit-dynamichud-v2']:getOnboardingState()
if onboardingState then
exports['orbit-dynamichud-v2']:closeOnboarding()
end
```
The event form is suitable for both client and targeted server integrations:
```lua title="resources/[custom]/client/main.lua"
TriggerEvent('orbit-dynamichud:client:closeOnboarding')
```
```lua title="resources/[custom]/server/main.lua"
TriggerClientEvent(
'orbit-dynamichud:client:closeOnboarding',
playerSource
)
```
Closing is idempotent. It resets the onboarding flow in the NUI and releases focus only when onboarding is the interface using it. Use `getHudVisibility()` when another client resource also needs the gameplay HUD's current effective visibility.
## Recommended manual integration [#recommended-manual-integration]
1. Set `Config.Onboarding.trigger = "manual"`.
2. Keep `Config.Onboarding.enabled = true`.
3. Decide which existing resource owns the last step before normal gameplay.
4. Trigger `orbit-dynamichud:client:openOnboarding` once after that step and after player data is loaded.
5. Keep `/onboarding` enabled while testing, then decide whether players should retain that recovery command.
6. Test both a fresh client state and a client that already completed onboarding.
If the manual event does not open anything, verify that onboarding is enabled, settings are not locked, the player has not already completed onboarding, and the event is fired after `orbit-dynamichud-v2` starts. Use `/onboarding` to distinguish a completed-state no-op from a configuration or focus problem.
# Settings Sharing (/docs/orbit-studios-resources/orbit-dynamichud-v2/settings-sharing)
# Settings Sharing [#settings-sharing]
Settings Sharing lets players save multiple HUD presets, import validated JSON, exchange temporary private codes, and publish presets to a searchable community gallery. The server remains authoritative over ownership, limits, likes, downloads, moderation, and the complete settings schema.
## Requirements [#requirements]
* `ox_lib` callbacks
* `oxmysql` and `@oxmysql/lib/MySQL.lua`
* One capture provider, either `screenshot-basic` or `screencapture`, only when uploaded thumbnails are enabled
* A server-side FiveManage API key only when uploaded thumbnails are enabled
Use the [FiveManage Setup guide](/docs/orbit-studios-resources/orbit-dynamichud-v2/fivemanage) to create a least-privilege Images token, store it as a server convar, configure the capture provider, and verify the complete upload path.
```properties title="server.cfg"
ensure ox_lib
ensure oxmysql
# Configure credentials before orbit-dynamichud-v2 starts.
set orbit_fivemanage_api_key "YOUR_FIVEMANAGE_API_KEY"
# Start only the provider selected by captureProvider.
ensure screencapture
# ensure screenshot-basic
ensure orbit-lib
ensure orbit-dynamichud-v2
```
The resource manifest must include:
```lua title="fxmanifest.lua"
dependency 'oxmysql'
server_script '@oxmysql/lib/MySQL.lua'
```
## Feature configuration [#feature-configuration]
All player-facing feature gates live in `Config.ControlPanel.settingsShare`.
```lua title="resources/[orbit]/orbit-dynamichud-v2/shared/config.lua"
Config.ControlPanel.settingsShare = {
enabled = true,
controlPanelTab = true,
standalonePage = true,
discovery = true,
localPresets = true,
manualImport = true,
privateSharing = true,
publicSharing = true,
moderation = true,
requireApproval = true,
thumbnails = true,
maxPresets = 12,
maxPublicPresets = 4,
maxPresetNameLength = 30,
maxPayloadBytes = 131072
}
```
| Setting | Default | Effect |
| --------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------- |
| `enabled` | `true` | Master switch. When false, client and server Settings Share logic stop. |
| `controlPanelTab` | `true` | Show the UI Presets launcher in the control panel when `standalonePage` is also enabled. |
| `standalonePage` | `true` | Allow the full Settings Share page, including entry from the control panel and `/settingsshare`. |
| `discovery` | `true` | Browse, search, filter, like, and download published presets. |
| `localPresets` | `true` | Save and update database-backed private presets. |
| `manualImport` | `true` | Import a complete settings JSON document. |
| `privateSharing` | `true` | Generate/import temporary private share codes. |
| `publicSharing` | `true` | Submit or publish presets to discovery. |
| `moderation` | `true` | Enable administrator Awaiting and Declined views. |
| `requireApproval` | `true` | Send public uploads to Awaiting review. It only applies when moderation is also enabled. |
| `thumbnails` | `true` | Enable the selected capture provider and FiveManage screenshot pipeline. Fallback previews remain available when false. |
| `maxPresets` | `12` | Total private, awaiting, declined, and public database presets owned by one player. Clamped to `1-50`. |
| `maxPublicPresets` | `4` | Public preset cap per player. Clamped to `1-20` and never above `maxPresets`. |
| `maxPresetNameLength` | `30` | Name limit. The server absolute maximum is 30 bytes. |
| `maxPayloadBytes` | `131072` | Maximum serialized settings payload. Clamped to `16384-524288`. |
`Config.SettingsLocked = true` disables Settings Share because imported or downloaded data cannot be allowed to replace server-enforced defaults.
### Common feature combinations [#common-feature-combinations]
```lua title="Private presets only"
Config.ControlPanel.settingsShare = {
enabled = true,
controlPanelTab = true,
standalonePage = true,
discovery = false,
localPresets = true,
manualImport = true,
privateSharing = false,
publicSharing = false,
moderation = false,
requireApproval = false,
thumbnails = false,
maxPresets = 12,
maxPublicPresets = 1,
maxPresetNameLength = 30,
maxPayloadBytes = 131072
}
```
```lua title="Public uploads without approval"
Config.ControlPanel.settingsShare.publicSharing = true
Config.ControlPanel.settingsShare.discovery = true
Config.ControlPanel.settingsShare.moderation = false
Config.ControlPanel.settingsShare.requireApproval = false
```
```lua title="Hide only the control-panel launcher"
Config.ControlPanel.settingsShare.controlPanelTab = false
Config.ControlPanel.settingsShare.standalonePage = true
```
## Server limits and moderation [#server-limits-and-moderation]
```lua title="resources/[orbit]/orbit-dynamichud-v2/server/config.lua"
Config.SettingsShareServer = {
adminAce = 'orbit.settingsshare.admin',
maxStoredPresets = 250,
maxListResults = 60,
requestWindowSeconds = 10,
privateShareTtlSeconds = 900,
presetUploadCooldownSeconds = 300,
thumbnail = {
captureProvider = 'screencapture',
apiKey = GetConvar('orbit_fivemanage_api_key', ''),
presignedUrlEndpoint = 'https://api.fivemanage.com/api/v3/file/presigned-url',
fileEndpoint = 'https://api.fivemanage.com/api/v3/file',
deleteUnusedThumbnails = true,
allowedHosts = {
'r2.fivemanage.com',
'cdn.fivemanage.com'
},
encoding = 'jpg',
quality = 0.85,
timeoutMs = 15000,
maxWidth = 1920,
maxHeight = 1080,
captureAttempts = 3,
captureRetryDelayMs = 350,
uploadAttempts = 3,
retryDelayMs = 600
}
}
```
| Setting | Default | Server bounds/purpose |
| ---------------------------------- | --------------------------- | --------------------------------------------------------------------------------------------------------------- |
| `adminAce` | `orbit.settingsshare.admin` | ACE required for moderation actions. |
| `maxStoredPresets` | `250` | Global database preset cap, clamped to `10-10000`. |
| `maxListResults` | `60` | Maximum rows returned per list request, clamped to `10-200`. |
| `requestWindowSeconds` | `10` | Per-player action-rate window, clamped to `2-60` seconds. |
| `privateShareTtlSeconds` | `900` | In-memory private-code lifetime, clamped to `60-86400` seconds. |
| `presetUploadCooldownSeconds` | `300` | Delay after a successful save/update, clamped to `0-3600`. `0` disables it. |
| `thumbnail.captureProvider` | `screencapture` | Capture resource to use: `screenshot-basic` or `screencapture`. Invalid values fall back to `screenshot-basic`. |
| `thumbnail.apiKey` | convar | FiveManage key. Keep it server-side. |
| `thumbnail.presignedUrlEndpoint` | FiveManage v3 endpoint | Endpoint used to request a presigned upload URL. |
| `thumbnail.fileEndpoint` | FiveManage v3 file endpoint | Endpoint used to delete managed thumbnail files. |
| `thumbnail.deleteUnusedThumbnails` | `true` | Delete a managed CDN file after its preset is deleted or its thumbnail is replaced. |
| `thumbnail.allowedHosts` | FiveManage CDN hosts | HTTPS hosts accepted for returned thumbnail URLs. |
| `thumbnail.encoding` | `jpg` | `jpg` or `png`. |
| `thumbnail.quality` | `0.85` | Screenshot quality clamped to `0.1-1.0`. |
| `thumbnail.timeoutMs` | `15000` | Upload timeout clamped to `5000-30000` milliseconds. |
| `thumbnail.maxWidth` | `1920` | Maximum captured width, clamped to `640-4096`. |
| `thumbnail.maxHeight` | `1080` | Maximum captured height, clamped to `360-4096`. |
| `thumbnail.captureAttempts` | `3` | Capture-stage attempts, clamped to `1-5`. Each attempt waits for a freshly presented frame. |
| `thumbnail.captureRetryDelayMs` | `350` | Base delay between capture attempts, clamped to `100-3000` milliseconds. |
| `thumbnail.uploadAttempts` | `3` | Fresh capture/upload attempts, clamped to `1-5`. |
| `thumbnail.retryDelayMs` | `600` | Base retry delay, clamped to `100-3000` milliseconds and increased per attempt. |
Grant the configured moderation ACE in `server.cfg`:
```properties title="server.cfg"
add_ace group.admin orbit.settingsshare.admin allow
```
When `requireApproval` is true, a public submission enters `awaiting`. An administrator can publish or decline it. Declined entries are exposed in the admin UI from runtime cache and can be restored while the resource remains running. When approval is disabled, valid public uploads publish immediately.
## Upload cooldown [#upload-cooldown]
The default cooldown is five minutes. It starts after every successful private or public save/update. While active, the server rejects:
* another private preset save
* another public preset submission/update
* thumbnail preparation
* screenshot capture/upload ticket issuance
The cooldown is enforced by owner identifier on the server. UI checks are only presentation; they are not the security boundary.
## Database storage [#database-storage]
The resource creates these InnoDB tables automatically:
| Table | Purpose |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| `orbit_settings_presets` | Preset owner, name, creator, settings, preview metadata, visibility/review state, thumbnail, statistics, and timestamps. |
| `orbit_settings_preset_likes` | One like per preset and owner identifier, deleted automatically with its preset. |
The preset table stores an internal auto-increment database ID plus an opaque public ID. Indexed owner, visibility, review, popularity, rating, creator, and name fields keep lists/searches bounded. Listing endpoints return validated preview data; complete settings JSON is loaded only when needed.
Do not manually edit settings JSON in the database. Use the UI so schema validation, ownership checks, metadata updates, and statistics stay consistent.
## Private share codes [#private-share-codes]
Private share codes look like:
```text title="Private share code example"
DJ7F-K9L2-8MNP-Q4XR
```
They contain 16 unambiguous uppercase letters/numbers in four groups. Private codes:
* are held in server memory, not the database
* contain the validated preset settings and minimal metadata needed for import
* are limited to one active code per player
* replace that player's previous code
* expire after `privateShareTtlSeconds` (15 minutes by default)
* expire when removed, when the owner disconnects, or when the resource/server restarts
Importing a private code creates an independent preset for the recipient. Later changes to either copy do not synchronize.
## Manual JSON import [#manual-json-import]
Manual import accepts only a complete settings document matching the current server schema. The server checks:
* valid JSON and payload size
* every required root and nested key
* no unknown/extra keys
* allowed enum values and finite numeric ranges
* complete layout objects
* valid status colors, icons, opacity, widgets, and priorities
* supported HUD, shape, player-info, speedometer, and performance values
This strict check applies to manual imports, private codes, saves, updates, public uploads, and downloads before settings can be applied. Do not remove keys from exported JSON or add custom metadata inside the settings object.
Preset names permit ASCII letters, numbers, single spaces, apostrophes, and hyphens. They must start and end with a letter/number, cannot contain repeated separator characters, and cannot exceed the configured limit or the server maximum of 30 bytes. URLs, emoji, control characters, and arbitrary markup are rejected.
## Public discovery [#public-discovery]
Discovery supports:
* search by preset name or creator name
* Most Popular, Top Rated, and Latest sorting
* gallery and list views
* liked-only filtering
* unique per-player likes
* server-counted downloads
* owner/admin delete controls
* public updates by the owner
Likes and downloads are updated on the server. The popularity score combines downloads and likes; clients cannot submit authoritative counts.
## Thumbnail capture [#thumbnail-capture]
When thumbnails are disabled or unavailable, the UI uses the built-in status/speedometer fallback preview. When enabled:
1. The server verifies ownership, feature access, limits, cooldown, and request rate.
2. The server requests a short-lived FiveManage presigned URL.
3. The active NUI serializes the current visible HUD state for capture.
4. A capture-only DUI loads the same compiled frontend and renders that state at the active game resolution.
5. The client draws the rendered HUD as a full-screen runtime texture over the game frame and temporarily enables the minimap.
6. The configured `screenshot-basic` or `screencapture` provider captures the composed game and HUD frame and uploads it directly to the presigned URL.
7. Transient capture/upload failures are retried within the configured bounds; every attempt requests a fresh frame.
8. The client restores the normal HUD and the player's previous radar state even when capture fails.
9. The upload is stored in the shared `orbit-dynamichud` directory with its short-lived marker in the filename. The server accepts only an HTTPS result from an allowed hostname whose storage key contains that marker, then verifies the uploaded JPEG/PNG bytes and retains the verified key for safe cleanup. This is a FiveManage storage prefix, not the FiveM resource name, and intentionally remains unchanged.
This is the actual DynamicHUD 2.0 frontend rendered through its normal components in capture mode, rather than a separately styled approximation. The game world, minimap, and visible HUD components are combined before the selected provider captures the frame.
Only the configured capture resource must be installed and started. Do not start both solely for DynamicHUD 2.0:
```lua title="resources/[orbit]/orbit-dynamichud-v2/server/config.lua"
Config.SettingsShareServer.thumbnail.captureProvider = 'screencapture'
-- or: 'screenshot-basic'
```
```properties title="server.cfg"
set orbit_fivemanage_api_key "YOUR_FIVEMANAGE_API_KEY"
# Match the resource to captureProvider.
ensure screencapture
# ensure screenshot-basic
ensure orbit-dynamichud-v2
```
If custom capture fails, the preset can still be saved or published without a thumbnail and will use the fallback preview. A failed capture does not produce a trusted thumbnail token.
Never expose the FiveManage API key in shared/client config, NUI messages, or frontend environment variables.
See [FiveManage Setup](/docs/orbit-studios-resources/orbit-dynamichud-v2/fivemanage) for account/team creation, token scope, start order, verification, rotation, and troubleshooting.
When `thumbnail.deleteUnusedThumbnails` is enabled, DynamicHUD 2.0 also asks FiveManage to remove a managed image after its preset is deleted or its thumbnail is replaced. Failed cleanup is non-blocking and never makes the preset operation fail.
## Commands and access [#commands-and-access]
`/settingsshare` opens the standalone page when these conditions are met:
* `Config.Commands.settingsshare.enabled = true`
* Settings Share `enabled = true`
* `standalonePage = true`
* at least one Settings Share feature is available
* `Config.SettingsLocked = false`
The control-panel launcher separately requires `controlPanelTab = true`, `standalonePage = true`, and an enabled control panel.
## Operational checklist [#operational-checklist]
* Confirm `oxmysql` starts before DynamicHUD 2.0 and no database initialization error appears.
* Keep `maxStoredPresets`, per-player limits, list limits, and cooldowns appropriate for the server size.
* Grant the moderation ACE only to trusted groups.
* Test private, awaiting, published, declined, like, download, update, and delete flows.
* Restart the resource once to verify private codes expire as intended.
* If thumbnails are enabled, verify the selected provider is started, capture the HUD and minimap, and confirm the returned hostname is in `allowedHosts`.
* Back up the two Settings Share tables with the rest of the server database.
# Troubleshooting (/docs/orbit-studios-resources/orbit-dynamichud-v2/troubleshooting)
# Troubleshooting [#troubleshooting]
Start with the client and server consoles. Resolve the first error before debugging dependent UI behavior.
Confirm `ox_lib`, your framework, `orbit-lib`, and `orbit-dynamichud-v2` start in that order. Check that the relevant entry in `Config.ControlPanel.EnabledModules` is enabled, then run `/restarthud`. Also verify that another resource is not calling `toggleHud(false)` or setting the replicated `hud:showHud` player state to `false`.
Command names come from the active locale and each command has an `enabled` switch in config. Verify `setr ox:locale`, the matching value under `commands` in the locale JSON, and the command entry in `Config.Commands` or `server/config.lua`. Restart the resource after changing either file.
Verify the selected framework and its compatibility events. ESX uses events such as `esx:setAccountMoney` and `esx_status:onTick`; QB/QBX resources commonly use `hud:client:OnMoneyChange`, `hud:client:UpdateNeeds`, and `hud:client:UpdateStress`. Stress can also be supplied through `LocalPlayer.state.stress`. Enable the corresponding entries in `Config.EnabledValues`.
Set the supported state bags rather than changing UI files. The relevant player keys are `seatbelt`, `cruiseControl`, `hud:deathState`, and `qbx_medical:deathState`; vehicle nitrous uses `nitro` and `nitroFlames`. Compatibility events are listed on the Events & State Bags page.
Only one progress bar and one skill check can run at a time. Check `progressActive()` or `skillCheckActive()`, and make sure the previous resource cleans up on stop. For Text UI, `showTextUI` replaces the current prompt and `hideTextUI` closes it. Use the exports documented in Interface API instead of sending NUI messages directly.
Check its state restrictions (`useWhileDead`, `allowRagdoll`, `allowSwimming`, `allowCuffed`, and `allowFalling`) and verify the animation dictionary, scenario, prop model, and bone. The export is blocking and returns `true` only on completion. A resource stop, explicit cancellation, failed condition, or watchdog timeout returns `false`.
Call the `notify` export or trigger `orbit-dynamichud:notify` on the client. A server script must use `TriggerClientEvent('orbit-dynamichud:notify', source, data)`. Visible notifications with the same explicit `id` are deduplicated, so omit the ID or use a new one when repeated messages should stack.
Confirm the music module is enabled and `onlyLocalMusic` is `false`. Headphone mode is intentionally frontend-only. Phone and car modes require the server music logic and current player/vehicle state. Car mode cannot be selected outside a vehicle.
Start `oxmysql` before `orbit-dynamichud-v2`, verify the database credentials, and check that Settings Share and the requested operation are enabled in config. Public discovery, private presets, manual import, share codes, moderation, and thumbnails have separate switches. The resource creates and migrates its tables automatically when database access succeeds.
Presets use a strict allowlist schema: missing keys, unknown keys, invalid enum values, unsafe names, and out-of-range values are rejected on both client and server. Preset names are limited to 30 normal text characters. Export a current preset and compare its structure instead of editing unknown fields into an older payload.
Screenshot thumbnails require `Config.ControlPanel.settingsShare.thumbnails = true`, a valid server-side FiveManage API key, and the resource selected by `Config.SettingsShareServer.thumbnail.captureProvider` (`screenshot-basic` or `screencapture`) to be started. The provider reported to the client must match the configured resource. The upload cooldown applies before screenshot preparation, so repeated attempts can be rejected before any frame is taken. Without screenshot support, presets use the status and speedometer fallback preview.
Enable `Config.Debug` temporarily and check the client F8 console for provider, HUD snapshot, DUI, capture, or upload errors. Check the server console for missing API credentials, FiveManage presigned-URL failures, invalid returned hosts, expired tickets, and database errors. The capture path renders the actual HUD through a capture-only DUI, draws it over the game with the minimap enabled, then restores the previous HUD/radar state. A failure in any stage rejects only the custom thumbnail; save the preset without one to use the fallback preview.
Confirm `Config.Onboarding.enabled = true`, `Config.Onboarding.trigger = "manual"`, and `Config.SettingsLocked = false`. Trigger `orbit-dynamichud:client:openOnboarding` only after the player and DynamicHUD 2.0 client are loaded. The event intentionally does nothing after that client has completed onboarding. Use the enabled `/onboarding` command to force a support/test run; if the command opens but the event does not, the player has normally already completed onboarding or the integration is firing too early. See the Onboarding guide for complete examples.
Automatic onboarding starts its five-second Text UI notice only after normalized player data reports a logged-in character and no other NUI or Text UI owns the interface. Opening a clothing menu, spawn selector, or another prompt hides DynamicHUD 2.0's notice and resets the full delay. Close the competing interface and leave focus free for five uninterrupted seconds. Use manual mode when another resource has a more reliable final-ready event.
Share codes are intentionally temporary. Settings codes expire after `Config.SettingsShareServer.privateShareTtlSeconds` (15 minutes by default). Each player can have one active settings code and one active playlist code; creating a replacement invalidates the old code. Codes are also removed when their owner disconnects and are lost when the resource or server restarts.
Car Control only opens while the player is in a supported vehicle and requires `Config.ControlPanel.carControl.enabled = true`. With `carControl.mode = "owner"`, only the current FiveM network owner may use controls. With `"realistic"`, the driver controls everything while passengers are limited to seat changes and the door/window beside their seat. Individual actions are also limited by vehicle type, seat, driver permission, available doors/windows, and backend validation. Neon controls require a compatible car and `Config.ControlPanel.carControl.neon = true`.
Set a new waypoint and allow the next HUD update to resolve its color. Waypoint color is fetched once per waypoint rather than every frame. If compass data never changes, verify that the dynamic bar navigation value and the appropriate layout component are enabled.
For callable APIs and integration names, use [Exports](/docs/orbit-studios-resources/orbit-dynamichud-v2/exports) and [Events & State Bags](/docs/orbit-studios-resources/orbit-dynamichud-v2/events).
# Configuration (/docs/orbit-studios-resources/orbit-lib/configuration)
# Configuration [#configuration]
Edit `resources/[orbit]/orbit-lib/config.lua`. This is the only `orbit-lib` file server owners should modify.
Each selector tells all dependent Orbit resources which integration to call. Values are case-sensitive and must match the keys documented below. After changing a selector or adapter, restart `orbit-lib` and every resource that depends on it.
Orbit Lib is escrowed. Configure integrations in `config.lua`; do not rename the resource, edit runtime files, or copy internal bridge code into dependent resources.
## File map [#file-map]
## Configuration map [#configuration-map]
`Config.Debug` and `Config.Gangs` are not valid settings. Use `Config.CustomGang` for the optional custom gang adapter.
## Full config file [#full-config-file]
The current public config has this overall structure. Choose values that match the resources installed on your server; do not blindly keep the example selections.
```lua title="resources/[orbit]/orbit-lib/config.lua"
Config = {}
-- Supported frameworks: qb, esx, qbx, standalone
Config.Framework = 'qbx'
-- Used only when Config.Framework is 'standalone'.
Config.Standalone = {
identifierType = 'license',
playerDataCache = 1000,
defaultMoney = {
cash = 0,
bank = 0,
dirty = 0
},
defaultJob = {
name = 'unemployed',
label = 'Unemployed',
grade = {
name = 'Unemployed',
level = 0
}
},
fetchName = nil,
fetchCharInfo = nil,
fetchMoney = nil,
fetchJob = nil,
createUsableItem = nil
}
-- Optional custom gang data for ESX and standalone.
Config.CustomGang = {
enabled = false,
fetchGang = function(playerState, source)
return {
name = playerState.gangName or '',
label = playerState.gangName or '',
grade = {
name = playerState.gangRankName or '',
level = 1
}
}
end
}
Config.TargetResource = 'ox_target'
Config.Inventory = 'ox_inventory'
-- Used only with qb-like or ox-like.
Config.CustomInventory = ''
Config.CustomExport = ''
Config.Notify = 'orbit-dynamichud-v2'
Config.Progress = 'orbit-dynamichud-v2'
Config.TextUI = 'orbit-dynamichud-v2'
Config.SkillCheck = 'orbit-dynamichud-v2'
```
## Framework presets [#framework-presets]
Select the tab for your framework. The target and inventory pair shown is a common starting point, not a requirement; change either when your server uses another supported resource.
```lua title="resources/[orbit]/orbit-lib/config.lua"
Config.Framework = 'esx'
Config.TargetResource = 'ox_target'
Config.Inventory = 'ox_inventory'
```
`es_extended` must start before `orbit-lib`. With `Config.Notify = 'framework'`, notifications use the ESX notification event. With `Config.Progress = 'framework'`, `esx_progressbar` must be installed and started.
```lua title="resources/[orbit]/orbit-lib/config.lua"
Config.Framework = 'qb'
Config.TargetResource = 'qb-target'
Config.Inventory = 'qb-inventory'
```
`qb-core` must start before `orbit-lib`. With `Config.Notify = 'framework'`, notifications use QBCore. With `Config.Progress = 'framework'`, the QB `progressbar` resource must be installed and started.
```lua title="resources/[orbit]/orbit-lib/config.lua"
Config.Framework = 'qbx'
Config.TargetResource = 'ox_target'
Config.Inventory = 'ox_inventory'
```
`qbx_core` must start before `orbit-lib`. Framework notifications and progress bars fall back to ox\_lib on QBX, so selecting `ox_lib` directly makes that requirement clearer.
```lua title="resources/[orbit]/orbit-lib/config.lua"
Config.Framework = 'standalone'
Config.TargetResource = 'ox_target'
Config.Inventory = 'ox_inventory'
```
Standalone mode has no framework resource. Configure the adapters described under [Standalone mode](#standalone-mode). Framework notifications and progress bars fall back to ox\_lib.
## Interface providers [#interface-providers]
The four interface selectors are independent. For example, a server can use Orbit Dynamic HUD 2.0 notifications and Text UI while keeping ox\_lib progress bars and skill checks.
Use DynamicHUD 2.0 for every supported interface:
```lua title="resources/[orbit]/orbit-lib/config.lua"
Config.Notify = 'orbit-dynamichud-v2'
Config.Progress = 'orbit-dynamichud-v2'
Config.TextUI = 'orbit-dynamichud-v2'
Config.SkillCheck = 'orbit-dynamichud-v2'
```
Start `orbit-lib` before `orbit-dynamichud-v2`, because the HUD depends on the library. DynamicHUD 2.0 must be fully started before another resource calls one of these bridges. The bridge passes normalized notification, progress-bar, Text UI, and skill-check data to the corresponding DynamicHUD 2.0 interface.
See [DynamicHUD 2.0 Interface APIs](/docs/orbit-studios-resources/orbit-dynamichud-v2/interface) for supported interface options.
Use ox\_lib for every interface:
```lua title="resources/[orbit]/orbit-lib/config.lua"
Config.Notify = 'ox_lib'
Config.Progress = 'ox_lib'
Config.TextUI = 'ox_lib'
Config.SkillCheck = 'ox_lib'
```
`ox_lib` is already a required `orbit-lib` dependency and must start first. Progress uses the ox\_lib progress-bar shape, Text UI uses the ox\_lib show/hide/status functions, and skill checks use the ox\_lib-compatible difficulty and input format.
Only notifications and progress bars accept the `framework` value:
```lua title="resources/[orbit]/orbit-lib/config.lua"
Config.Notify = 'framework'
Config.Progress = 'framework'
Config.TextUI = 'ox_lib'
Config.SkillCheck = 'ox_lib'
```
QB uses QBCore notifications and the `progressbar` resource. ESX uses its notification event and `esx_progressbar`. QBX and standalone fall back to ox\_lib. Text UI and skill checks do not have a `framework` option; select `ox_lib` or `orbit-dynamichud-v2` for each.
| Setting | Supported values | Missing or invalid provider behavior |
| ------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| `Config.Notify` | `framework`, `ox_lib`, `orbit-dynamichud-v2` | Logs `Unmatching Notify Resource`; no notification is shown. |
| `Config.Progress` | `framework`, `ox_lib`, `orbit-dynamichud-v2` | Logs `Unmatching Progress Resource` and runs the cancellation callback when supplied. |
| `Config.TextUI` | `ox_lib`, `orbit-dynamichud-v2` | Logs `Unmatching Text UI Resource`; show/hide returns `false`. |
| `Config.SkillCheck` | `ox_lib`, `orbit-dynamichud-v2` | Logs `Unmatching Skill Check Resource`; the check returns `false` and uses the cancellation callback when supplied. |
Do not use older values such as `ox`, `qb`, `esx`, or `qbx` for the interface selectors. Use `framework`, `ox_lib`, or `orbit-dynamichud-v2` exactly as listed for that setting.
## Targets [#targets]
| Config value | Resource | Purpose |
| ------------ | --------------------------------------------------------------------------- | -------------------------------------------------------------- |
| `ox_target` | [overextended/ox\_target](https://github.com/overextended/ox_target) | Creates OX-style entity, model, zone, and global interactions. |
| `qb-target` | [qbcore-framework/qb-target](https://github.com/qbcore-framework/qb-target) | Creates QB-style entity, model, zone, and global interactions. |
```lua title="resources/[orbit]/orbit-lib/config.lua"
Config.TargetResource = 'ox_target'
```
The selected target resource must start before `orbit-lib`. Restart dependent resources after switching target systems so their interactions are registered again.
## Inventories [#inventories]
| Config value | Resource or adapter | Notes |
| -------------- | --------------------------------------------------------------------------------- | ------------------------------------------------------ |
| `ox_inventory` | [overextended/ox\_inventory](https://github.com/overextended/ox_inventory) | Built-in OX inventory adapter. |
| `qb-inventory` | [qbcore-framework/qb-inventory](https://github.com/qbcore-framework/qb-inventory) | Built-in current QB inventory adapter. |
| `ps-inventory` | [Project-Sloth/ps-inventory](https://github.com/Project-Sloth/ps-inventory) | Built-in Project Sloth adapter. |
| `lj-inventory` | [loljoshie/lj-inventory](https://github.com/loljoshie/lj-inventory) | Built-in LJ inventory adapter. |
| `qb-like` | Custom inventory | Requires exports compatible with the QB-style adapter. |
| `ox-like` | Custom inventory | Requires exports compatible with the OX-style adapter. |
For a built-in inventory, leave both custom values empty:
```lua title="resources/[orbit]/orbit-lib/config.lua"
Config.Inventory = 'ox_inventory'
Config.CustomInventory = ''
Config.CustomExport = ''
```
For a compatible custom inventory, select its API family and provide its real resource name:
```lua title="resources/[orbit]/orbit-lib/config.lua"
Config.Inventory = 'ox-like'
Config.CustomInventory = 'my_inventory'
Config.CustomExport = ''
```
`Config.CustomExport` is normally empty. Set it only when the name used in `exports[...]` differs from the folder/resource name:
```lua title="resources/[orbit]/orbit-lib/config.lua"
Config.Inventory = 'qb-like'
Config.CustomInventory = 'custom_inventory_resource'
Config.CustomExport = 'inventory_api'
```
Selecting `qb-like` or `ox-like` does not make an arbitrary inventory compatible. Its exports and argument/return shapes must match the corresponding built-in bridge.
## Standalone mode [#standalone-mode]
Standalone mode builds normalized player data without ESX, QB, or QBX. Defaults keep calls from failing, but production servers should replace placeholder money, job, and character data with adapters tied to their own systems.
| Setting | Arguments | Expected result |
| ------------------ | ------------------------------- | ----------------------------------------------------------------------------------------- |
| `identifierType` | Not a function | Identifier prefix used as `citizenid`, such as `license`, `steam`, `discord`, or `fivem`. |
| `playerDataCache` | Not a function | Client cache duration in milliseconds. Use `0` to disable reuse of cached server data. |
| `fetchName` | `source, playerState` | Player or character display name string. |
| `fetchCharInfo` | `source, playerState, defaults` | Character table containing fields needed by your Orbit resources. |
| `fetchMoney` | `source, playerState, defaults` | Money table, normally including `cash`, `bank`, and `dirty`. |
| `fetchJob` | `source, playerState, defaults` | Job table containing `name`, `label`, and a `grade` table. |
| `createUsableItem` | `item, callback` | Register the supplied item name with your item-use system. |
Use the provided `defaults` as a safe base and return the same data shape:
```lua title="resources/[orbit]/orbit-lib/config.lua"
Config.Standalone.fetchMoney = function(source, playerState, defaults)
defaults.cash = playerState.cash or 0
defaults.bank = playerState.bank or 0
defaults.dirty = playerState.dirtyMoney or 0
return defaults
end
Config.Standalone.fetchJob = function(source, playerState, defaults)
defaults.name = playerState.jobName or 'unemployed'
defaults.label = playerState.jobLabel or 'Unemployed'
defaults.grade = {
name = playerState.jobGradeName or 'Unemployed',
level = playerState.jobGrade or 0
}
return defaults
end
```
Adapter failures are caught and logged by name. When an adapter returns `nil` or fails, `orbit-lib` uses its configured/default fallback value.
## Custom gang data [#custom-gang-data]
`Config.CustomGang` is read only by ESX and standalone bridges. QB and QBX already obtain gang data from their framework player data.
```lua title="resources/[orbit]/orbit-lib/config.lua"
Config.CustomGang = {
enabled = true,
fetchGang = function(playerState, source)
return {
name = playerState.gangName or '',
label = playerState.gangLabel or playerState.gangName or '',
grade = {
name = playerState.gangRankName or '',
level = playerState.gangRank or 0
}
}
end
}
```
Leave `enabled = false` when your Orbit resources do not use a custom gang system. The callback must return a gang table with `name`, `label`, and `grade` when enabled.
## Apply and verify [#apply-and-verify]
1. Save `resources/[orbit]/orbit-lib/config.lua`.
2. Confirm `ox_lib`, `oxmysql`, the selected framework, inventory, and target have started.
3. Start or restart `orbit-lib`.
4. Start or restart Orbit Dynamic HUD 2.0 if any interface selector uses it.
5. Restart every dependent Orbit resource so it reloads the bridge selection.
6. Test one inventory action, target interaction, notification, progress bar, Text UI prompt, and skill check used by your installed resources.
# Dependencies (/docs/orbit-studios-resources/orbit-lib/dependencies)
# Dependencies [#dependencies]
Orbit Lib always requires its two manifest libraries. Framework, inventory, target, and interface dependencies then depend on the exact selectors in `config.lua`.
## Required [#required]
| Dependency | Why it is needed | Link |
| ---------- | ----------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
| `ox_lib` | Loads the shared library, callbacks, cache helpers, and common runtime utilities used by the bridges. | [overextended/ox\_lib](https://github.com/overextended/ox_lib) |
| `oxmysql` | Satisfies the manifest dependency and database library loaded by the server runtime. | [overextended/oxmysql](https://github.com/overextended/oxmysql) |
## Selected integrations [#selected-integrations]
| Selector | Required running resource |
| --------------------------------------------- | ------------------------------------------------------------- |
| `Config.Framework = 'esx'` | `es_extended` |
| `Config.Framework = 'qb'` | `qb-core` |
| `Config.Framework = 'qbx'` | `qbx_core` |
| `Config.Framework = 'standalone'` | No framework resource; configure standalone adapters instead. |
| `Config.TargetResource = 'ox_target'` | `ox_target` |
| `Config.TargetResource = 'qb-target'` | `qb-target` |
| Built-in `Config.Inventory` value | The matching inventory resource. |
| `Config.Inventory = 'qb-like'` or `'ox-like'` | The resource named by `Config.CustomInventory`. |
See [Configuration](/docs/orbit-studios-resources/orbit-lib/configuration) for the complete supported inventory list and custom export rules.
## Interface providers [#interface-providers]
| Provider | Additional requirement |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| `framework` notifications | ESX or QB-Core. QBX and standalone fall back to ox\_lib. |
| `framework` progress | QB-Core also requires `progressbar`; ESX also requires `esx_progressbar`. QBX and standalone fall back to ox\_lib. |
| `ox_lib` | Already installed as a required dependency. |
| `orbit-dynamichud-v2` | [Orbit Dynamic HUD 2.0](/docs/orbit-studios-resources/orbit-dynamichud-v2), started after Orbit Lib. |
Text UI and skill checks support only `ox_lib` or `orbit-dynamichud-v2`; they do not accept `framework`.
## Start order [#start-order]
```properties title="server.cfg"
ensure ox_lib
ensure oxmysql
ensure [framework-resources]
ensure [inventory]
ensure [target]
ensure orbit-lib
# Start this afterward when selected as an interface provider.
ensure orbit-dynamichud-v2
# Start every other dependent Orbit resource last.
ensure orbit-craftingsystem
```
## Feature failure behavior [#feature-failure-behavior]
* A missing or mismatched framework can leave player, money, job, gang, and usable-item data unavailable.
* A missing inventory or target prevents the matching bridge from registering correctly.
* A missing notification provider logs an error and shows no notification.
* A missing progress provider logs an error and uses the cancellation callback when supplied.
* A missing Text UI provider returns `false` from show, hide, and status operations.
* A missing skill-check provider returns `false` and can run the cancellation callback.
Resolve dependency and selector errors in Orbit Lib before debugging the dependent resource that called it.
# Installation (/docs/orbit-studios-resources/orbit-lib)
# Orbit Lib [#orbit-lib]
Orbit Lib is the required bridge library for Orbit Studios resources. It gives those resources one consistent connection to your framework, inventory, target system, notifications, progress bar, Text UI, skill checks, and optional custom gang data.
Install and use this resource only when it was obtained for your account through the official Cfx.re Portal. Support requires both the matching Cfx.re Portal entitlement and the original Tebex purchase ID; a Portal entitlement by itself is not sufficient proof of purchase. Copies from Discord, leaked packs, file-sharing sites, source repositories, or another customer are unauthorized and unsupported.
## Installation [#installation]
1. Download the current release from the Cfx.re Portal account that owns the license.
2. Stop the server before installing or replacing the resource.
3. Extract the folder as `orbit-lib` without an extra nested directory.
4. Install `ox_lib` and `oxmysql`, then install the framework, inventory, and target resources selected in `config.lua`.
5. Edit only `resources/[orbit]/orbit-lib/config.lua` and select integrations that are actually installed.
6. Start the selected dependencies before `orbit-lib` and all dependent Orbit resources afterward.
7. Restart the server after replacing an existing version so every dependent resource loads the same bridge version.
```properties title="server.cfg"
ensure ox_lib
ensure oxmysql
ensure [framework-resources]
ensure [inventory]
ensure [target]
ensure orbit-lib
# Dependent Orbit resources start afterward.
ensure orbit-dynamichud-v2
ensure orbit-craftingsystem
```
Orbit Dynamic HUD 2.0 is the exception to normal provider ordering: it depends on Orbit Lib, so it starts afterward even when a UI selector uses `orbit-dynamichud-v2`. The HUD must be fully started before another resource calls that interface.
## Resource structure [#resource-structure]
Only edit `resources/[orbit]/orbit-lib/config.lua`. Do not rename the resource folder, move internal files, or modify escrowed files. Runtime folders are shown only so you can verify that the release extracted correctly.
## Framework setup [#framework-setup]
Set `Config.Framework = 'esx'`. Orbit Lib reads ESX player and account data and registers usable items through ESX. Start `es_extended` before Orbit Lib.
Set `Config.Framework = 'qb'`. Orbit Lib uses `qb-core` player data, jobs, gangs, notifications, and usable-item registration. Start `qb-core` before Orbit Lib.
Set `Config.Framework = 'qbx'`. QBX servers normally pair `qbx_core` with `ox_inventory`, `ox_target`, and ox\_lib interface providers.
Set `Config.Framework = 'standalone'`. Configure `Config.Standalone` adapters so dependent resources receive real character, money, job, and usable-item data instead of fallback values.
## First-run verification [#first-run-verification]
1. Confirm `ox_lib`, `oxmysql`, the selected framework, inventory, and target start without errors.
2. Confirm `orbit-lib` starts before every dependent Orbit resource.
3. Join with a fully loaded character and verify dependent resources receive the correct name, job, money, and inventory data.
4. Test one target interaction and one inventory action from an installed Orbit resource.
5. Test every selected interface provider: notification, progress bar, Text UI, and skill check.
6. Resolve the first `Unmatching ... Resource` message before testing later integrations.
## Dependent Orbit resources [#dependent-orbit-resources]
* [Orbit Dynamic HUD 2.0](/docs/orbit-studios-resources/orbit-dynamichud-v2) uses normalized player data and can provide all four interface bridges.
* [Orbit Crafting System](/docs/orbit-studios-resources/orbit-craftingsystem) uses framework, inventory, target, notification, progress, player, and item bridges.
## Support [#support]
When requesting support, include the client/server console error, framework, inventory, target, all four interface selector values, relevant `config.lua` section, reproduction steps, the matching Cfx.re Portal entitlement, and the original Tebex purchase ID. Both purchase records are required. Never post the complete paid resource publicly.
# Troubleshooting (/docs/orbit-studios-resources/orbit-lib/troubleshooting)
# Troubleshooting [#troubleshooting]
Check the server console and the affected player's F8 console. `orbit-lib` prints a provider-specific `Unmatching ... Resource` message when a selected interface resource is unavailable or the configured value is invalid.
Confirm both manifest dependencies are installed and started first: `ox_lib` and `oxmysql`. Keep the resource folder named exactly `orbit-lib`, then verify that `config.lua` contains valid Lua and starts with `Config = {}`. A syntax error in an adapter function prevents the resource from loading.
Confirm `Config.Framework`, `Config.Inventory`, and `Config.TargetResource` exactly match running resources. Start the framework, inventory, target, `ox_lib`, and `oxmysql` before `orbit-lib`; start dependent Orbit resources afterward. Restart the dependent resource after changing `config.lua` so it recreates its integrations.
Check that `Config.TargetResource` is exactly `ox_target` or `qb-target` and that the selected resource starts before `orbit-lib`. Restart the Orbit resource that owns the target after changing providers; existing interactions are normally registered during resource startup.
Use a built-in adapter whenever possible. With `qb-like` or `ox-like`, set `Config.CustomInventory` to the running resource name and set `Config.CustomExport` only when its export namespace is different. A custom inventory must expose API-compatible exports; selecting a similar adapter does not translate a different API automatically.
Set `Config.Notify = 'orbit-dynamichud-v2'`, start `orbit-lib` first, and then start `orbit-dynamichud-v2`. The HUD must be running when a notification is sent. Also confirm notifications are enabled and configured in the DynamicHUD 2.0 Interface documentation.
Confirm `Config.Progress = 'orbit-dynamichud-v2'` and that DynamicHUD 2.0 is started. When the provider is missing, fails, or returns an unsuccessful result, `orbit-lib` calls the supplied cancellation callback. Check F8 for `Unmatching Progress Resource` or a provider error.
`Config.TextUI` supports only `ox_lib` and `orbit-dynamichud-v2`. Make sure the selected provider is running, then check for `Unmatching Text UI Resource`. When using DynamicHUD 2.0, verify its Text UI interface is enabled and avoid having multiple resources display competing prompts without hiding the previous prompt.
`Config.SkillCheck` supports only `ox_lib` and `orbit-dynamichud-v2`. Confirm the selected provider is running and that the calling resource supplies a valid difficulty. A missing provider, invalid difficulty, cancelled check, or provider error returns `false` and can run the cancellation callback.
The `framework` value is supported only for `Config.Notify` and `Config.Progress`. QB progress also requires the `progressbar` resource; ESX progress requires `esx_progressbar`. QBX and standalone framework UI calls fall back to ox\_lib. Set `Config.TextUI` and `Config.SkillCheck` separately to `ox_lib` or `orbit-dynamichud-v2`.
Defaults intentionally return zero money and an unemployed job. Connect `fetchName`, `fetchCharInfo`, `fetchMoney`, and `fetchJob` to your own state or character system. `playerDataCache` controls how long client-side data is reused; lower it when values must update faster, or use `0` to request fresh server data each time.
Configure `Config.Standalone.createUsableItem` when a dependent Orbit resource registers usable items. The adapter receives the item name and callback and must register them with your standalone inventory or item-use resource. Without an adapter, `orbit-lib` logs a warning and cannot register the item.
The setting is named `Config.CustomGang`, not `Config.Gangs`. Enable it only when needed and return a table containing `name`, `label`, and `grade`. Verify the state keys read by `fetchGang` actually exist on your server. QB and QBX use framework-provided gang data instead.
Use [Dependencies](/docs/orbit-studios-resources/orbit-lib/dependencies) for resource requirements and start order, and [Configuration](/docs/orbit-studios-resources/orbit-lib/configuration) for every supported selector, standalone adapter, and provider rule.
# ESX integration (/docs/orbit-studios-resources/orbit-dynamichud-v2/interface/esx)
# ESX integration [#esx-integration]
These examples target [current ESX Legacy client functions](https://github.com/esx-framework/esx_core/blob/main/%5Bcore%5D/es_extended/client/functions.lua). Check your installed ESX version before replacing calls. Start `orbit-dynamichud-v2` before resources that call its exports.
## Notifications [#notifications]
Replace `ESX.ShowNotification(message, type, length, title)` in a **client** script with:
```lua
exports['orbit-dynamichud-v2']:notify({
title = 'Garage',
description = 'Vehicle stored.',
type = 'success',
duration = 3500
})
```
For an existing call with no title, put its message in `description`; the HUD supplies a localized heading. Map ESX's `info`, `success`, `error`, and `warning` types directly. HUD placement is controlled by the HUD, so ESX's notification `position` is not transferred.
In a **server** script, replace `xPlayer.showNotification(...)` or a targeted ESX notification event with the HUD client event:
```lua
TriggerClientEvent('orbit-dynamichud:notify', source, {
description = 'Your vehicle is ready.',
type = 'info',
duration = 4000
})
```
Do not send both the ESX and HUD notification for the same action. `ESX.ShowAdvancedNotification`, floating help, and per-frame help notifications have GTA-native presentation and are **not** equivalent to a HUD notification; migrate those only when changing their behavior is acceptable.
## Text UI [#text-ui]
Replace the call at the point where the interaction becomes available, and hide it when it ends:
```lua
-- ESX.TextUI('[E] Open garage', 'info')
exports['orbit-dynamichud-v2']:showTextUI('[E] Open garage', {
position = 'right-center'
})
-- ESX.HideUI()
exports['orbit-dynamichud-v2']:hideTextUI()
```
ESX's visual `type` does not have a direct HUD equivalent. Do not reissue `showTextUI` every frame. Also hide the prompt when its owning resource stops.
## Progress actions [#progress-actions]
[ESX.Progressbar](https://github.com/esx-framework/esx_core/blob/main/%5Bcore%5D/esx_progressbar/Progress.lua) starts an **asynchronous** action and uses `onFinish`/`onCancel` callbacks. The HUD's `progressBar` waits in the calling Lua thread and returns a completion boolean. To keep callbacks and avoid blocking your event handler, start a thread:
```lua
local function startHudProgress(message, duration, options)
options = options or {}
if exports['orbit-dynamichud-v2']:progressActive() then return false end
CreateThread(function()
local animation = options.animation
local anim
if animation and animation.type == 'anim' then
anim = { dict = animation.dict, clip = animation.lib }
elseif animation and animation.type == 'Scenario' then
anim = { scenario = animation.Scenario }
end
local completed = exports['orbit-dynamichud-v2']:progressBar({
label = message,
duration = duration,
canCancel = true,
anim = anim,
disable = { move = options.FreezePlayer == true }
})
if completed then
if options.onFinish then options.onFinish() end
elseif options.onCancel then
options.onCancel()
end
end)
return true
end
startHudProgress('Repairing vehicle', 5000, {
FreezePlayer = true,
animation = { type = 'anim', dict = 'mini@repair', lib = 'fixing_a_ped' },
onFinish = function() TriggerServerEvent('garage:repairFinished') end,
onCancel = function() print('Repair cancelled') end
})
```
`disable.move` blocks movement controls; it is **not** the same as ESX's `FreezeEntityPosition`. If you need a hard ped freeze, add that around the HUD call and guarantee it is released on cancellation and resource stop. Replace `ESX.CancelProgressbar()` with `exports['orbit-dynamichud-v2']:cancelProgress()` after migrating the corresponding start call.
## Scope and cleanup [#scope-and-cleanup]
Replacing calls in your own resource affects that resource only. ESX and other scripts still call their own UI until you migrate those call sites or deliberately maintain an ESX core fork. Do not remove `esx_notify`, `esx_textui`, or `esx_progressbar` just because one script was migrated; search all dependencies first. Keep `es_extended` and other framework functionality running.
For a timing check, call `exports['orbit-dynamichud-v2']:skillCheck('medium', { 'E' })`; ESX has no single standard skill-check function to replace. See [Skill Check](/docs/orbit-studios-resources/orbit-dynamichud-v2/interface/skill-check).
# Interface APIs (/docs/orbit-studios-resources/orbit-dynamichud-v2/interface)
# Interface APIs [#interface-apis]
Orbit Dynamic HUD 2.0 exposes four reusable client interfaces. The APIs intentionally match the common `ox_lib` method signatures, so a small compatibility bridge can keep existing call sites unchanged.
ESX, QB-Core, and QBX have different notification and progress contracts. Use their dedicated guides below for call-site mappings and callback handling; do not treat a per-resource bridge as a global framework replacement.
The bridge signatures follow the official ox\_lib references for [notifications](https://coxdocs.dev/ox_lib/Modules/Interface/Client/notify), [Text UI](https://coxdocs.dev/ox_lib/Modules/Interface/Client/textui), [skill checks](https://coxdocs.dev/ox_lib/Modules/Interface/Client/skillcheck), and [progress](https://coxdocs.dev/ox_lib/Modules/Interface/Client/progress).
These examples require the folder name `orbit-dynamichud-v2`. Renaming an escrowed resource can break exports and is not supported.
## Direct exports [#direct-exports]
Call exports from client scripts:
```lua title="resources/[custom]/client/main.lua"
exports['orbit-dynamichud-v2']:notify({
description = 'Vehicle stored successfully.',
type = 'success'
})
local completed = exports['orbit-dynamichud-v2']:progressBar({
label = 'Storing vehicle',
duration = 2500,
canCancel = true
})
```
| DynamicHUD 2.0 export | Compatible ox\_lib call |
| -------------------------------- | ------------------------------------ |
| `notify(data)` | `lib.notify(data)` |
| `showTextUI(text, options)` | `lib.showTextUI(text, options)` |
| `hideTextUI()` | `lib.hideTextUI()` |
| `isTextUIOpen()` | `lib.isTextUIOpen()` |
| `skillCheck(difficulty, inputs)` | `lib.skillCheck(difficulty, inputs)` |
| `skillCheckActive()` | `lib.skillCheckActive()` |
| `cancelSkillCheck()` | `lib.cancelSkillCheck()` |
| `progressBar(data)` | `lib.progressBar(data)` |
| `progressActive()` | `lib.progressActive()` |
| `cancelProgress()` | `lib.cancelProgress()` |
## Complete ox\_lib compatibility bridge [#complete-ox_lib-compatibility-bridge]
Create this client file in each resource whose interface calls you want DynamicHUD 2.0 to handle. Existing calls such as `lib.notify(...)`, `lib.showTextUI(...)`, `lib.skillCheck(...)`, and `lib.progressBar(...)` then continue working without edits.
```lua title="resources/[custom]/client/orbit_ui_bridge.lua"
lib = lib or {}
lib.notify = function(data)
return exports['orbit-dynamichud-v2']:notify(data)
end
lib.showTextUI = function(text, options)
return exports['orbit-dynamichud-v2']:showTextUI(text, options)
end
lib.hideTextUI = function()
return exports['orbit-dynamichud-v2']:hideTextUI()
end
lib.isTextUIOpen = function()
return exports['orbit-dynamichud-v2']:isTextUIOpen()
end
lib.skillCheck = function(difficulty, inputs)
return exports['orbit-dynamichud-v2']:skillCheck(difficulty, inputs)
end
lib.skillCheckActive = function()
return exports['orbit-dynamichud-v2']:skillCheckActive()
end
lib.cancelSkillCheck = function()
return exports['orbit-dynamichud-v2']:cancelSkillCheck()
end
lib.progressBar = function(data)
return exports['orbit-dynamichud-v2']:progressBar(data)
end
-- DynamicHUD 2.0 has one progress presentation. This keeps progressCircle call sites
-- functional while rendering the DynamicHUD 2.0 progress bar.
lib.progressCircle = lib.progressBar
lib.progressActive = function()
return exports['orbit-dynamichud-v2']:progressActive()
end
lib.cancelProgress = function()
return exports['orbit-dynamichud-v2']:cancelProgress()
end
```
Load the bridge after `@ox_lib/init.lua` and before the scripts that call these interfaces. Add it to your resource's **existing** client script list; keep all existing entries in their original order:
```lua title="resources/[custom]/fxmanifest.lua"
shared_script '@ox_lib/init.lua'
client_scripts {
'client/orbit_ui_bridge.lua',
'client/main.lua', -- Example: keep your existing client scripts here.
}
dependencies {
'ox_lib',
'orbit-dynamichud-v2'
}
```
If an existing wildcard also matches `orbit_ui_bridge.lua`, exclude the bridge from that wildcard or list scripts explicitly so the bridge loads only once.
If the resource uses no other ox\_lib API, remove its `@ox_lib/init.lua` line and the `ox_lib` dependency, but keep `orbit_ui_bridge.lua` first in `client_scripts`. The bridge creates `lib` when necessary. Do not remove ox\_lib from a resource that still calls callbacks, zones, menus, points, locales, or any other `lib.*` method.
The bridge changes interface calls only inside the resource that loads it. It does not modify ox\_lib, DynamicHUD 2.0, or another resource's Lua environment. DynamicHUD 2.0 keeps the compatible function signatures and return values, while visual-only ox\_lib options that have no DynamicHUD 2.0 equivalent use DynamicHUD 2.0's own presentation.
## Cleanup [#cleanup]
When your resource owns a persistent or blocking interface, clean it up during resource stop:
```lua title="resources/[custom]/client/main.lua"
AddEventHandler('onClientResourceStop', function(resourceName)
if resourceName ~= GetCurrentResourceName() then return end
exports['orbit-dynamichud-v2']:hideTextUI()
exports['orbit-dynamichud-v2']:cancelSkillCheck()
exports['orbit-dynamichud-v2']:cancelProgress()
end)
```
Never call DynamicHUD 2.0 NUI callbacks directly. The Lua interfaces own focus, timeouts, control blocking, animations, props, cleanup, and result validation.
# Notifications (/docs/orbit-studios-resources/orbit-dynamichud-v2/interface/notifications)
# Notifications [#notifications]
`notify` and `Notify` are equivalent client exports. Notifications may also be triggered through the client event.
```lua title="Client export"
exports['orbit-dynamichud-v2']:notify({
title = 'Garage',
description = 'Vehicle stored successfully.',
type = 'success',
duration = 3500
})
```
```lua title="Client event"
TriggerEvent('orbit-dynamichud:notify', {
description = 'You do not have the required item.',
type = 'error',
duration = 4000
})
```
A server script targets a client:
```lua title="Server event"
TriggerClientEvent('orbit-dynamichud:notify', source, {
title = 'Server',
description = 'Welcome back.',
type = 'info',
duration = 3000
})
```
## Payload [#payload]
| Field | Type | Default | Description |
| ------------- | --------- | ----------------- | ---------------------------------------------------------------- |
| `id` | `string?` | generated | Unique ID. A notification with an ID already visible is ignored. |
| `title` | `string?` | localized by type | Heading. Omit it to use the localized type label. |
| `description` | `string?` | `""` | Notification body. |
| `type` | `string?` | `"info"` | `primary`, `inform`, `info`, `warning`, `error`, or `success`. |
| `duration` | `number?` | `3000` | Display duration in milliseconds. |
| `icon` | `string?` | type icon | Free Font Awesome icon name or classes. |
| `color` | `string?` | type color | CSS color for the accent and duration bar. |
| `iconColor` | `string?` | `color` | CSS color for the notification icon. |
When `title` is omitted, the resource uses `notification_info`, `notification_warning`, `notification_err`, or `notification_success` from the active locale.
```lua title="Custom notification"
exports['orbit-dynamichud-v2']:Notify({
id = 'vehicle_locked',
description = 'Vehicle locked.',
type = 'inform',
icon = 'fas fa-lock',
color = '#71B6F7',
iconColor = '#FFFFFF',
duration = 2500
})
```
## ox\_lib drop-in replacement [#ox_lib-drop-in-replacement]
Add this after `@ox_lib/init.lua` in the resource. Existing `lib.notify(data)` calls require no changes.
```lua title="client/orbit_notify.lua"
lib = lib or {}
lib.notify = function(data)
return exports['orbit-dynamichud-v2']:notify(data)
end
```
Core ox\_lib fields (`id`, `title`, `description`, `duration`, `type`, `icon`, and `iconColor`) map directly. DynamicHUD 2.0 owns placement and styling, so ox\_lib-only fields such as `position`, nested `style`, `showDuration`, and `sound` do not change the DynamicHUD 2.0 notification presentation.
See the [complete compatibility bridge](/docs/orbit-studios-resources/orbit-dynamichud-v2/interface#complete-ox-lib-compatibility-bridge) when replacing all four interfaces.
# Progress Bar (/docs/orbit-studios-resources/orbit-dynamichud-v2/interface/progress-bar)
# Progress Bar [#progress-bar]
`progressBar` yields the calling Lua thread and returns `true` when the duration completes. It returns `false` when cancelled, interrupted by a disallowed ped state, timed out, or rejected because another progress action is active.
```lua title="Client export"
local completed = exports['orbit-dynamichud-v2']:progressBar({
label = 'Repairing vehicle',
description = 'Keep the area clear.',
duration = 5000,
canCancel = true,
keybind = 'X',
disable = {
move = true,
car = true,
combat = true,
sprint = true
},
anim = {
dict = 'mini@repair',
clip = 'fixing_a_ped',
flag = 49
}
})
if completed then
TriggerServerEvent('my-resource:finishRepair')
end
```
## Options [#options]
| Field | Type | Default | Description | |
| ------------------------ | ---------- | ----------- | -------------------------------------------------------------------------------- | --------------------------------------- |
| `id` | `string?` | generated | Run ID used to match completion and cancellation. | |
| `label` | `string?` | empty | Main text. | |
| `description` | `string?` | empty | Supporting text. | |
| `labelTranslation` | `string?` | none | Frontend locale key used instead of `label` when found. | |
| `descriptionTranslation` | `string?` | none | Frontend locale key used instead of `description` when found. | |
| `duration` | `number?` | `3000` | Milliseconds. Supply it explicitly; Lua adds a two-second watchdog grace period. | |
| `canCancel` | `boolean?` | `true` | Whether the player can cancel. `cancellable` is an alias. | |
| `keybind` | `string?` | `"X"` | Key shown in the interface. `cancelKey` is an alias. | |
| `cancelControl` | `number?` | derived | GTA control ID. Use it when a custom key label has no built-in mapping. | |
| `disable` | `table?` | none | Control groups disabled while active. | |
| `anim` | `table?` | none | Animation dictionary/clip or scenario. | |
| `prop` | \`table | table\[]?\` | none | One attached prop or an array of props. |
| `useWhileDead` | `boolean?` | `false` | Allow progress while dead or fatally injured. | |
| `allowRagdoll` | `boolean?` | `false` | Allow progress while ragdolling. | |
| `allowSwimming` | `boolean?` | `false` | Allow progress while swimming or underwater. | |
| `allowCuffed` | `boolean?` | `false` | Allow progress while cuffed. | |
| `allowFalling` | `boolean?` | `false` | Allow progress while falling. | |
Supported `disable` keys are `move`, `car`, `combat`, `mouse`, and `sprint`.
## Animations and scenarios [#animations-and-scenarios]
```lua title="Animation"
anim = {
dict = 'amb@world_human_hammering@male@base',
clip = 'base',
blendIn = 3.0,
blendOut = 1.0,
duration = -1,
flag = 49,
playbackRate = 0.0,
lockX = false,
lockY = false,
lockZ = false
}
```
```lua title="Scenario"
anim = {
scenario = 'WORLD_HUMAN_WELDING',
playEnter = true
}
```
`anim` is accepted as an alias for `clip`; `flags` is accepted as an alias for `flag`.
## Props [#props]
```lua
prop = {
model = 'prop_tool_box_04',
bone = 60309,
pos = vec3(0.0, 0.0, 0.0),
rot = vec3(0.0, 0.0, 0.0),
rotOrder = 0
}
```
`model` may be a model name or hash. `pos` and `rot` accept `vector3`, named `{ x, y, z }` tables, or numeric arrays. Loaded animations and spawned props are cleaned up when the action ends or the resource stops.
## State and cancellation [#state-and-cancellation]
```lua
if exports['orbit-dynamichud-v2']:progressActive() then
exports['orbit-dynamichud-v2']:cancelProgress()
end
```
## ox\_lib drop-in replacement [#ox_lib-drop-in-replacement]
```lua title="client/orbit_progress.lua"
lib = lib or {}
lib.progressBar = function(data)
return exports['orbit-dynamichud-v2']:progressBar(data)
end
-- Keeps existing progressCircle calls functional using DynamicHUD 2.0's progress view.
lib.progressCircle = lib.progressBar
lib.progressActive = function()
return exports['orbit-dynamichud-v2']:progressActive()
end
lib.cancelProgress = function()
return exports['orbit-dynamichud-v2']:cancelProgress()
end
```
The data structure and boolean return behavior are compatible with ox\_lib. DynamicHUD 2.0 provides one progress presentation, so both ox\_lib entry points render the DynamicHUD 2.0 progress bar and `progressCircle.position` has no visual effect.
The local event `orbit-dynamichud:progressBarOver` receives the NUI result table. Use the export return value for ordinary gameplay logic.
# QB-Core integration (/docs/orbit-studios-resources/orbit-dynamichud-v2/interface/qb-core)
# QB-Core integration [#qb-core-integration]
These mappings follow [QB-Core's client functions](https://github.com/qbcore-framework/qb-core/blob/main/client/functions.lua), [DrawText exports](https://github.com/qbcore-framework/qb-core/blob/main/client/drawtext.lua), and [progressbar contract](https://github.com/qbcore-framework/progressbar). Start `orbit-dynamichud-v2` before resources that call its exports. Apply changes to the **resource that owns each call**; Lua globals are not shared across resources.
## Notifications [#notifications]
For a client-side `QBCore.Functions.Notify(text, type, length)`, use:
```lua
exports['orbit-dynamichud-v2']:notify({
description = 'Vehicle stored.',
type = 'success',
duration = 5000
})
```
QB also accepts `{ text = 'Heading', caption = 'Details' }`. Map `text` to HUD `title` and `caption` to `description`. `primary` may be passed as `type = 'primary'`; QB-only icon or visual settings may not have the same appearance in the HUD.
For a server-side `QBCore.Functions.Notify(source, text, type, length)` or `TriggerClientEvent('QBCore:Notify', ...)`, send only the HUD event:
```lua
TriggerClientEvent('orbit-dynamichud:notify', source, {
description = 'Vehicle stored.',
type = 'success',
duration = 5000
})
```
QB-Core's own [server Notify](https://github.com/qbcore-framework/qb-core/blob/main/server/functions.lua) and [client `QBCore:Notify` handler](https://github.com/qbcore-framework/qb-core/blob/main/client/events.lua) are separate paths. A bridge loaded in one unrelated resource will **not** replace either framework path globally.
## DrawText / HideText [#drawtext--hidetext]
Replace QB's `DrawText` and `HideText` calls in the same client resource:
```lua
-- exports['qb-core']:DrawText('[E] Open garage', 'left')
exports['orbit-dynamichud-v2']:showTextUI('[E] Open garage', {
position = 'left-center'
})
-- exports['qb-core']:HideText()
exports['orbit-dynamichud-v2']:hideTextUI()
```
The HUD supports `left-center`, `right-center`, `top-center`, and `bottom-center`; translate QB placement deliberately. QB's `KeyPressed` helper hides its prompt, so replace that behavior with `hideTextUI()` at the point where the key is accepted. Show once on interaction entry, hide on exit or resource stop, and avoid a per-frame show loop.
## Progressbar callbacks [#progressbar-callbacks]
QB's `QBCore.Functions.Progressbar(...)` is callback-based. The HUD's progress export returns a boolean **after** the action ends. Use a thread if your existing script depends on immediate return, and map QB's control/animation/prop fields:
```lua
local function hudProgressbar(name, label, duration, useWhileDead, canCancel,
disableControls, animation, prop, propTwo, onFinish, onCancel)
disableControls = disableControls or {}
animation = animation or {}
local function hudProp(value)
if not value or not value.model then return nil end
return {
model = value.model,
bone = value.bone,
pos = value.coords,
rot = value.rotation
}
end
local props = {}
local first, second = hudProp(prop), hudProp(propTwo)
if first then props[#props + 1] = first end
if second then props[#props + 1] = second end
CreateThread(function()
local completed = exports['orbit-dynamichud-v2']:progressBar({
id = name,
label = label,
duration = duration,
useWhileDead = useWhileDead,
canCancel = canCancel,
disable = {
move = disableControls.disableMovement,
car = disableControls.disableCarMovement,
mouse = disableControls.disableMouse,
combat = disableControls.disableCombat
},
anim = animation.task and { scenario = animation.task } or
(animation.animDict and {
dict = animation.animDict,
clip = animation.anim,
flag = animation.flags
} or nil),
prop = #props > 0 and props or nil
})
if completed then
if onFinish then onFinish() end
elseif onCancel then
onCancel()
end
end)
end
-- Replace QBCore.Functions.Progressbar(...) with hudProgressbar(...)
hudProgressbar('repair', 'Repairing vehicle', 5000, false, true,
{ disableMovement = true, disableCombat = true },
{ animDict = 'mini@repair', anim = 'fixing_a_ped', flags = 49 },
nil, nil,
function() TriggerServerEvent('garage:repairFinished') end,
function() print('Cancelled') end)
```
This keeps the QB **callback timing** and translates the common fields. QB's progress UI and HUD progress UI have different visuals; inspect any custom flags, prop offsets, and cancellation assumptions in your scripts. Use `cancelProgress()` for actions that should be stopped programmatically. For a new action with no callback requirement, call `progressBar` directly and branch on its boolean result.
## Framework-wide migration [#framework-wide-migration]
Migrating your own scripts is the least risky option. To replace **QB-Core's own** notices, prompts, or progress display, maintain a tested QB-Core fork and change the relevant QB-Core client functions themselves (plus any direct `progressbar`/DrawText calls). Its `QBCore:Notify` handler already calls `QBCore.Functions.Notify`, so changing that function in the core captures the event path. Do not register a second `QBCore:Notify` handler without removing the original, or players will see duplicate notices. Core edits may be overwritten by framework updates. Search every resource before stopping QB's `progressbar` dependency.
QB-Core does not define one universal skill-check contract. Use the HUD [Skill Check export](/docs/orbit-studios-resources/orbit-dynamichud-v2/interface/skill-check) where your own scripts require a timing check.
# QBX integration (/docs/orbit-studios-resources/orbit-dynamichud-v2/interface/qbx-core)
# QBX integration [#qbx-integration]
Qbox's [client `Notify` export](https://github.com/Qbox-project/qbx_core/blob/main/client/functions.lua) calls `lib.notify`. Its QB-compatibility layer uses ox\_lib for other interfaces. The [server Notify path](https://github.com/Qbox-project/qbx_core/blob/main/server/functions.lua) is separate. Keep `ox_lib` installed for Qbox's other features; replacing an interface does not replace the framework dependency.
## Calls in your own resources [#calls-in-your-own-resources]
Replace a client-side `exports.qbx_core:Notify(text, type, duration, subTitle)` with the HUD export:
```lua
exports['orbit-dynamichud-v2']:notify({
title = 'Garage',
description = 'Vehicle stored.',
type = 'success',
duration = 4000
})
```
When the Qbox `text` argument is a table, map its `text` field to HUD `title` and `caption` to `description`. When it is a string with `subTitle`, use the string as `title` and the subtitle as `description`; a plain string can be the HUD `description`. Qbox-only position/style options are not 1:1 HUD options.
Replace a server-side `exports.qbx_core:Notify(source, ...)` in your own script with:
```lua
TriggerClientEvent('orbit-dynamichud:notify', source, {
description = 'Vehicle stored.',
type = 'success',
duration = 4000
})
```
For scripts already using `lib.notify`, `lib.showTextUI`, `lib.skillCheck`, or `lib.progressBar`, load the [complete ox\_lib compatibility bridge](/docs/orbit-studios-resources/orbit-dynamichud-v2/interface#complete-ox-lib-compatibility-bridge) **inside that resource**, after `@ox_lib/init.lua`. This keeps their established signatures and the HUD's progress boolean return. `lib.progressCircle` renders the HUD's progress bar.
## QB compatibility calls [#qb-compatibility-calls]
Qbox's QB compatibility layer accepts `QBCore.Functions.Notify`, `QBCore.Functions.Progressbar`, and DrawText-like calls. If **your script** calls those APIs, use the [QB-Core migration guide](/docs/orbit-studios-resources/orbit-dynamichud-v2/interface/qb-core) to migrate its call sites. QB-style progress is callback-based; do not replace it with a blocking HUD call inside a non-yielding callback without a thread. The Qbox bridge may internally call `lib.progressBar` and `lib.showTextUI`, but overriding `lib` in a third-party resource does not modify `qbx_core`'s own Lua environment.
## Replacing Qbox's own client UI [#replacing-qboxs-own-client-ui]
If you maintain a Qbox fork and need framework-generated UI to use the HUD, load `client/orbit_ui_bridge.lua` from the [ox\_lib bridge guide](/docs/orbit-studios-resources/orbit-dynamichud-v2/interface#complete-ox-lib-compatibility-bridge) in **`qbx_core` itself**. Add it to `qbx_core/fxmanifest.lua` as the first `client_scripts` entry, after the existing shared `@ox_lib/init.lua` has loaded:
```lua title="qbx_core/fxmanifest.lua (excerpt)"
client_scripts {
'client/orbit_ui_bridge.lua',
'client/main.lua',
-- Keep the remaining existing qbx_core client scripts in their original order.
}
```
Keep `ox_lib` and its manifest entry; Qbox uses it beyond the four interfaces. This redirects `qbx_core`'s client-side `lib.notify`, progress, Text UI, and skill checks in its own Lua environment. It **does not automatically redirect** `qbx_core`'s server-side `Notify` implementation if that implementation emits `ox_lib:notify` directly. Migrate that server path separately in your maintained fork, or migrate the server call sites in your own resources. Confirm the exact paths in your installed Qbox revision before editing, keep a backup, and reapply/test changes after Qbox updates.
Never register a second handler just to display the same framework event without disabling the original display path. Test one client notification, one server notification, Text UI show/hide, progress success/cancel, and an existing QB-compatibility resource before removing any old interface UI.
# Skill Check (/docs/orbit-studios-resources/orbit-dynamichud-v2/interface/skill-check)
# Skill Check [#skill-check]
`skillCheck` yields the calling Lua thread until the player succeeds, fails, cancels, or reaches the 60-second safety timeout. It returns `true` only when every configured step succeeds.
```lua title="Single check"
local success = exports['orbit-dynamichud-v2']:skillCheck('medium', { 'E', 'Q' })
if success then
print('Skill check passed')
else
print('Skill check failed or was cancelled')
end
```
## Difficulty [#difficulty]
| Preset | Success area | Speed multiplier |
| -------- | -----------: | ---------------: |
| `easy` | `50` | `1.0` |
| `medium` | `40` | `1.5` |
| `hard` | `25` | `1.75` |
Pass an array for sequential checks. Each successful step advances to the next:
```lua title="Sequence"
local success = exports['orbit-dynamichud-v2']:skillCheck({
'easy',
'medium',
{ areaSize = 30, speedMultiplier = 1.9 }
}, { 'E', 'Q', 'SPACE' })
```
`areaSize` is clamped from `1` to `360`. `speedMultiplier` has a minimum of `0.1`. Inputs are normalized to uppercase; `SPACEBAR` becomes `SPACE`, `ESCAPE` becomes `ESC`, and no input table defaults to `E`.
Only one skill check can run at once. A second call returns `false` immediately.
```lua title="State and cancellation"
if exports['orbit-dynamichud-v2']:skillCheckActive() then
exports['orbit-dynamichud-v2']:cancelSkillCheck()
end
```
## ox\_lib drop-in replacement [#ox_lib-drop-in-replacement]
```lua title="client/orbit_skillcheck.lua"
lib = lib or {}
lib.skillCheck = function(difficulty, inputs)
return exports['orbit-dynamichud-v2']:skillCheck(difficulty, inputs)
end
lib.skillCheckActive = function()
return exports['orbit-dynamichud-v2']:skillCheckActive()
end
lib.cancelSkillCheck = function()
return exports['orbit-dynamichud-v2']:cancelSkillCheck()
end
```
The difficulty, input, active-state, cancellation, and boolean return contracts match the ox\_lib calls, so existing gameplay branches remain unchanged.
The local client event `orbit-dynamichud:skillCheckOver` fires when NUI submits a result. Normal gameplay code should use the blocking return value.
# Text UI (/docs/orbit-studios-resources/orbit-dynamichud-v2/interface/text-ui)
# Text UI [#text-ui]
Text UI displays a persistent interaction prompt. Show it once when an interaction becomes available and hide it when the player leaves. Do not call `showTextUI` every frame.
```lua title="Client exports"
exports['orbit-dynamichud-v2']:showTextUI('[E] Open garage', {
position = 'right-center',
icon = 'fas fa-warehouse',
iconColor = '#71B6F7'
})
-- When the interaction is no longer available:
exports['orbit-dynamichud-v2']:hideTextUI()
```
The event form is useful from bridge resources:
```lua title="Client events"
TriggerEvent('orbit-dynamichud:showTextUI', '{key:E} Open garage', {
position = 'left-center'
})
TriggerEvent('orbit-dynamichud:hideTextUI')
```
A server script can target one player with the same events:
```lua title="Server events"
TriggerClientEvent('orbit-dynamichud:showTextUI', source, '[E] Continue')
TriggerClientEvent('orbit-dynamichud:hideTextUI', source)
```
## Options [#options]
| Option | Type | Default | Description | |
| --------------- | --------- | ---------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| `position` | `string?` | `"right-center"` | `right-center`, `left-center`, `top-center`, or `bottom-center`. | |
| `icon` | \`string | string\[]?\` | none | Free Font Awesome icon name/classes. An array is joined into one class string. |
| `iconColor` | `string?` | white | CSS icon color. | |
| `iconAnimation` | `string?` | none | `spin`, `spinPulse`, `spinReverse`, `pulse`, `beat`, `fade`, `beatFade`, `bounce`, or `shake`. | |
| `alignIcon` | `string?` | `"center"` | `center` or `top`. | |
| `style` | `table?` | none | Sanitized CSS overrides. Camel-case names are accepted; numeric dimensions become pixels. | |
Use `[E]` or `{key:E}` to render a key marker. Newlines create multiple lines.
```lua title="Multiline prompt"
exports['orbit-dynamichud-v2']:showTextUI('{key:E} Search\nPolice may be alerted', {
position = 'bottom-center',
icon = { 'fas', 'fa-magnifying-glass' },
iconAnimation = 'pulse',
alignIcon = 'top',
style = {
maxWidth = '28vh',
opacity = 0.95
}
})
```
Query its state and current text:
```lua
local isOpen, currentText = exports['orbit-dynamichud-v2']:isTextUIOpen()
```
## ox\_lib drop-in replacement [#ox_lib-drop-in-replacement]
```lua title="client/orbit_textui.lua"
lib = lib or {}
lib.showTextUI = function(text, options)
return exports['orbit-dynamichud-v2']:showTextUI(text, options)
end
lib.hideTextUI = function()
return exports['orbit-dynamichud-v2']:hideTextUI()
end
lib.isTextUIOpen = function()
return exports['orbit-dynamichud-v2']:isTextUIOpen()
end
```
This preserves the ox\_lib signatures and both return values from `lib.isTextUIOpen()`. Existing calls require no edits.
Showing new text replaces the active prompt. Explicitly call `hideTextUI` during interaction cleanup and resource stop.