Skip to content

Installing vns-core

vns-core is its own resource with its own download. Get it once from your Keymaster/cfx Portal, next to any VNS script you own. It is not part of any script's zip and it updates independently. The install is the same on every server.

Requirements

  • ox_lib
  • oxmysql
  • One supported framework: QBCore, QBox or ESX
  • One supported inventory (see the table below; ESX's built-in inventory works without a separate resource, but has no stashes)
  • One supported target system: ox_target, qb-target or qtarget

Steps

  1. Place the vns-core folder in your resources directory. Do not rename it. Scripts reference it by this exact name.
  2. In server.cfg, start it after all of your other resources and before every VNS script:

    ensure ox_lib
    ensure oxmysql
    ensure qb-core          # your framework (or qbx_core / es_extended)
    ensure ox_inventory     # your inventory
    ensure ox_target        # your target system
    # ...and everything else: housing, garages, phone, fuel, clothing, jobs
    
    ensure vns-core
    
    # every VNS script goes after vns-core
    ensure vns-basebuilding-lite
    ensure vns-casinoslots
    
  3. Restart the server.

Ensure order

  • vns-core must be ensured after ox_lib, oxmysql (database), your framework, inventory, target system and your other server scripts such as housing, garages and phone.
  • Every VNS script must be ensured after vns-core.

If vns-core starts too early it can't find those resources, and database, items, storages, money, vehicles or targeting won't work in VNS scripts. A VNS script placed higher up in server.cfg causes the same problem: FiveM starts vns-core together with it, before your other resources.

vns-core detects your systems when it starts, by checking which resources are already running. That is why it has to be started after them. If it can't find a supported framework, inventory or target system, it prints a red [vns-core] warning in the console naming what is missing. No warnings means everything was found.

That's the whole install. Configuration is optional; auto-detection covers almost every server.

Configuration (vns-core/config.lua)

Option Default Accepted values What it does
Config.Framework 'auto' 'auto', 'esx', 'qbcore', 'qbox' Framework VNS scripts use.
Config.Inventory 'auto' 'auto', 'ox_inventory', 'qb-inventory', 'qs-inventory', 'origen_inventory', 'codem-inventory', 'tgiann-inventory', 'core_inventory', 'esx_inventory' Inventory VNS scripts use. 'esx_inventory' is ESX's built-in inventory.
Config.Target 'auto' 'auto', 'ox_target', 'qb-target', 'qtarget' Target system VNS scripts use.
Config.NotifySystem 'auto' 'auto', 'esx', 'qbcore', 'qbox', 'ox_lib' Where notifications are shown. 'auto' uses the detected framework's notifications, or ox_lib if no framework was found.
Config.Debug false true, false Reserved debug flag. vns-core 1.0.0 does not read it yet; leave it on false.
Config.ItemImagePath 'auto' 'auto' or any path/URL Base path VNS script UIs load item icons from.
Config.AdminAce 'command' Any ace name Ace permission required for admin-only commands and panels in every VNS script.

How auto-detection picks

When an option is 'auto', vns-core picks the highest-priority supported resource that is running:

  • Framework: QBox (qbx_core) wins over QBCore (qb-core), so a QBox server that also exposes qb-core is detected as QBox. ESX is detected from es_extended.
  • Inventory: ox_inventory wins over the others. ESX's built-in inventory is only used when ESX runs without any other supported inventory.
  • Target: ox_target wins over qb-target and qtarget.

When an option is set to a specific value, that value is used as-is, even if the resource isn't running.

Tip

Leave everything on 'auto' unless you run several frameworks, inventories or target systems side by side (for example during a migration). Then force the one you want VNS scripts to use.

Item images

With Config.ItemImagePath = 'auto', vns-core uses the default image folder of the detected inventory:

Inventory Path
ox_inventory nui://ox_inventory/web/images/
qb-inventory nui://qb-inventory/html/images/
qs-inventory nui://qs-inventory/html/images/
origen_inventory nui://origen_inventory/html/images/
codem-inventory nui://codem-inventory/html/itemimages/
tgiann-inventory nui://inventory_images/images/
core_inventory nui://core_inventory/html/img/

Any other inventory (including esx_inventory) falls back to nui://ox_inventory/web/images/. If your icons live somewhere else, set the path yourself, for example:

Config.ItemImagePath = 'nui://my_inventory/html/images/'

Admin permissions

VNS scripts share one server-side admin check: IsPlayerAceAllowed(source, Config.AdminAce). The default value is command, the ace FiveM's standard server.cfg already grants to the admin group, so staff in group.admin have access without any extra setup:

add_ace group.admin command allow
add_principal identifier.license:xxxxxxxx group.admin

If you want VNS admin tools limited to a narrower group than everyone who can run commands, create your own ace, grant it to that group, and set Config.AdminAce to it.

Note

ESX's built-in inventory has no stashes. Script features that open a storage (for example storage boxes in Base Building) show "Storage requires a supported inventory resource." until you install one of the other supported inventories.

Updating vns-core

Download the new version from your portal and replace the folder. If you changed config.lua, copy your values over. If you added a custom adapter module, keep a copy of that file and put it back after updating (see Custom frameworks & inventories).