Skip to content

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.

lua
exports['qb-management']:OpenBossMenu(society, close, options)
NameTypeRequiredNotes
societystringYesJob name (lowercase letters, numbers, _)
closefunctionNoCalled when the tablet closes
optionstableNocheckBal, 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.

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

lua
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
})
FieldNotes
id or nameOptional; 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.

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

lua
local id = exports['qb-management']:AddGangMenuItem({
    id = 'gang_stash',
    title = 'Gang stash',
    event = 'my_resource:client:openGangStash',
})
RemoveGangMenuItem

Removes an item added with AddGangMenuItem.

lua
exports['qb-management']:RemoveGangMenuItem('gang_stash')

FWB Studio documentation.