Framework abstraction
Detects Qbox, QBCore, ESX, OX, vRP or standalone mode and exposes normalized player, identifier, name, job, grade, duty and money helpers.
Brunx Bridge is a future-proof compatibility layer that normalizes framework logic, job checks, money helpers, inventory usage, target zones, UI helpers, callbacks and elevators across your resources.
-- Server-side usage
local Bridge = exports['brnx_bridge']:GetBridge()
RegisterCommand('bridgejob', function(source)
local job = Bridge.GetJob(source)
print(json.encode(job))
end, false)
-- Client-side usage
local Bridge = exports['brnx_bridge']:GetBridge()
Bridge.Notify({
title = 'Bridge',
description = 'Client bridge loaded.',
type = 'success'
})
Instead of writing separate code for every framework, inventory, target and UI system, your scripts can call Brunx Bridge once and let the bridge normalize the differences.
Detects Qbox, QBCore, ESX, OX, vRP or standalone mode and exposes normalized player, identifier, name, job, grade, duty and money helpers.
Provides simple server-side item helpers with ox_inventory support and player function fallback for compatible frameworks.
Uses ox_target when available, qb-target when available, and a drawtext interaction fallback when no target resource is running.
Uses ox_lib for notifications, progress bars, context menus and text UI, keeping UI usage consistent across resources.
Wraps ox_lib callback registration and client triggering so scripts can use one consistent pattern.
Includes a configurable elevator system with global elevators, map-specific elevators, job locks, boss locks, progress bars and carry support.
Install the bridge before any resource that depends on it. The simplest setup is: download, rename, ensure, configure and restart.
Download the latest main branch archive and extract it into your FiveM resources folder.
Rename the extracted folder to brnx_bridge if needed, so the resource name matches your exports and dependencies.
Ensure ox_lib, oxmysql and then brnx_bridge before dependent resources.
Edit shared/config.lua and keep most values on auto unless you intentionally want to force a specific setup.
ensure ox_lib
ensure oxmysql
ensure brnx_bridge
# your resource that depends on the bridge
ensure my_resource
The recommended pattern is to fetch the bridge object once and use the normalized helper functions from that object.
-- server.lua
local Bridge = exports['brnx_bridge']:GetBridge()
RegisterCommand('checkjob', function(source)
local job = Bridge.GetJob(source)
Bridge.Notify(source, {
title = 'Current Job',
description = ('You are working as %s'):format(job.label or job.name or 'Unknown'),
type = 'inform'
})
end, false)
-- client.lua
local Bridge = exports['brnx_bridge']:GetBridge()
CreateThread(function()
Wait(1000)
Bridge.Notify({
title = 'Bridge Ready',
description = 'Client bridge initialized successfully.',
type = 'success'
})
end)
Edit shared/config.lua. Use auto unless you want to force a specific framework, inventory or target system.
Config.Debug = false
Config.Locale = 'nl'
-- auto, qbox, qbcore, esx, ox, vrp, standalone
Config.Framework = 'auto'
-- auto, ox_inventory, qb-inventory, lj-inventory, ps-inventory,
-- qs-inventory, origen_inventory, codem-inventory, core_inventory,
-- mf-inventory, esx_inventory, standalone
Config.Inventory = 'auto'
-- auto, ox_target, qb-target, drawtext
Config.Target = 'auto'
Config.NotifySystem = 'ox_lib'
Config.Menu = 'ox_lib'
Config.Input = 'ox_lib'
Config.Progress = 'ox_lib'
Config.TextUI = 'ox_lib'
| Option | Description | Typical value |
|---|---|---|
Config.Debug | Prints bridge debug information when enabled. | false |
Config.Locale | Default locale file used by the bridge. | nl or en |
Config.Framework | Framework mode. Auto-detection supports Qbox, QBCore, ESX, OX, vRP and standalone. | auto |
Config.Inventory | Inventory mode. Auto-detection can be used, or you can force your inventory type. | auto |
Config.Target | Target mode. Falls back to drawtext if ox_target or qb-target is not available. | auto |
Config.ResourceNames | Resource name aliases used during auto-detection. | Keep defaults unless your resources use custom names. |
Config.CustomGetPlayerJob | Optional server hook to return a custom normalized job object. | function(source) return nil end |
The recommended pattern is to get the bridge object once and call functions from that object. Direct exports stay small; the Bridge object contains the real module helpers.
exports['brnx_bridge']:GetBridge()
exports['brnx_bridge']:GetFramework()
exports['brnx_bridge']:GetPlayer(source)
exports['brnx_bridge']:GetIdentifier(source)
exports['brnx_bridge']:GetJob(source)
exports['brnx_bridge']:GetJobName(source)
exports['brnx_bridge']:HasJob(source, jobs)
exports['brnx_bridge']:Notify(source, data)
exports['brnx_bridge']:GetBridge()
exports['brnx_bridge']:GetFramework()
exports['brnx_bridge']:Notify(data)
exports['brnx_bridge']:GetPlayerData()
exports['brnx_bridge']:GetJob()
exports['brnx_bridge']:GetJobName()
exports['brnx_bridge']:HasJob(jobs)
| Function | Returns | Description |
|---|---|---|
Bridge.GetFramework() | string | Returns the detected framework name. |
Bridge.GetPlayer(source) | table | nil | Returns the framework player object or standalone fallback. |
Bridge.GetIdentifier(source) | string | nil | Returns citizenid, license, identifier or a license fallback. |
Bridge.GetName(source) | string | Returns character name when available, otherwise player name. |
Bridge.GetJob(source) | table | Returns a normalized job object with name, label, grade, gradeLabel, isBoss, type and duty. |
Bridge.GetJobName(source) | string | nil | Returns the normalized job name only. |
Bridge.GetGrade(source) | number | Returns the normalized job grade. |
Bridge.IsOnDuty(source) | boolean | Returns false only when duty is explicitly false. |
Bridge.HasJob(source, jobs) | boolean | Checks string, array or rule table job access. |
Bridge.GetPlayers() | table | Returns online player sources. |
Bridge.GetPlayersByJob(jobs) | table | Returns online players matching the provided job rule. |
Bridge.GetMoney(source, account) | number | Reads player money from cash, bank or another supported account. |
Bridge.AddMoney(source, account, amount, reason) | boolean | Adds player money through the active framework. |
Bridge.RemoveMoney(source, account, amount, reason) | boolean | Removes player money through the active framework. |
Bridge.Notify(source, data) | nil | Sends a bridge notification to one client. |
Bridge.RegisterCallback(name, cb) | boolean | Registers an ox_lib server callback. |
Bridge.AddItem(source, item, amount, metadata, slot) | boolean | Adds an item using ox_inventory or a framework fallback. |
Bridge.RemoveItem(source, item, amount, slot, metadata) | boolean | Removes an item using ox_inventory or a framework fallback. |
Bridge.HasItem(source, item, amount) | boolean | Checks if a player has at least the requested amount. |
Bridge.Society.GetMoney(account) | number | Reads a society account balance from supported banking resources. |
Bridge.Society.AddMoney(account, amount) | boolean | Adds money to a society account. |
Bridge.Society.RemoveMoney(account, amount) | boolean | Removes money from a society account. |
| Function | Returns | Description |
|---|---|---|
Bridge.GetFramework() | string | Returns the detected client framework. |
Bridge.GetPlayerData() | table | Returns framework player data when available. |
Bridge.GetJob() | table | Returns the normalized client job object. |
Bridge.GetJobName() | string | nil | Returns the normalized job name only. |
Bridge.GetGrade() | number | Returns the normalized job grade. |
Bridge.IsOnDuty() | boolean | Returns the duty state from normalized job data. |
Bridge.HasJob(jobs) | boolean | Checks the current player job against a string, array or table. |
Bridge.Notify(data) | nil | Shows an ox_lib notification or a GTA feed fallback. |
Bridge.TriggerCallback(name, cb, ...) | nil | Triggers an ox_lib callback from the client. |
Bridge.ShowTextUI(text, options) | boolean | Shows an ox_lib text UI element. |
Bridge.HideTextUI() | boolean | Hides the current ox_lib text UI element. |
Bridge.Progress(data) | boolean | Runs an ox_lib progress bar. |
Bridge.ContextMenu(data) | boolean | Registers and opens an ox_lib context menu. |
Bridge.Target.AddBoxZone(id, data) | boolean | Adds a box zone through ox_target, qb-target or the drawtext fallback. |
Below are practical examples you can copy directly into your own resources and adapt as needed.
-- Server: simple job lock
local Bridge = exports['brnx_bridge']:GetBridge()
RegisterCommand('armory', function(source)
if not Bridge.HasJob(source, { police = true, sheriff = true }) then
return Bridge.Notify(source, {
title = 'Access denied',
description = 'You are not allowed to use the armory.',
type = 'error'
})
end
Bridge.Notify(source, {
title = 'Access granted',
description = 'Welcome to the armory.',
type = 'success'
})
end, false)
-- Server: items and money
local Bridge = exports['brnx_bridge']:GetBridge()
RegisterNetEvent('example:rewardPlayer', function()
local src = source
Bridge.AddItem(src, 'water', 2)
Bridge.AddMoney(src, 'bank', 500, 'Mission reward')
Bridge.Notify(src, {
title = 'Reward received',
description = 'You received water and $500 in your bank account.',
type = 'success'
})
end)
-- Client: target zone with fallback
local Bridge = exports['brnx_bridge']:GetBridge()
CreateThread(function()
Bridge.Target.AddBoxZone('example_zone', {
coords = vec3(441.2, -981.9, 30.7),
size = vec3(1.6, 1.6, 2.0),
rotation = 0.0,
debug = false,
options = {
{
name = 'example_interaction',
label = 'Open Example Menu',
icon = 'fa-solid fa-door-open',
onSelect = function()
Bridge.Notify({
title = 'Interaction',
description = 'The bridge target fallback is working.',
type = 'inform'
})
end
}
}
})
end)
-- Client: progress bar
local Bridge = exports['brnx_bridge']:GetBridge()
RegisterCommand('bridgeprogress', function()
local success = Bridge.Progress({
duration = 5000,
label = 'Processing request...',
canCancel = true,
disable = {
car = true,
move = true,
combat = true
}
})
if success then
Bridge.Notify({ title = 'Done', description = 'Action completed.', type = 'success' })
else
Bridge.Notify({ title = 'Cancelled', description = 'Action cancelled.', type = 'error' })
end
end, false)
Brunx Bridge ships with a configurable elevator system. You can use global elevators, map-specific elevators and advanced job access rules including boss-only or duty-only floors.
Config.Elevators = {
enabled = true,
useProgressBar = true,
progressDuration = 5000,
allowCarry = true,
defaultIcon = 'fa-solid fa-elevator',
global = {
{
id = 'mission_row_pd',
label = 'Mission Row Police Department',
floors = {
{
label = 'Lobby',
coords = vec4(441.15, -981.92, 30.69, 90.0)
},
{
label = 'Roof',
coords = vec4(448.87, -981.21, 43.69, 180.0),
jobLock = {
jobs = {
police = true,
sheriff = { minGrade = 2 },
fib = { bossOnly = true }
}
}
}
}
}
}
}
jobLock.jobsUse job names as keys. The value can be true, a minimum grade number, or a table with minGrade, bossOnly and dutyOnly.
jobLock.jobTypesUse normalized job types such as leo or ems when your framework exposes a job type.
hideIfNoAccessWhen true, unauthorized floors can be hidden from the menu instead of being shown as locked.
Most integrations will rely on exports and the bridge object, but these events can still be useful for reactive setups.
| Event | Side | Description |
|---|---|---|
Bridge:Refresh | Server | Triggered when a registered bridge module is refreshed. Useful if another resource wants to respond to bridge module changes. |
brnx_bridge:client:notify | Client | Displays a bridge-based notification on the client. |
brnx_bridge:elevators:open | Client | Opens the elevator menu for a nearby configured elevator when available. |