qb-menu
qb-menu renders action menus from a Lua table. This reference is pinned to
d82abeeb.
Exports
| Export | Purpose |
|---|---|
openMenu(data, sort, skipFirst) | Open a menu from an array of menu items. |
closeMenu() | Close the current menu. |
showHeader(data) | Render the supplied menu as a header view. |
exports['qb-menu']:openMenu({
{ header = 'Garage', isMenuHeader = true },
{
header = 'Store vehicle',
txt = 'Move the current vehicle into storage',
params = { event = 'mygarage:client:store' }
}
})Menu entries support header, txt, isMenuHeader, disabled, and params. The params table
contains an event, optional args, and one dispatch flag: isAction, isServer, isCommand, or
isQBCommand. Do not let a menu click authorize money, items, or permissions; validate those on the
server.
Source: README and implementationΒ