Client Exports
These exports have the same names as the original qb-management, so job and gang scripts that use them keep working.
OpenBossMenu
Asks the server to open the boss tablet for the local player. The server checks that the player is a boss of that job.
exports['qb-management']:OpenBossMenu(society, close, options)| Name | Type | Required | Notes |
|---|---|---|---|
society | string | Yes | Job name (lowercase letters, numbers, _) |
close | function | No | Called when the tablet closes |
options | table | No | checkBal, withdraw, deposit, wash, employees, salary, grades (all true by default) |
options hides sections in the tablet. To enforce limits on the server, use the server export instead.
The close callback gets one menu object that works as function(menu) and as function(data, menu), like the old menu callbacks.
exports['qb-management']:OpenBossMenu('mechanic', function(menu)
print('Boss menu closed')
end, { wash = false })Returns true when the request was sent, false for an invalid job name.
AddBossMenuItem
Adds your own button to the tablet's sidebar on this client. Clicking it triggers your event.
local id = exports['qb-management']:AddBossMenuItem({
id = 'my_tool',
title = 'Stock orders',
event = 'my_resource:client:openStock',
-- isServer = true, -- trigger a server event instead
-- args = { shop = 'main' } -- arguments passed to the event
})| Field | Notes |
|---|---|
id or name | Optional; used to remove the item later |
title (or label, name) | Button text |
event (or params.event) | Event that is triggered on click |
isServer (or params.isServer) | true triggers a server event |
args (or params.args) | Arguments for the event; without it the item table is passed |
Returns the item id.
RemoveBossMenuItem
Removes an item added with AddBossMenuItem.
exports['qb-management']:RemoveBossMenuItem('my_tool')AddGangMenuItem
Kept for scripts made for the original gang menu. It takes the same fields as AddBossMenuItem and returns the item id. The button shows in the tablet sidebar like a boss menu item.
local id = exports['qb-management']:AddGangMenuItem({
id = 'gang_stash',
title = 'Gang stash',
event = 'my_resource:client:openGangStash',
})RemoveGangMenuItem
Removes an item added with AddGangMenuItem.
exports['qb-management']:RemoveGangMenuItem('gang_stash')