Compatibility
How AI Core runs ESX, QBCore, Qbox and vRP scripts and connects third-party resources.
Almost every FiveM script is written for ESX, QBCore, Qbox or vRP, so running them is a main goal. AI Core ships no third-party scripts and favours no vendor: you install your own.
Three layers
Framework bridge
AI Core provides es_extended, qb-core and qbx_core and answers their exports, core objects, player objects, callbacks, events and file includes (@qb-core/shared/locale.lua, @es_extended/imports.lua, @qbx_core/modules/playerdata.lua), so scripts written for ESX, QBCore or Qbox see AI Core as their framework and run unchanged. AI Core also provides vrp for vRP scripts (see vRP scripts below). Their menus, text prompts, progress bars and input dialogs are drawn with AI Core's own UI.
Integration layers
AI Core and the ai-* scripts need things other scripts provide. Each category has one interface and each supported script is one adapter. AI Core detects the installed script at start and when scripts start or stop; the admin panel can override the choice.
| Category | Examples |
|---|---|
| Inventory | ai-inventory, ox_inventory, qb-inventory, tgiann-inventory and more |
| Vehicle keys | ai-vehiclekeys, qbx_vehiclekeys and others |
| Dispatch (police alerts) | ai-policealert and alert scripts |
| Phone | tgiann-phone, lb-phone |
| Clothing | ai-appearance, tgiann-clothing |
| Death | ai-death, qbx_medical, qb-ambulancejob, esx_ambulancejob, ars_ambulancejob |
| Weather and time | ai-weathersync, qb-weathersync, Renewed-Weathersync, cd_easytime |
| Prison | ai-prison, qb-prison |
| Radial menu | ai-radialmenu, qb-radialmenu, ox_lib |
Stand-ins
Several ai-* scripts answer the API of the script they replace, so third-party scripts work with them without an adapter: ai-mysql stands in for oxmysql (also mysql-async and ghmattimysql), ai-inventory for ox_inventory and qb-inventory, ai-target for ox_target, ai-voice for pma-voice, ai-chat for chat, ai-vehicles and ai-vehiclekeys for the Qbox vehicle scripts.
See the compatible scripts list for what AI Core integrates with today.
vRP scripts
AI Core also provides vrp, so scripts written for the vRP framework find it and run on AI Core's characters, money, jobs, gangs and inventory. There is no setting: every version below is answered at the same time, and AI Core tells them apart by the way they call it.
| vRP version | What runs |
|---|---|
| vRP 1.0 | Scripts that use Proxy / Tunnel with vRP.* and vRPclient.*: users, money, groups and permissions, inventory and chests, identity, hunger and thirst, menus, prompts, notifications, blips and markers. |
| vRPex, Zirix, Dunko | The same, plus the extra functions these vRP 1 forks add (format, hasPermissions, tryBankPayment and others). |
| The old vRP 0.5 call style | Calls that pass their arguments in a table with a callback, like vRP.getUserId({source}). |
| vRP 2 and vRP 3 | Extensions a script loads with vRP.loadScript. Each one runs in its own sandbox inside AI Core: its globals never touch another script, and everything it registered is removed when its resource stops. |
The menus, text prompts and yes / no requests of vRP scripts are drawn with AI Core's own menu and dialogs. When a script adds entries to vRP's main menu, players open it with F7; you can change the key in the admin panel's Keybinds.
AI Core was tested on a running server with seven public vRP scripts: vrp_basic_mission, vrp_chests, vrp_blips, self_storages, vrp_drugfarms, vrp_worlditems and party_system.
Installing a vRP script
Remove the original vRP
AI Core is your vrp resource now, so the original one must go. If your server has a vrp folder or a vRP database driver (vrp_mysql, vrp_oxmysql, vrp_ghmattimysql, vRP-db-drivers), delete the folder and its ensure line in server.cfg. While one of them is still there, AI Core refuses joins and names the folder to delete.
Add the script
Put the script's folder in resources/[standalone]/ and add ensure <folder name> to server.cfg below the ensure ai-* lines, like any other script. Do not edit the script: its vrp dependency and its @vrp/lib/utils.lua include reach AI Core on their own.
Start it and give out its permissions
Restart the server and try the script's features in game. Then open the admin panel (F10) and AI Core's vRP scripts tab: Asked permissions lists every permission name the script asked for. Decide who gets each one, as the next section explains.
The vRP scripts tab
vRP scripts do not ask "is this player a police officer?". They ask for permission names (police.service), group names (police, vip) and item ids (edible|tacos). The vRP scripts tab, in AI Core's part of the admin panel, decides what those names mean on your server. Every change is saved at once, without a restart. The tab has five cards:
Built-in rules
These three switches answer every permission name that no rule mentions, so many scripts work before you add a single rule:
- Job permissions go to the job: a permission that starts with a job's name, like
police.service, goes to the members of that job. With Only while on duty on, they have it only while they are on duty. - admin. permissions go to admins: a permission that starts with
admin., likeadmin.tickets, goes to players with admin rights (ACEai.admin). - player. permissions go to everyone: a permission that starts with
player., likeplayer.phone, goes to every player.
Asked permissions
Every permission name your scripts have asked for, with a search box. Press Add rule next to a name and a rule for it appears at the top of Permission rules. A new rule gives the permission to admins only, until you pick who should have it.
Permission rules
One row per rule. In Permission name, write the permission (police.service), or a name ending in * (police.*) to cover every permission that starts with it. In Who has it, pick one:
- Members of a job: pick the job and the Lowest grade (that grade and every grade above it). Turn on Only on duty if they should have it only while on duty.
- Members of a gang: pick the gang and the lowest grade.
- Characters in a group: write a group name that scripts give (see Group names).
- Admins or Everyone.
Several rules may name the same permission: whoever matches any of them has it. Once a rule names a permission, the built-in rules no longer count for it. The panel refuses a grade the job or gang does not have.
Group names
vRP scripts give and check groups by name. A job's or a gang's own name (police, ballas) works without a row. For any other name a script uses (Coronel, sheriff), add a row: write it in Group name and pick what it Means:
- A job grade or A gang grade: when a script gives this group, the character gets that job or gang at that grade; when a script checks it, the answer is yes for that grade and every grade above it.
- Admins: the check answers yes for players with admin rights. A script can never make someone an admin: giving this group is refused.
A name without a row stays a group of its own, saved with the character.
Item names
Link an item id a script uses (Name scripts use, like edible|tacos) to an item of your inventory (Inventory item, picked from the list). An id that is already the name of one of your items needs no row. Without a row, wbody|WEAPON_X means the weapon item and any other a|b id means b.
Example: a police script asks for police.service, but your police job is called lspd. Add a permission rule with the name police.service, Members of a job, the job lspd, lowest grade 0 and Only on duty on. Every officer on duty now has the permission.
What does not work with vRP
- Creative v5. Its API (PascalCase names,
@vrp/lib/Utils.lua,@vrp/config/*.lua) is different and is not answered. - SQL on vRP's own tables. AI Core keeps its own data, so a script that reads or writes
vrp_users,vrp_user_identities,vrp_user_data,vrp_srv_dataor similar tables with its own queries finds nothing. - vRP modules AI Core does not have: phone directory, homes, businesses, owned vehicles and garages, aptitudes, police records and jail, shops, item transformers, ATMs, audio and radio, progress bars, bans and whitelist, and the missions of vRP 1 (vRP 2 / 3 missions work). A script that uses them loses that part.
- Menus have no left / right. Options that change a value with the arrow keys only take a plain pick.
vRP:playerSpawnfires once per character load, not after a respawn: respawns belong to the death script.vrpalways reads as started. A script that supports several frameworks and checks vRP first takes its vRP code. If you want its ESX or QBCore code, choose that framework in the script's own config.- A vRP 2 / 3 extension runs inside AI Core, so its CPU time shows under
ai-coreinresmon. If it fails, the console prints one line with its file and AI Core keeps running.
Replacing an ai-* script
If you install a paid script that replaces an ai-* one (for example another inventory), AI Core tells you which folder to delete and refuses joins while both run, so two scripts never fight over the same job.
Adding a script
Supporting a new script is one small, repeatable job: copy the category's adapter template, fill in its calls, add one line to the registry. You can ask your AI to do it.