Commands and exports
Eleven Inventory commands on FiveM to take clothes off and on (/mask, /hat…), the /wearables_reset admin command, and the server exports for other resources.
Clothing toggle commands
Every panel slot has a command that does two things: if you're wearing that garment, it comes off (back to your inventory); if you aren't, you put on the last one you took off from that slot or, if you no longer have it, the first garment of that type in your inventory.
| Command | Garment |
|---|---|
/mask | Mask |
/hat | Hat |
/glasses | Glasses |
/earrings | Earrings |
/shirt | Top |
/vest | Vest |
/chain | Chain |
/decal | Decal |
/pants | Pants |
/shoes | Shoes |
/bag | Bag |
/gloves | Gloves |
/watch | Watch |
/bracelet | Bracelet |
If you don't have a garment of that type in your inventory, you get "You don't have a garment of that type in your inventory."
- Rename one: set the
commandfield of that slot inConfig.Wearables.slots(no slash:'mask'). - Remove one: set
command = falseon that slot. - Remove them all:
Config.Commands.enabled = false.
Warning
These names can clash with other clothing scripts that already use /mask, /hat… (dpclothing, for instance). If that happens, rename or disable them.
Commands follow the same rules as the panel: they don't work while dead, they refuse while a uniform is on (if respectUniform is enabled) and, when cuffed, they work without the animation if commandsWhileCuffed is enabled. All in Configuration.
Admin command
| Command | Who | What it does |
|---|---|---|
/wearables_reset <id> | group.admin | Resyncs a player's equipped clothes with their saved illenium-appearance skin. Before clearing, it hands back to their inventory any garments that were genuinely their own items. |
Use it when a player's panel doesn't match what they're actually wearing. When it's done, the admin gets "Equipment resynchronised." and a line is printed to the server console.
Server exports
-- Garments a player is wearing
local equipped = exports['precinto-inventory']:GetEquipped(source)
-- Who first wore a garment: { id, name, registered_at } or nil
local owner = exports['precinto-inventory']:GetWearableOwner(item.metadata)
GetEquipped(source)
Returns the list of garments the player is wearing. Each entry has:
| Field | What it is |
|---|---|
name | Item name (wear_mask…) |
kind | 'component' or 'prop' |
slotId | Component or prop id |
drawable, texture | GTA model and texture |
metadata | The item's metadata |
GetWearableOwner(metadata)
Takes an item's metadata and returns the stamp of who first wore it ({ id, name, registered_at }), or nil if it isn't a garment or has no stamp. Stamps only exist with Config.Wearables.stampOwner = true.
What a clothing item looks like
For developers of other resources: a garment is a regular ox_inventory item with this metadata.
| Field | What it is |
|---|---|
wearable | { kind, slotId }. This is what marks it as a garment. |
drawable, texture | Model and texture. |
label | Display name. |
owner | Optional: who first wore it. |
Note
Clothing items aren't handed out manually: they're created from what each character is wearing (the first time they open the inventory, and after every clothing-shop purchase).