Commands & Exports

This section lists all available commands, exports, and events included in the script. You’ll find client-side, server-side, and shared functions designed to help developers integrate, extend, or interact with the system easily within their own scripts or frameworks.


Commands

This section lists all available commands included in the script. Each command is designed to simplify administration, player interaction, or debugging tasks. You’ll find detailed descriptions, usage examples, and permission requirements to help you manage and customize your server efficiently.

Command
Description

/radialmenu

Default command to open the radial menu (or F3)

/radialrefresh

Refresh the radial menu as a debug.


Client Exports and Events

This section provides all available client exports for the script. These functions allow you to interact directly with the system from the client side, enabling custom features, UI interactions, and integrations with other resources. Each export includes a short description and usage example for easy implementation.

chevron-rightopenMenuhashtag

The OpenMenu event allows you to manually open the radial menu from any client-side script. This is useful when you want to trigger the menu from another system, keybind, interaction, or custom logic instead of relying on default commands or keys.


How to Use

To open the radial menu, use the following client-side event:

-- Open the radial menu manually
TriggerEvent('qs-radialmenu:client:openMenu')

This will instantly open the radial menu for the current player on the client. The menu will automatically evaluate job restrictions, gang restrictions, and canInteract conditions before displaying available items

chevron-rightcloseMenuhashtag

The CloseMenu event allows you to manually close the radial menu from any client-side script. This is useful when you need to hide the menu after an action, interaction, animation, or when switching to another interface.


How to Use

To open the radial menu, use the following client-side event:

-- Close the radial menu manually
TriggerEvent('qs-radialmenu:client:closeMenu')

This will instantly close the radial menu for the current player if it is currently open. If the menu is already closed, calling this event will have no effect.

chevron-rightAddCategoryhashtag

The AddCategory export allows you to add a new category to the radial menu dynamically. This is useful when you want to organize actions into submenus or inject menu sections from other scripts without editing the main configuration file.


How to Use

To add a new category to the radial menu, use the following client-side export:

local success, error = exports['qs-radialmenu']:AddCategory(categoryId, categoryData)

Example

-- Add a basic category to the main menu
local success, error = exports['qs-radialmenu']:AddCategory("myresource_main", {
    label = "My Menu",
    icon = "Settings"
})

if not success then
    print("Error adding category: " .. tostring(error))
end

This will create a new category called “My Menu” at the root level of the radial menu.


Nested Category Example

-- Add a subcategory inside another category
local success, error = exports['qs-radialmenu']:AddCategory("myresource_submenu", {
    label = "Submenu",
    icon = "Folder",
    parentCategoryId = "myresource_main"
})

This will place “Submenu” inside “My Menu”.


Job Restricted Category Example

-- Category only visible to police
exports['qs-radialmenu']:AddCategory("police_menu", {
    label = "Police Menu",
    icon = "Shield",
    job = "police",
    jobGrade = 2
})

The category will only appear if the player has the police job with a grade of 2 or higher.


Dynamic Category with canInteract

-- Category only visible when the player is in a vehicle
exports['qs-radialmenu']:AddCategory("vehicle_menu", {
    label = "Vehicle Menu",
    icon = "Car",
    canInteract = function()
        return IsPedInAnyVehicle(PlayerPedId(), false)
    end
})

The category will appear and disappear automatically based on the player’s state.


What This Export Returns

success -- true or false
error   -- error message if something failed
  • true → Category added successfully

  • false → Category was not added (error message provided)

chevron-rightAddItemhashtag

The AddItem export allows you to add a new action item to an existing category in the radial menu. This is useful when you want to trigger custom logic, open interfaces, or integrate actions from other scripts without modifying the main menu configuration.


How to Use

To add an item to a category, use the following client-side export:


Example

This will add a clickable item called “Open Menu” inside the specified category.


Adding an Item to a Config Category

You can use the category label directly if the category already exists in config.lua.


Item with Job Restriction

The item will only appear if the player has the required job and grade.


Item with Dynamic canInteract

The item will automatically appear or disappear based on the condition.


What This Export Returns

  • true → Item added successfully

  • false → Item was not added (error message provided)


Complete Usage Examples

This section shows how AddCategory and AddItem work together to build real systems inside the radial menu.

The idea is simple: first create a category, then add items to it.

circle-check

Example: Store System

In this example, we create a Store category and add multiple actions to it.

Once the category exists, we can add items to it.

Add an item with a job restriction:

Add an item with a dynamic condition:

The radial menu will automatically:

  • Show or hide items based on job and distance

  • Hide the category if no items are available

  • Update dynamically without restarting the server


Adding Items to Existing Categories

You can also add items to categories that already exist in config.lua.

Or add items to a job-based category: