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 ​
- Put the resource in
resources/asnp_clothing. The NUI callshttps://np_clothing/rpcand loads logos fromnui://np_clothing/…, so keep the name. - Build the NUI (
web/distis not committed):shcd web && npm ci && npm run build - Database: the tables (
clothing_*) are created and migrated at every start.sql/install.sqlholds 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. - 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 - Give your staff the
np_clothing.packsnode (ornp_clothing.admin) in np_admin. Noadd_acelines, see Permissions. - 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 scanyourself. Until the first scan, stores have nothing to sell. - 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:
- their identifier is in
Config.Admins; - their framework group is in
Config.AdminGroups(ESXadmin/superadmin, qb / qbxadmin/god); - 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 |