Quasar Store Logo

Commands and 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.

CommandDescription
/radialmenuDefault command to open the radial menu (or F3)
/radialrefreshRefresh the radial menu as a debug.





Client Exports

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

qs-radialmenu:client:closeMenu

AddCategory

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:

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



Example

-- Add a basic item to a category local success, error = exports['qs-radialmenu']:AddItem("myresource_main", { label = "Open Menu", icon = "Menu", action = function() print("Item clicked!") end }) if not success then print("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

-- 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 ~= 0 then SetVehicleEngineHealth(vehicle, 1000.0) SetVehicleBodyHealth(vehicle, 1000.0) end end })

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



Item with Job Restriction

-- 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

-- Item only visible when the player has a specific item exports['qs-radialmenu']:AddItem("myresource_main", { label = "Use Special Item", icon = "Star", canInteract = function() return exports['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

success -- true or false error -- error message if something failed

true → Item added successfully

false → Item was not added (error message provided)