Skip to content

Server Exports ​

RegisterBossMenu

The runtime export of the original qbx_management. Another resource adds a boss or gang menu spot while the server runs.

lua
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,
})
FieldTypeRequiredNotes
groupNamestringYesJob or gang name
type'job' or 'gang'No'job' when left out
coordsvector3YesSpot position
sizevector3NoSets the sphere radius: half of the larger of x and y, between 0.5 and 5. Default 1.5, 1.5, 1.5
rotationnumberNoHeading
  • 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.

lua
exports.qbx_management:OpenBossMenu(playerId, jobName, close, options)
NameTypeRequiredNotes
playerIdnumberYesPlayer server ID
jobNamestringNoJob to open. The player's own job when left out
closebooleanNoPassed to the tablet
optionstableNoTurns sections off (see below)
OptionWhen false
depositNo deposits
withdrawNo withdrawals
washNo money wash and no wash list
employeesNo hiring, firing or rank changes of staff
salaryNo salary changes
gradesNo rank changes
checkBalTogether with deposit and withdraw off: no balance and no transactions
lua
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.

lua
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.

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 into %s'):format(playerId, employeeIdentifier, jobName))
end
  • playerId is the server ID of the player who did it, or 0 when offline or from the console. Use the identifiers when it is 0.
  • info holds extra data such as actorIdentifier, actorName, operationId, occurredAt and details.
  • OnAction runs after the named hook and also covers other actions (jobs, ranks, points, webhooks, settings). Firing everyone uses OnFireEmployees, not one OnFire per person.
  • Hooks only report; they cannot undo or cancel the action. Errors in them are caught and logged. Use info.operationId to 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.

FWB Studio documentation.