Installation

4 min readUpdated 3 weeks ago

Installation

ML Clothing is a clothing and armor system with a bundled advanced inventory addon. Clothing pieces, armor plates, and bags are real inventory items that equip into fixed slots. Persistence of worn appearance is delegated to your appearance script or to inventory item metadata; the resource itself creates no clothing table.

Quick Start

Place ml_clothing in your resources folder and start it after its dependencies.

server.cfg
1ensure oxmysql
2ensure ox_lib
3ensure ml_bridge
4ensure ox_inventory
5ensure ml_clothing

The ox_inventory line is the included advanced inventory that ships with the product. It is not a separate download.

Restart, do not refresh

The package adds a streamed armor plate prop and a DLC_ITYP_REQUEST in the manifest. After adding the resource for the first time, restart the server so the asset streams. A live refresh alone can skip newly added stream files.

Database

ML Clothing does not create a clothing or appearance table. Worn outfits are saved through the detected appearance script, or through inventory item metadata when running in native mode.

The one table the resource creates belongs to the admin panel audit log. It is created automatically on first start; no manual SQL import is required.

ml_invadmin_audit
1CREATE TABLE IF NOT EXISTS ml_invadmin_audit (
2    id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
3    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
4    admin VARCHAR(64),
5    admin_src INT,
6    action VARCHAR(64),
7    detail TEXT
8)
Audit log only

This table stores admin actions performed through the inventory admin panel (item edits, stash edits, give and remove operations). It is not used for player clothing.

Item Registration

The clothing pieces, armor plates, and bag are inventory items. Register them in your inventory items file. The item definitions ship in _INSTALL/items.lua, and matching icons ship in _INSTALL/images/.

Clothing items (each stack = false, close = true):

  • hat: Hat, 300 g
  • mask: Mask, 200 g
  • glasses: Glasses, 100 g
  • earrings: Earrings, 50 g
  • chain: Chain, 100 g
  • watch: Watch, 150 g
  • bracelet: Bracelet, 100 g
  • undershirt: Undershirt, 250 g
  • jacket: Jacket, 500 g
  • bodyarmor: Body Armor, 1500 g
  • gloves: Gloves, 150 g
  • pants: Pants, 400 g
  • shoes: Shoes, 600 g
  • bag: Bag, 800 g
  • decals: Decals, 50 g

Armor plate items (each stack = true, close = true):

  • lightplate: Light Plate, 500 g. 25% armor when inserted in a plate carrier
  • heavyplate: Heavy Plate, 1200 g. 50% armor when inserted in a plate carrier
  • brokenplate: Broken Plate, 400 g. No protection, can be repaired
Icons

Copy the PNG files from _INSTALL/images/ into your inventory images folder so every registered item shows an icon.

Verify

Start the server and confirm the resource comes up without errors. With Config.Debug = true you should see the appearance detection line in the server console, for example:

lua
1[SERVER] Detected appearance script: bl_appearance

or, when no appearance script is running:

lua
1[SERVER] No appearance script detected, using native mode

Then in game:

  • A clothing item (for example jacket) equips into its fixed slot when used, and the ped component updates.
  • bodyarmor opens a plate carrier stash where plate items can be inserted.
  • A bag opens its own stash sized from the bag drawable.

Clothing item does nothing when used. The item name must match a key in Config.ClothingItems. Register the item in your inventory items file using the exact names from _INSTALL/items.lua. An unregistered item has no metadata and will not equip.

The armor plate prop does not appear. The prop streams from a DLC_ITYP_REQUEST declared in the manifest. Restart the server after first install; a hot refresh can skip the newly added stream asset.

Outfit does not save between sessions. ML Clothing delegates appearance persistence to the detected appearance script. Confirm illenium-appearance or bl_appearance is started before ml_clothing, or run in native mode where clothing is kept in item metadata. Check the detection line in the console with Config.Debug = true.

Admin panel says insufficient permissions. The panel checks admin status server side. Set Config.AdminAce in shared/invadmin_config.lua to an ACE your account holds, or grant the framework admin group that Bridge.HasPermission recognizes.

Items appear in the wrong slot or get dropped. Clothing slots 11 to 25 are reserved. If two items map to the same slot number in Config.ClothingItems, one is dropped on equip. Each clothing item must have a unique slot number.