# SLEEK CLOTHES STORE

{% embed url="<https://youtu.be/Z85O-68bqpc?si=JKeEPtm6MVHfqwJ7>" %}

## Forge Clothes

Clothing store resource for FiveM — business management, NPC employees, outfit saving/sharing, uniform points, and modern UI.

### Features

* Auto-detection of ESX / QBCore and skin handler
* 13 pre-configured stores (1 mask shop, 9 general, 3 Ponsonbys)
* Business system with worker/owner ranks and revenue split
* NPC employees with passive income and happiness system
* Supply/stock system
* Outfit saving, loading, and sharing between players
* Uniform points — job-restricted locker rooms with predefined outfits
* Item blacklist — hide specific clothing variants per gender
* Modern NUI with configurable colors, blur, and sounds
* ox\_target / qb-target or classic marker + keypress
* 9 banking integrations (ESX, QB, neon-boss, OKOK, FD, TGG, WASABI, CODEM, JUSTBANKING)
* Discord webhooks, multi-language (EN/ES)

### Requirements

| Dependency                                                                                         |               Required               |
| -------------------------------------------------------------------------------------------------- | :----------------------------------: |
| [oxmysql](https://github.com/overextended/oxmysql) (or mysql-async / ghmattimysql)                 |                  Yes                 |
| ESX or QBCore                                                                                      |                  Yes                 |
| A skin handler (illenium-appearance, rcore\_clothing, fivem-appearance, qb-clothing, or esx\_skin) |                  Yes                 |
| neon-boss                                                                                          | Only if `Cfg.UseNeonBossMenu = true` |
| ox\_target or qb-target                                                                            | Only if `Cfg.UseTargetSystem = true` |

### Installation

#### Step 1 — Place the resource

Copy `forge-clothes` into your server's `resources/` directory.

#### Step 2 — Database

Import the SQL tables from `INSTALL SQL.sql`:

```sql
CREATE TABLE `outfits` (
    `id` INT(11) NOT NULL AUTO_INCREMENT,
    `identifier` LONGTEXT NULL DEFAULT NULL,
    `name` LONGTEXT NOT NULL,
    `outfit` LONGTEXT NOT NULL,
    PRIMARY KEY (`id`)
) ENGINE=InnoDB;
```

The business table (`forge_clothestore_business`) is created automatically on first start.

#### Step 3 — server.cfg

```cfg
ensure oxmysql
ensure es_extended   # or qb-core
ensure forge-clothes
```

#### Step 4 — Start your server

The resource auto-detects your framework and skin handler. Edit `config/config.lua` to customize.

### Configuration

All configuration lives in `config/config.lua`:

```lua
Cfg.Locale              = 'en'       -- 'en' or 'es'
Cfg.SQLWrapper          = 'oxmysql'  -- 'oxmysql', 'mysql-async', or 'ghmattimysql'
Cfg.UseTargetSystem     = false      -- true = ox_target / qb-target
Cfg.AllowOutfitSaving   = true       -- Let players save outfits
Cfg.EnableOutfitSharing = true       -- Let players share outfits
```

#### Auto-detection

| What         | How                                                                                                    |
| ------------ | ------------------------------------------------------------------------------------------------------ |
| Framework    | `es_extended` running → ESX, `qb-core` running → QB                                                    |
| Skin Handler | First started wins: illenium-appearance → rcore\_clothing → fivem-appearance → qb-clothing → esx\_skin |

### Stores

Stores are defined in the `Cfg.Stores` array. Ships with 13 pre-configured stores.

#### Adding a new store

Append an entry to `Cfg.Stores`:

```lua
{
    label        = 'My Custom Store',
    coords       = vector3(100.0, 200.0, 30.0),
    npcModel     = 's_f_y_shop_low',
    npcSpawnPoint = vector4(101.0, 201.0, 30.0, 180.0),
    blip         = { use = true, sprite = 73, color = 5, name = 'map.clothing_store' },
    marker       = { use = true },
    distance     = { marker = 3.0, text = 2.0 },
    whitelistItems = false,
    wardrobeInShop = { use = true, coords = vector3(102.0, 202.0, 30.0) },
    isBusiness      = false,
    assignedJob     = '',
    societyKey      = '',
    workerRanks     = {},
    ownerRanks      = {},
    managementPoint = nil,
    bossMenuPoint   = nil,
},
```

#### Specialized stores (whitelist)

Restrict a store to specific categories:

```lua
whitelistItems = { 'Masks' },              -- Only masks
whitelistItems = { 'Hats', 'Glasses' },    -- Only hats and glasses
whitelistItems = false,                     -- Everything (default)
```

Names must match the `label` field in `Cfg.Items`.

#### In-store wardrobe

```lua
wardrobeInShop = { use = true, coords = vector3(x, y, z) },  -- With wardrobe
wardrobeInShop = { use = false },                              -- Without
```

### Item Blacklist

Hide specific clothing variants per gender using the `blackListed` field in `Cfg.Items`:

```lua
{
    category    = 'upper-body',
    label       = 'Tops',
    type        = 'clothes',
    id          = 11,
    price       = 300,
    blackListed = {
        ['male']   = { 55, 56, 220 },    -- Blocked drawable indices
        ['female'] = { 48, 49, 230 },
    },
},
```

To find drawable indices, open your appearance resource, navigate to the category, and note the variant numbers.

### Business System

Any store can be a managed business with its own balance, NPCs, stock, and sales history.

#### Enabling a business store

Set the business fields:

```lua
isBusiness      = true,
assignedJob     = 'clothestore1',
societyKey      = 'clothestore1',
workerRanks     = { 0, 1 },
ownerRanks      = { 2, 3 },
managementPoint = vector3(430.0, -800.0, 29.49),
```

The job must exist in your framework (ESX `jobs` table or QB `shared/jobs.lua`).

#### Management panel

Players with owner rank access the panel at `managementPoint` to:

* View and track company balance
* Hire and fire NPC employees
* Purchase stock
* Review sales history

#### Payment routing

**Built-in balance** (default):

```lua
Cfg.UseBuiltinBalance = true
```

**External banking:**

```lua
Cfg.UseBuiltinBalance = false
Cfg.SocietyMethod = 'ESX'   -- ESX, QB, FORGE, OKOK, FD, TGG, WASABI, CODEM, JUSTBANKING
```

#### Neon-Boss

```lua
Cfg.UseNeonBossMenu = true
```

Routes all money through neon-boss. Each store's `societyKey` must match the plain job name (not `'society_'` prefix).

### NPC Employees

Business stores can hire virtual clerks from a rotating pool via the management panel.

```lua
Cfg.NPCPool = {
    { name = 'Jessica Monroe',  ped = 'a_f_y_business_01', level = 2 },
    { name = 'Marcus Delgado',  ped = 'a_m_y_hipster_01',  level = 1 },
    -- Add more...
}
Cfg.MaxNPCEmployees    = 3
Cfg.NPCRotationMinutes = 120
```

#### Salaries

```lua
Cfg.NPCSalaryPerLevel    = 150   -- Salary = level × 150
Cfg.NPCSalaryIntervalMin = 60    -- Paid every 60 minutes
```

#### Passive income

When `EnableExtraSales = true`, each NPC generates revenue:

```
Revenue = ExtraSaleBase × (Level ^ ExtraSaleLevelExp) × HappinessMod × TeamBonus
```

#### Happiness

|  Level  | Modifier | Cause                                  |
| :-----: | :------: | -------------------------------------- |
| 3 Happy |   ×1.00  | Stock OK, salary paid                  |
|   2 OK  |   ×0.75  | Stock running low                      |
|  1 Sad  |   ×0.35  | Unpaid salary                          |
| 0 Angry |   ×0.00  | Unpaid + critical stock — NPC may quit |

### Stock System

Business stores consume stock per sale. Owners restock via management panel.

```lua
Cfg.DefaultSupplyMax        = 100   -- Max stock capacity
Cfg.SupplyPerSale           = 1     -- Stock consumed per item sold
Cfg.SupplyUnitPrice         = 50    -- Cost per stock unit
Cfg.SupplyBuyIncrement      = 10    -- Units per partial purchase
Cfg.SupplyAngerThreshold    = 50    -- Below 50 → NPCs become sad
Cfg.SupplyCriticalThreshold = 10    -- Below 10 → NPCs become angry
```

### Uniform Points

Job-restricted locker rooms where employees can equip predefined uniforms.

```lua
Cfg.UniformPoints = {
    {
        label    = 'LSPD Locker Room',
        coords   = vector3(452.43, -992.79, 30.69),
        jobs     = { 'police' },
        ranks    = {},                  -- Empty = all ranks
        uniforms = {
            {
                label = 'Patrol Uniform',
                male = {
                    { type = 'clothes', id = 11, index = 55, texture = 0 },  -- Top
                    { type = 'clothes', id = 4,  index = 35, texture = 0 },  -- Pants
                    { type = 'clothes', id = 6,  index = 25, texture = 0 },  -- Shoes
                    { type = 'prop',    id = 0,  index = 46, texture = 0 },  -- Hat
                },
                female = { ... },
            },
        },
    },
}
```

| `type`    | `id` reference                                                                                      |
| --------- | --------------------------------------------------------------------------------------------------- |
| `clothes` | 1=Masks, 3=Torso, 4=Legs, 5=Bags, 6=Shoes, 7=Accessories, 8=Undershirt, 9=Armor, 10=Decals, 11=Tops |
| `prop`    | 0=Hats, 1=Glasses, 2=Ears, 6=Watches, 7=Bracelets                                                   |

Equipping a uniform saves the player's current clothes. "Restore Clothes" returns to the original outfit.

### Outfit Sharing

Players can share their current outfit via command:

```lua
Cfg.EnableOutfitSharing  = true
Cfg.OutfitSharingCommand = "shareoutfit"
```

A popup lists nearby players (< 3m, same ped gender) with mugshots. The receiver gets an Accept/Deny prompt.

### Camera

| Control      | Action                                     |
| ------------ | ------------------------------------------ |
| Mouse drag   | Adjust height                              |
| Scroll wheel | Zoom in/out                                |
| Pie-menu     | Switch zone (face, chest, legs, full body) |

Zone FOV and height are configurable in `Cfg.CamFov` and `Cfg.CamHeight`.

### UI Appearance

Colors, effects, and animations:

```lua
Cfg.EnableBlur       = true    -- Background blur
Cfg.EnableUISounds   = true    -- Hover/click sounds
Cfg.EnableBackground = true    -- Dark overlay
Cfg.EnableHandsUpUI  = true    -- Arms-up pose while browsing
```

Color customization in `Cfg.UISettings.colors`.

### Translations

```lua
Cfg.Locale = 'en'   -- 'en' or 'es'
```

All strings in `config/translation.lua`. Copy the `en` block to add a new language.

### Exports

Server-side exports for other resources:

```lua
local balance = exports['forge-clothes']:getCompanyMoney(storeKey)
exports['forge-clothes']:addCompanyMoney(storeKey, amount)
exports['forge-clothes']:removeCompanyMoney(storeKey, amount)
```

`storeKey` is the store's position in `Cfg.Stores` as a string (e.g. `"1"`, `"2"`).

### Skin Manager Compatibility

Most skin managers include a built-in clothing shop. When forge-clothes is running, the skin manager should disable its own clothing blips/zones to avoid duplicates.

#### Does my skin manager need modification?

| Skin Manager              |    Needs Modification?    |
| ------------------------- | :-----------------------: |
| esx\_skin / skinchanger   | No — works out of the box |
| illenium-appearance (ESX) |          **Yes**          |
| illenium-appearance (QB)  |          **Yes**          |
| fivem-appearance (ESX)    |          **Yes**          |
| qb-clothing (QB)          |          **Yes**          |

#### Pre-modified downloads

Don't want to modify it yourself? Use the version that already includes full forge compatibility:

> These versions auto-detect all three forge scripts (tattoo, barber, clothes). When a forge script is running, the skin manager disables its own overlapping shop and calls the appropriate export after every appearance load.

{% file src="/files/9tLCByjrvPEmV6AC1gvK" %}

{% file src="/files/rOLLUBI4jeKmaruMou9T" %}

{% file src="/files/NWNH1EesPDbFH4dpyvtD" %}

{% file src="/files/R5jSa760X1zyWDbH9hTG" %}

### FAQ

**How do I know a store's index / storeKey?** Position in `Cfg.Stores` starting from `"1"`.

**Can I mix public and business stores?** Yes. Each store is independent — `isBusiness = false` for public, `true` for job-based.

**What happens when stock runs out?** Players can't buy. NPCs can't generate extra sales. Owners must restock via the panel.

**Do NPCs spawn in the world?** No — they're virtual employees managed through the panel. Only the shopkeeper NPC (`npcModel`) spawns.

**How do I make someone a store owner?** Assign them the matching job at an owner-level rank (e.g. job `clothestore1` grade `2`).

### Support

[Join our Discord](https://discord.gg/UTVssdrXRV) — installation help, bug reports, feature requests.

### License

© CodeForge — All rights reserved.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://codeforge.gitbook.io/codeforge/sleek-series/sleek-clothes-store.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
