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
| Command | Who | What it does |
|---|---|---|
/interactions | Staff | Opens 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.
| Check | Option | Default | Where |
|---|---|---|---|
| ACE group of the command | commands.admin.restricted | group.admin | When typing the command. ox_lib grants the command to that group. |
| Framework permission | admin.permission | 'admin' | On the server, on every action of the panel (open, save, delete, test, reset limits...). Checked through Cuxial Bridge. |
add_principal identifier.license:xxxxxxxxxxxxxxxx group.adminOn ESX, the permission admin is met by the groups admin and superadmin.
Keys
| Key | What it does |
|---|---|
| Target key | Shows the option to talk when aiming at the NPC. It is the key of your target resource. |
| E | Opens the conversation in sprite mode. Default from sprite.key and sprite.control. |
| 1 to 9 | Picks the dialogue button in that position. |
| Mouse click | Selects a button. A click anywhere shows the whole text at once while it is still being typed. |
| Esc | Closes 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
| Action | What happens |
|---|---|
| Choose a quantity | When selling, up to the units the player carries. Never more than shop.maxQuantity per trade, nor more than the limit leaves. |
| Sell | The server removes the items and pays price × quantity into the shop account. |
| Buy | The 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. |
| Back | Returns 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.
| Condition | Requirement |
|---|---|
| Jobs | Have any of the jobs listed, with the minimum grade set for it. |
| Items | Carry every item listed, in the minimum amount set. |
| Schedule | Be within the hours and days set, by game time or real time. |
NPCs registered by other resources use the same rules in code:
| Field | Requirement |
|---|---|
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) ... end | Your 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.
setr cuxial_interactions_debug "1"