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.
local balance = exports['qb-management']:GetAccount('mechanic')AddMoney
Adds money to a job's society account. Returns true when the money really moved.
exports['qb-management']:AddMoney('mechanic', 500)
exports['qb-management']:AddMoney('mechanic', 500, 'Repair invoice') -- optional reason| Name | Type | Required |
|---|---|---|
job | string | Yes |
amount | number | Yes |
reason | string | No (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).
local ok = exports['qb-management']:RemoveMoney('mechanic', 250)Optional third argument reason (default External withdrawal).
GetGangAccount
Returns the money of a gang's account.
local balance = exports['qb-management']:GetGangAccount('ballas')AddGangMoney
Adds money to a gang's account. Returns true when the money really moved.
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.
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.
exports['qb-management']:OpenBossMenu(playerId, jobName, close, options)| Name | Type | Required | Notes |
|---|---|---|---|
playerId | number | Yes | Server ID |
jobName | string | No | Defaults to the player's own job |
close | boolean | No | |
options | table | No | Turns 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.
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.
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.
| Hook | Arguments |
|---|---|
OnHire | playerId, jobName, employeeIdentifier, grade, info |
OnFire | playerId, jobName, employeeIdentifier, previousGrade, info |
OnPromote | playerId, jobName, employeeIdentifier, oldGrade, newGrade, info |
OnDemote | playerId, jobName, employeeIdentifier, oldGrade, newGrade, info |
OnDeposit | playerId, jobName, amount, balanceAfter, accountName, info |
OnWithdraw | playerId, jobName, amount, balanceAfter, accountName, info |
OnMoneyWash | playerId, jobName, amount, washId, durationSeconds, info |
OnMoneyWashed | playerId, jobName, amount, balanceAfter, accountName, info |
OnMoneyWashCommission | playerId, jobName, amount, balanceAfter, accountName, info |
OnFireEmployees | playerId, jobName, firedCount, info |
OnAction | actionName, playerId, jobName, info |
function ManagementServerEvents.OnHire(playerId, jobName, employeeIdentifier, grade, info)
print(('%s hired %s as rank %s'):format(jobName, employeeIdentifier, grade))
endplayerIdis a server ID, or0when the player is offline or it was the console. Use the identifiers when it is0.infoholds extra data such asactorIdentifier,actorName,operationId(when there is one),occurredAtanddetails.OnActionruns after the named hook and also covers other actions (jobs, ranks, points, webhooks, settings).- Bulk firing calls
OnFireEmployeesonce, notOnFireper employee. - Errors in a hook are caught and logged. Use
info.operationIdto skip duplicates.
