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.
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.
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.
qs-radialmenu:client:openMenu
lua
-- 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
qs-radialmenu:client:closeMenu
lua
-- 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.
AddCategory
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.
To add a new category to the radial menu, use the following client-side export:
lua
local success, error = exports['qs-radialmenu']:AddCategory(categoryId, categoryData)
Example
lua
-- Add a basic category to the main menulocal success, error = exports['qs-radialmenu']:AddCategory("myresource_main", {
label = "My Menu",
icon = "Settings"
})
ifnot success thenprint("Error adding category: " .. tostring(error))
end
This will create a new category called “My Menu” at the root level of the radial menu.
The category will only appear if the player has the police job with a grade of 2 or higher.
Dynamic Category with canInteract
javascript
-- Category only visible when the player is in a vehicle
exports['qs-radialmenu']:AddCategory("vehicle_menu", {
label = "Vehicle Menu",
icon = "Car",
canInteract = function()
returnIsPedInAnyVehicle(PlayerPedId(), false)
end
})
The category will appear and disappear automatically based on the player’s state.
What This Export Returns
lua
success -- true or falseerror-- error message if something failed
true → Category added successfully
false → Category was not added (error message provided)
AddItem
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.
To add an item to a category, use the following client-side export:
lua
local success, error = exports['qs-radialmenu']:AddItem(categoryId, itemData)
Example
lua
-- Add a basic item to a categorylocal success, error = exports['qs-radialmenu']:AddItem("myresource_main", {
label = "Open Menu",
icon = "Menu",
action = function()print("Item clicked!")
end
})
ifnot success thenprint("Error adding item: " .. tostring(error))
end
This will add a clickable item called “Open Menu” inside the specified category.
Adding an Item to a Config Category
lua
-- Add item to an existing category defined in config.lua
exports['qs-radialmenu']:AddItem("Vehicle", {
label = "Repair Vehicle",
icon = "Wrench",
action = function()local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
if vehicle ~= 0then
SetVehicleEngineHealth(vehicle, 1000.0)
SetVehicleBodyHealth(vehicle, 1000.0)
endend
})
You can use the category label directly if the category already exists in config.lua.
Item with Job Restriction
lua
-- Item only visible for police
exports['qs-radialmenu']:AddItem("police_menu", {
label = "Fine Player",
icon = "Ticket",
job = "police",
jobGrade = 2,
action = function()
exports['police-system']:FinePlayer()
end
})
The item will only appear if the player has the required job and grade.
Item with Dynamic canInteract
javascript
-- Item only visible when the player has a specific item
exports['qs-radialmenu']:AddItem("myresource_main", {
label = "Use Special Item",
icon = "Star",
canInteract = function()
returnexports['qb-core']:HasItem('special_item')
end,
action = function()
exports['qb-core']:UseItem('special_item')
end
})
The item will automatically appear or disappear based on the condition.
What This Export Returns
lua
success -- true or falseerror-- error message if something failed
true → Item added successfully
false → Item was not added (error message provided)