Client Exports
These are the client exports of the original qbx_management. Scripts that use them keep working. The server always checks that the player is a boss of the job or gang before the tablet opens.
OpenBossMenu
Opens the boss tablet of the player's job, or the gang tablet of the player's gang.
exports.qbx_management:OpenBossMenu(groupType)| Name | Type | Required | Notes |
|---|---|---|---|
groupType | 'job', 'gang' or nil | No | 'job' or nil opens the job tablet, 'gang' opens the gang tablet |
exports.qbx_management:OpenBossMenu('job')
exports.qbx_management:OpenBossMenu('gang')A job name also works (the qb-management / esx_society style). It opens that job's tablet when the player is a boss there:
exports.qbx_management:OpenBossMenu('police', nil, { wash = false })The third argument hides tablet sections. Keys: checkBal, withdraw, deposit, wash, employees, salary, grades (all true when left out). To limit what a player can really do, use the server export.
Returns true when the request was sent. A player who is not a boss gets "You do not manage a business." (or "You do not manage a gang.").
AddBossMenuItem / AddGangMenuItem
Adds your own button to the sidebar of the boss tablet. Clicking it runs your event.
local id = exports.qbx_management:AddBossMenuItem({
id = 'company_reports',
title = 'Company reports',
event = 'my_resource:openReports',
args = { source = 'bossmenu' },
})| Field | Type | Notes |
|---|---|---|
id | string | Optional. Made for you when left out |
title | string | Button text (label or name also work) |
event | string | The event to run (also read from params.event) |
args | table | Sent with the event (also read from params.args) |
isServer | boolean | true runs event as a server event (also read from params.isServer) |
AddGangMenuItem takes the same table. The item's args.type is set to 'job' or 'gang' when you leave it out.
Returns the item id, or false when the argument is not a table.
Added items show as buttons in every boss and gang tablet the player opens.
RemoveBossMenuItem / RemoveGangMenuItem
Removes an item added with AddBossMenuItem or AddGangMenuItem.
exports.qbx_management:RemoveBossMenuItem('company_reports')
exports.qbx_management:RemoveGangMenuItem('hideout_tools')Returns true.
Open events
These client events open the tablet, so scripts made for qb-bossmenu / qb-gangmenu (illenium-appearance and others) keep working:
| Event | Opens |
|---|---|
qb-bossmenu:client:OpenMenu | The player's job tablet |
qb-bossmenu:client:openMenu | The player's job tablet |
qb-bossmenu:client:forceMenu | The player's job tablet |
qb-gangmenu:client:OpenMenu | The player's gang tablet |
TriggerEvent('qb-bossmenu:client:OpenMenu')
TriggerEvent('qb-gangmenu:client:OpenMenu')