Skip to content

Installation ​

Requirements ​

  • A recent FiveM server artifact (Lua 5.4). The collection natives need a game build that has them; older builds fall back to global numbers (see Catalogue → Global-index mode).
  • oxmysql
  • np_npchandler, started before np_clothing. It spawns the store clerks and the hidden peds of the catalogue scan
  • Node 18+ to build the NUI once

Optional, auto-detected:

Kind Resources Used for
Framework es_extended, qbx_core, qb-core Character identifier, name, jobs and grades, duty, money. Without one, np_clothing runs standalone
Inventory np_inventory, ox_inventory, qb-inventory Only the optional clothes as items shopping bag
np_* siblings np_admin, np_character, np_payments, np_hud, np_menu, np_phone, np_tattoos, np_gangs, np_identification, np_discord See Integrations
Thumbnails screenshot-basic Rendering piece thumbnails in game (staff). Without it the UI shows the slot glyph
Zones np_colshape Enter and exit of the interaction points as colshapes. Needed on FiveM Legacy only, GTAV Enhanced has the natives built in. Without it, distance checks as before

The framework and inventory bridges are picked once at start, ESX and np_inventory first. The np_* integrations are checked when they are used, so their start order doesn't matter.

Steps ​

  1. Put the resource in resources/ as np_clothing. The NUI calls https://np_clothing/rpc and loads logos from nui://np_clothing/…, so keep the name.
  2. Build the NUI (web/dist is not committed):
    sh
    cd web && npm ci && npm run build
  3. Database: the tables (clothing_*) are created and migrated at every start. sql/install.sql holds the same statements for a manual install. If a migration fails, np_clothing stops booting (every request answers "not ready") instead of running on a half-migrated database; the console says why.
  4. Start it after oxmysql, np_npchandler, the framework and the inventory:
    cfg
    ensure oxmysql
    ensure np_npchandler
    ensure es_extended     # or qbx_core / qb-core (optional)
    ensure np_inventory    # or ox_inventory / qb-inventory (optional)
    ensure np_admin        # optional: permissions, settings, logs, staff tools, theme
    ensure np_payments     # optional: checkout sheet, faction account payments
    ensure np_character    # optional: creator, barber, surgeon; clothing is written back to it
    ensure np_clothing
  5. Give your staff the np_clothing.packs node (or np_clothing.admin) in np_admin. No add_ace lines, see Permissions.
  6. Join as staff. With Config.Catalogue.autoScan (the default) your client scans the clothing catalogue once: every pack and piece the game streams for both freemode models. Watch the toast, or run /clothing scan yourself. Until the first scan, stores have nothing to sell.
  7. Map your jobs to the factions in shared/config/factions.lua (jobs = { 'police', … }). See Factions.

Test it

Walk into the Binco in Textile City and press E. Try a jacket on, add it to the cart and pick Buy & wear. Then open /clothing packs as staff to see the catalogue the scan built.

Coming from another clothing script ​

Run the legacy import once from the pack manager. It reads illenium-appearance, qb-clothing, esx skinchanger or np_character skins and grants their pieces as pack-and-name records. Characters without a stored look are also picked up on their first load: the server reads what the ped wears and keeps it as the look; cheap pieces become owned (Config.WardrobeSession.firstLoadImport, startMaxPrice; needs OneSync).

Clothes as items ​

Off by default (Config.ItemsMode.enabled = false). When on, purchases arrive as one clothing_bag item per checkout (metadata: the store and the pieces), and using the bag adds them to the wardrobe. It needs an inventory with item metadata.

Inventory Setup
np_inventory Nothing. np_clothing registers the item at start
ox_inventory Add the item with a server export: ['clothing_bag'] = { label = 'Shopping bag', weight = 300, stack = false, close = true, server = { export = 'np_clothing.clothing_bag' } }
qb-inventory Add clothing_bag to qb-core/shared/items.lua. It is registered as usable with CreateUseableItem
none Purchases go straight to the wardrobe

ItemsMode.* needs a restart, because the item is registered at start.

Permissions ​

np_clothing uses no ACE. Every staff check is a permission node, managed in np_admin.

Node Grants
np_clothing.admin Everything below
np_clothing.packs Pack manager, catalogue scan, prices, labels, hide / release, faction-only flags, thumbnails
np_clothing.import The legacy import and its review queue
np_clothing.uniform Edit and publish any faction's uniform sets without being its leader; the Force uniform staff action
np_clothing.give Give or remove pieces and reset a look (staff actions)

Faction leaders don't need a node: a faction's leaderGrades, or the framework's boss flag, decide who may design its uniforms.

Without np_admin, a player is staff when one of these says so:

  1. their identifier is in Config.Admins;
  2. their framework group is in Config.AdminGroups (ESX admin / superadmin, qb / qbx admin / god);
  3. np_discord runs and they hold a role from Config.AdminDiscordRoles.

Config.Admins and the Discord roles also count while np_admin runs. See Concepts → Permissions.

Troubleshooting ​

Symptom Fix
Blank UI web/dist is missing. Build the NUI
Stores are empty No catalogue yet. Join as staff with np_clothing.packs or run /clothing scan
"Scan held: it would hide …" The scan would mark more than Config.Catalogue.maxMissingShare of the packs missing. Check that every pack is streamed, then apply or drop it in the pack manager
New characters keep nothing they wear OneSync is off (the server can't read the ped), the read wasn't stable within Config.WardrobeSession.startReads (it retries at the next load), or their pieces cost more than Config.WardrobeSession.startMaxPrice
A saved piece shows as the default Its pack isn't streamed (status missing in the pack manager). Start the pack again: the piece comes back by itself
"Clothing only works on a freemode character." Clothing exists only for mp_m_freemode_01 / mp_f_freemode_01
Faction members can't open a locker Their job name isn't in any faction's jobs list, or the locker belongs to another faction
Publishing a uniform fails with a payment error The faction account can't pay orderPrice × members. Without np_payments see Config.Payment.factionFallback
Using the shopping bag does nothing ox_inventory: the server = { export = 'np_clothing.clothing_bag' } line is missing
/clothing says "You are not allowed to do that." Grant np_clothing.packs in np_admin, or add your identifier to Config.Admins