Menu Items
The radial menu supports static items, nested sub-menus, job-specific menus, and vehicle-specific menus — all defined in config.lua.
Item Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
label | string | Yes | Text displayed on the menu segment | |
icon | string | Yes | Ionicons icon name (e.g., "car-outline") | |
event | string | No | nil | Client event to trigger on click |
serverEvent | string | No | nil | Server event to trigger on click |
command | string | No | nil | Chat command to execute (without /) |
action | string | No | nil | Custom action string for predefined function mapping |
items | table | No | nil | Sub-menu items array (enables nesting) |
shouldClose | boolean | No | true | Whether clicking closes the menu |
data | any | No | nil | Additional data passed to the event |
isServer | boolean | No | nil | If true, triggers server event instead of client |
Example Configuration
lua
Config.MenuItems = {
{
label = "General",
icon = "albums-outline",
items = {
{ label = "ID Card", icon = "card-outline", event = "code9_radialMenu:showID" },
{ label = "Billing", icon = "cash-outline", event = "esx_billing:openBilling" },
},
},
{
label = "Emotes",
icon = "happy-outline",
command = "emotemenu",
},
}
Job-Specific Menus
Items that appear only when the player's current job matches. Defined in Config.JobMenus:
lua
Config.JobMenus = {
["police"] = {
{
label = "Police Actions",
icon = "shield-outline",
items = {
{ label = "Handcuff", icon = "lock-closed-outline", event = "police:cuff" },
{ label = "Search", icon = "search-outline", event = "police:search" },
},
},
},
}
Vehicle-Specific Menus
Items that appear only when the player is inside a vehicle. Defined in Config.VehicleMenus:
lua
Config.VehicleMenus = {
{
label = "Vehicle Control",
icon = "car-outline",
items = {
{ label = "Toggle Engine", icon = "power-outline", command = "engine" },
{ label = "Door Lock", icon = "lock-closed-outline", command = "doorlock" },
},
},
}
Sub-Menu Nesting
Sub-menus support unlimited depth. Add an items array to any item to make it open a sub-menu:
lua
{
label = "Vehicle",
icon = "car-outline",
items = {
{ label = "Engine", icon = "power-outline", command = "engine" },
{
label = "Doors",
icon = "exit-outline",
items = {
{ label = "Hood", icon = "arrow-up-outline", command = "hood" },
{ label = "Trunk", icon = "arrow-down-outline", command = "trunk" },
},
},
},
}
A "Back" button is automatically added when inside a sub-menu.
