Server Exports
RegisterBossMenu
The runtime export of the original qbx_management. Another resource adds a boss or gang menu spot while the server runs.
exports.qbx_management:RegisterBossMenu({
groupName = 'police',
type = 'job',
coords = vec3(441.8, -982.0, 30.7),
size = vec3(1.5, 1.5, 1.5),
rotation = 0,
})| Field | Type | Required | Notes |
|---|---|---|---|
groupName | string | Yes | Job or gang name |
type | 'job' or 'gang' | No | 'job' when left out |
coords | vector3 | Yes | Spot position |
size | vector3 | No | Sets the sphere radius: half of the larger of x and y, between 0.5 and 5. Default 1.5, 1.5, 1.5 |
rotation | number | No | Heading |
- The spot becomes a sphere management point through fwb_interact, for the boss ranks of that job or gang, with every boss-menu action allowed.
- Spots are not saved and do not show in the admin tablet's access points. They are removed when the resource that added them stops, as in the original.
Returns true when the spot was added, false when the group name or coords are missing.
OpenBossMenu
Opens the boss tablet for a player. Sections you turn off here are also blocked on the server for that tablet.
exports.qbx_management:OpenBossMenu(playerId, jobName, close, options)| Name | Type | Required | Notes |
|---|---|---|---|
playerId | number | Yes | Player server ID |
jobName | string | No | Job to open. The player's own job when left out |
close | boolean | No | Passed to the tablet |
options | table | No | Turns sections off (see below) |
| Option | When false |
|---|---|
deposit | No deposits |
withdraw | No withdrawals |
wash | No money wash and no wash list |
employees | No hiring, firing or rank changes of staff |
salary | No salary changes |
grades | No rank changes |
checkBal | Together with deposit and withdraw off: no balance and no transactions |
local opened = exports.qbx_management:OpenBossMenu(source, 'mechanic', true, {
wash = false,
salary = false,
})Returns true when the tablet was opened, false when the player is not a boss of that job.
While this tablet is open, the client open events cannot swap it for a full tablet. Closing the tablet ends this; if the close never arrives, it ends after 10 minutes.
OpenGangMenu
Opens the gang tablet of the player's gang.
local opened = exports.qbx_management:OpenGangMenu(playerId)Returns true when the tablet was opened, false when the player has no gang or is not a gang boss.
Event hooks
bridge/events/server.lua (unlocked) has empty functions that run on the server after an action succeeded. Put your own code in the ones you need; nothing has to be registered.
| 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 into %s'):format(playerId, employeeIdentifier, jobName))
endplayerIdis the server ID of the player who did it, or0when offline or from the console. Use the identifiers when it is0.infoholds extra data such asactorIdentifier,actorName,operationId,occurredAtanddetails.OnActionruns after the named hook and also covers other actions (jobs, ranks, points, webhooks, settings). Firing everyone usesOnFireEmployees, not oneOnFireper person.- Hooks only report; they cannot undo or cancel the action. Errors in them are caught and logged. Use
info.operationIdto skip a repeated notification. - Restart the resource after editing the file.
bridge/events/client.lua is an empty, comment-only example of sending your own event from a server hook to one player.
