BDMenu

{:links-list}

INSTALLATION

  1. Open the downloaded ZIP product file and drop the folder in it somewhere in your resources folder.
  2. Add your product key (get it here) to the settings.ini file
  3. Add start BigDaddy-BDMenu to your server.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, or id: first non-empty value becomes the button text.
  • items: nested submenu items.
  • actionType: "command": runs action with ExecuteCommand.
  • 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 skip actionType.
  • payload: optional payload passed to events or appended to commands.
  • close: optional, defaults to true. Will close the menu when selected (if not opening a submenu)
  • disabled or Disabled: optional disabled state.
  • icon: optional item icon. The menu will try assets/icons/<icon>.svg first, then fall back to a text badge if no image is available. You can also use a font awesome icon here. i.e. fa-handcuffs or fa-solid fa-handcuffs (note: fa-solid is assumed so it doesn't have to be added)
  • iconUrl or iconPath: 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.svg or https://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". disable grays out the option and hide will 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 permission are always unrestricted.
  • If a permission is present and denied, the item is disabled by default (grayed out).
  • Set permissionMode: "hide" (or hideIfNoPermission: 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)