BDMenu
POPULAR LINKS
{:links-list}
INSTALLATION
- Open the downloaded ZIP product file and drop the folder in it somewhere in your resources folder.
- Add your product key (get it here) to the
settings.inifile - Add
start BigDaddy-BDMenuto yourserver.cfg.
DO NOT RENAME THE FOLDER.
If you change the name of the folder it will not function correctly so leave the name as it is.
{:is-danger}
CONFIGURATION
The settings.ini file is where you put your license key.
settings.ini
| SETTING | DEFAULT | DESCRIPTION |
|---|---|---|
| [licensing] | ||
| key1 | none | Your license key goes here (get it here) |
Events
Open and close the menu from any client resource by triggering the menu resource's client events:
TriggerEvent('BigDaddy-BDMenu:OpenMenu', json.encode(menu))
TriggerEvent('BigDaddy-BDMenu:CloseMenu')
JSON format
You can send either a raw array of items or an object containing title and items.
JSON
{
"title": "Actions",
"items": [
{
"description": "Toggle Something",
"actionType": "command",
"action": "togglesomething"
},
{
"description": "Client Event Example",
"actionType": "event",
"action": "my-resource:client:doThing",
"payload": {
"mode": "fast"
}
},
{
"description": "Server Event Example",
"actionType": "serverEvent",
"action": "my-resource:server:doThing",
"payload": 42,
"close": false
},
{
"description": "Submenu",
"items": [
{
"description": "Nested Action",
"command": "nestedcmd"
}
]
}
]
}
Supported item fields
description,name,label,title, orid: first non-empty value becomes the button text.items: nested submenu items.actionType: "command": runsactionwithExecuteCommand.actionType: "event","clientEvent", or"client": triggers a client event.actionType: "serverEvent","server", or"netEvent": triggers a server event.command,event,serverEvent: direct internal format if you want to skipactionType.payload: optional payload passed to events or appended to commands.close: optional, defaults totrue. Will close the menu when selected (if not opening a submenu)disabledorDisabled: optional disabled state.icon: optional item icon. The menu will tryassets/icons/<icon>.svgfirst, then fall back to a text badge if no image is available. You can also use a font awesome icon here. i.e.fa-handcuffsorfa-solid fa-handcuffs(note:fa-solidis assumed so it doesn't have to be added)iconUrloriconPath: optional explicit image source for the icon.- To load icons from the calling resource, use a FiveM NUI URL such as
nui://my-resource/html/icons/cop.svgorhttps://cfx-nui-my-resource/html/icons/cop.svg. permission: optional permission key to check against the player's permission map.permissionMode: optional behavior when denied. Use"disable"(default) or"hide".disablegrays out the option andhidewill hide it completely if they do not have permissions for that item.hideIfNoPermission: optional boolean alias for hide behavior when denied.
Permission behavior
- Items without
permissionare always unrestricted. - If a
permissionis present and denied, the item is disabled by default (grayed out). - Set
permissionMode: "hide"(orhideIfNoPermission: true) to remove denied items from the menu.
Images
You can use many different image formats but defaults to SVG
PNG, JPG, JPEG, WEBP, GIF, SVG
Or you can use Font Awesome icons i.e. fa-handcuffs
Example
LUA
-- client.lua in your calling resource
RegisterCommand("test_bdmenu", function()
local menu = {
title = "My Test Menu",
resourceName = GetCurrentResourceName(), -- tells BDMenu where icon slugs/paths belong
items = {
{
description = "Say Hello",
icon = "cop", -- resolves to your resource: html/assets/img/cop.svg
actionType = "command",
action = "say_Hello_from_BDMenu",
close = true
},
{
description = "Run Client Event (stay open)",
icon = "nui://my-resource/html/icons/flashlight.png",
actionType = "event",
action = "myresource:doThing",
payload = { mode = "fast" },
close = false
},
{
description = "Submenu Example",
icon = "search",
items = {
{
description = "Nested Command",
icon = "fa-search",
actionType = "command",
action = "me_nested_action",
close = true
}
}
}
}
}
TriggerEvent("BigDaddy-BDMenu:OpenMenu", json.encode(menu))
end, false)
RegisterNetEvent("myresource:doThing")
AddEventHandler("myresource:doThing", function(data)
print("myresource:doThing fired, mode =", data and data.mode)
end)