Skip to content

Server Exports ​

The money exports have the same names and arguments as the original qb-management. They now go through the active banking bridge, so they work with qb-banking, Renewed-Banking, Old QBCore management_funds and every other supported bank.

Job and gang names must be lowercase letters, numbers, _ or - (up to 50 characters). Amounts are whole numbers of at least 1.

GetAccount

Returns the money of a job's society account, or 0 when the name is invalid or the service is not ready.

lua
local balance = exports['qb-management']:GetAccount('mechanic')
AddMoney

Adds money to a job's society account. Returns true when the money really moved.

lua
exports['qb-management']:AddMoney('mechanic', 500)
exports['qb-management']:AddMoney('mechanic', 500, 'Repair invoice') -- optional reason
NameTypeRequired
jobstringYes
amountnumberYes
reasonstringNo (default External deposit)
RemoveMoney

Takes money from a job's society account. Returns true when the money really moved, false otherwise (for example when the balance is too low).

lua
local ok = exports['qb-management']:RemoveMoney('mechanic', 250)

Optional third argument reason (default External withdrawal).

GetGangAccount

Returns the money of a gang's account.

lua
local balance = exports['qb-management']:GetGangAccount('ballas')
AddGangMoney

Adds money to a gang's account. Returns true when the money really moved.

lua
exports['qb-management']:AddGangMoney('ballas', 1000)

Optional third argument reason.

RemoveGangMoney

Takes money from a gang's account. Returns true when the money really moved.

lua
exports['qb-management']:RemoveGangMoney('ballas', 1000)

Optional third argument reason.

OpenBossMenu

Opens the boss tablet for a player. The server still checks that the player is a boss of that job.

lua
exports['qb-management']:OpenBossMenu(playerId, jobName, close, options)
NameTypeRequiredNotes
playerIdnumberYesServer ID
jobNamestringNoDefaults to the player's own job
closebooleanNo
optionstableNoTurns sections off (see below)

Options (all true by default): checkBal, withdraw, deposit, wash, employees, salary, grades. Set one to false to block it for this tablet. These limits are enforced on the server.

lua
exports['qb-management']:OpenBossMenu(source, 'mechanic', true, { wash = false, withdraw = false })

Returns true when the tablet was opened.

OpenGangMenu

Opens the gang tablet for the player's own gang. The server checks that the player is a gang boss.

lua
local opened = exports['qb-management']:OpenGangMenu(playerId)

Event hooks ​

bridge/events/server.lua is unlocked. Its functions are empty and run on the server after an action succeeded. Put your own code in the ones you need and restart qb-management. They only notify you; they cannot cancel an action.

HookArguments
OnHireplayerId, jobName, employeeIdentifier, grade, info
OnFireplayerId, jobName, employeeIdentifier, previousGrade, info
OnPromoteplayerId, jobName, employeeIdentifier, oldGrade, newGrade, info
OnDemoteplayerId, jobName, employeeIdentifier, oldGrade, newGrade, info
OnDepositplayerId, jobName, amount, balanceAfter, accountName, info
OnWithdrawplayerId, jobName, amount, balanceAfter, accountName, info
OnMoneyWashplayerId, jobName, amount, washId, durationSeconds, info
OnMoneyWashedplayerId, jobName, amount, balanceAfter, accountName, info
OnMoneyWashCommissionplayerId, jobName, amount, balanceAfter, accountName, info
OnFireEmployeesplayerId, jobName, firedCount, info
OnActionactionName, playerId, jobName, info
lua
function ManagementServerEvents.OnHire(playerId, jobName, employeeIdentifier, grade, info)
    print(('%s hired %s as rank %s'):format(jobName, employeeIdentifier, grade))
end
  • playerId is a server ID, or 0 when the player is offline or it was the console. Use the identifiers when it is 0.
  • info holds extra data such as actorIdentifier, actorName, operationId (when there is one), occurredAt and details.
  • OnAction runs after the named hook and also covers other actions (jobs, ranks, points, webhooks, settings).
  • Bulk firing calls OnFireEmployees once, not OnFire per employee.
  • Errors in a hook are caught and logged. Use info.operationId to skip duplicates.

FWB Studio documentation.