Skip to content

Commands & permissions

The staff panel command of Cuxial Interactions, the keys of the dialogue and the shop, and who can talk to each NPC.

Staff manage the NPCs with one command. Players use them by aiming at an NPC; who can do so is decided by the conditions of each NPC and each button.

Commands ​

CommandWhoWhat it does
/interactionsStaffOpens the panel: create, edit, duplicate, switch on and off and delete NPCs, see the history, export them as SQL and review what the seed installed.

The name is set in commands.admin.name. See the Features guide for everything the panel does.

Staff permissions ​

Two checks protect the panel. Both must pass.

CheckOptionDefaultWhere
ACE group of the commandcommands.admin.restrictedgroup.adminWhen typing the command. ox_lib grants the command to that group.
Framework permissionadmin.permission'admin'On the server, on every action of the panel (open, save, delete, test, reset limits...). Checked through Cuxial Bridge.
server.cfg
cfg
add_principal identifier.license:xxxxxxxxxxxxxxxx group.admin

On ESX, the permission admin is met by the groups admin and superadmin.

Keys ​

KeyWhat it does
Target keyShows the option to talk when aiming at the NPC. It is the key of your target resource.
EOpens the conversation in sprite mode. Default from sprite.key and sprite.control.
1 to 9Picks the dialogue button in that position.
Mouse clickSelects a button. A click anywhere shows the whole text at once while it is still being typed.
EscCloses the dialogue or the shop.

The resource registers no key binding of its own, so nothing appears in the GTA key settings.

The dialogue closes by itself if the player dies, is knocked down, is cuffed or falls into ragdoll.

In the shop ​

ActionWhat happens
Choose a quantityWhen selling, up to the units the player carries. Never more than shop.maxQuantity per trade, nor more than the limit leaves.
SellThe server removes the items and pays price × quantity into the shop account.
BuyThe server checks the player can carry the items, charges price × quantity from the shop account and gives the items. If the items cannot be given, the money is returned.
BackReturns to the dialogue. Only shown when the shop was opened from a dialogue button.

A trade is rejected when the player is further than the distance of the shop, does not carry the units, has not enough money, has reached a limit, or trades again before shop.cooldown has passed. Each case shows its own notification.

Who can talk to an NPC ​

Access depends on the conditions set in the Conditions tab of the panel, or in the definition of an NPC registered by another resource. When several are set, all of them must pass. An NPC that fails is not visible and shows no option to talk. A button that fails is not shown and cannot be run.

ConditionRequirement
JobsHave any of the jobs listed, with the minimum grade set for it.
ItemsCarry every item listed, in the minimum amount set.
ScheduleBe within the hours and days set, by game time or real time.

NPCs registered by other resources use the same rules in code:

FieldRequirement
job = 'police'Have that job.
job = { 'police', 'ambulance' }Have any of the jobs listed.
job = { police = 2 }Have that job with that grade or higher.
item = 'lockpick'Carry at least one unit of the item.
item = { 'lockpick', 'phone' }Carry all the items listed.
item = { lockpick = 3 }Carry at least that many units.
canInteract = function(ctx) ... endYour own check. It must return true.

The title of a dialogue page (the job field of a page) is different: it is the role shown in the header next to the NPC name, not a condition.

Debug ​

Set debug = true in shared/config.lua, or the convar below, to print the NPCs and shops registered and each trade.

server.cfg
cfg
setr cuxial_interactions_debug "1"

© Cuxial