Framework Bridge
The HUD reads player and vehicle data through a small bridge file per
framework — src/frameworks/qb/client.lua, src/frameworks/qbox/client.lua
or src/frameworks/esx/client.lua. These files are not escrowed, so you
can edit them freely to connect the HUD to your own scripts (gang systems,
dirty-money systems, mileage scripts, …) without touching anything else.
Every function below is polled by the HUD on its own timer
(Config.PlayerInfo.tickInterval, 5 seconds by default), so a plain “read the
value and return it” implementation is enough. If you want a change to show
immediately, see Force a refresh at the end.
Gang pill
Framework:getGang() feeds the gang pill in Player Info. Return a table to
show it, or false to hide it.
-- return: table | false
-- name: string - internal gang name
-- label: string - display name (falls back to name)
-- grade: string - optional rank shown after the label ("Ballas - Boss")
function Framework:getGang()
...
endOut of the box: QBCore / Qbox return the player’s PlayerData.gang
(hidden when the gang is none) and update on QBCore:Client:OnGangUpdate;
ESX returns false (no native gangs).
Example — connect a third-party gang script (op-gangs, rcore_gangs, …):
function Framework:getGang()
local gang = exports["op-gangs"]:GetPlayerGang() -- your gang script's own export / statebag
if not gang or not gang.name then return false end
return { name = gang.name, label = gang.label or gang.name, grade = gang.grade }
endServer owners who never want the pill can set
Config.DefaultSettings.playerInfo.showGang = false.
Dirty money pill
Framework:getDirtyMoney() feeds the dirty-money pill. Return a number; the
pill is only shown while the value is greater than 0. Return false to
never show it.
-- return: number | false
function Framework:getDirtyMoney()
...
endOut of the box: ESX returns the black_money account (kept live via
esx:setAccountMoney); QBCore / Qbox return false (no native dirty
money account). Servers that use an item or a custom account for dirty money
can return that value here:
function Framework:getDirtyMoney()
return exports["my-dirty-money"]:GetBalance() or 0
endThe amount is formatted with Config.Currency like the other money pills.
Config.DefaultSettings.playerInfo.showDirtyMoney = false hides the pill for
everyone.
Vehicle mileage
By default the HUD tracks mileage itself (Config.Mileage.provider = "builtin"). To display mileage from another script instead — for example
jg-vehiclemileage — switch the
provider and implement Framework:getVehicleMileage:
Config.Mileage = {
provider = "framework", -- built-in tracker off, ask the bridge instead
}-- vehicle: entity handle of the vehicle the player is in
-- plate: string - licence plate text
-- return: number | false - mileage in kilometres, or false to hide the odometer tile
function Framework:getVehicleMileage(vehicle, plate)
return exports["jg-vehiclemileage"]:getMileage() -- jg returns km for the current vehicle
endThe HUD converts to miles automatically when Config.SpeedUnit = "mph".
Returning false hides the odometer tile on the vehicle info bar.
Force a refresh
The bridge is polled every Config.PlayerInfo.tickInterval milliseconds, so
a change shows within a few seconds. To push it instantly — for example from
your gang script’s “gang updated” event — trigger a refresh:
exports["bablo-hud"]:RefreshPlayerInfo()
-- or, from any client script / handler:
TriggerEvent("bablo-hud:playerinfo:refresh")Both rebuild the Player Info snapshot right away (gang, dirty money, job, money, ID, weapon) and send it to the HUD.
-- example: op-gangs fires an event when the local player's gang changes
RegisterNetEvent("op-gangs:client:gangUpdated", function()
TriggerEvent("bablo-hud:playerinfo:refresh")
end)Other bridge functions
The same files also hold the hooks the rest of the HUD reads. Edit them the same way if your server replaces a system:
| Function | Used by | Return |
|---|---|---|
Framework:getJob() | job pill | label, grade |
Framework:getMoney() | cash / bank pills | cash, bank |
Framework:getFuel(vehicle) | speedometer fuel gauge | 0-100 (defaults to the native fuel level; override for statebag-based fuel scripts) |
Framework:getStress() | stress status (when Config.Stress.integrated = false) | 0-100 |
Framework:getNitro() | nitro status (when Config.Nitro.enabled = true) | 0-100 |
Framework:isSeatbeltOn() | seatbelt icon (when Config.Seatbelt.enabled = false) | bool |
Framework:getPlayerId() | ID pill | number |

