# OX\_INVENTORY

## OX\_INVENTORY - Custom Enhanced Version

<figure><img src="https://2716755903-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLS6ELQxqmrSnBDsuhbmY%2Fuploads%2Fm4CM0vuCucw4SNlepKPw%2Fox_inv_2.webp?alt=media&#x26;token=44dc7c68-fb14-43d7-9e80-213d186d78a9" alt=""><figcaption></figcaption></figure>

```
From version v2.44.1 (currently the latest release)
```

### 🚀 Overview

This is a **custom enhanced version** of ox\_inventory with several advanced features added on top of the official version. This documentation covers all the additional functionality that makes this version unique and powerful for server owners looking for advanced inventory management.

#### 🔄 **Based on Latest ox\_inventory**

* **✅ Latest official version** - Built on the most recent ox\_inventory release
* **✅ Original source untouched** - Core ox\_inventory files remain completely unchanged
* **✅ Fully open source base** - All standard ox\_inventory functionality remains accessible
* **✅ Update compatible** - Easy integration of future ox\_inventory updates
* **✅ Additive approach** - New features added alongside, not replacing original code

### 🎯 Key Custom Features Added

#### 1. **Player Clone System** 🎭 🔒

* **Central clone display** in inventory UI
* **Nearby players visualization** for item exchange
* **Interactive 3D player models** in the top-right corner
* **⚠️ PROTECTED**: Core system files are secured and non-modifiable

#### 2. **Weapon Component System** 🔧 🔒

* **Right-click weapon modification** interface
* **3D weapon preview** with camera effects
* **Component categorization** and conflict management
* **⚠️ PROTECTED**: Core system files are secured and non-modifiable

#### 3. **Clothing System** 👕 ✏️

* **Dedicated clothing slots** (hat, mask, top, pants, shoes, etc.)
* **Configurable clothing categories**
* **Drop-and-equip** functionality
* **✅ CUSTOMIZABLE**: Full access to modify and extend functionality

#### 4. **Advanced Filtering System** 🔍 ✏️

* **Customizable item categories** with configurable icons
* **Dynamic filter buttons** in inventory UI
* **FontAwesome icon support**
* **✅ CONFIGURABLE**: Complete control via convars and configuration

#### 5. **Redesigned UI** ✨ 📦

* **Completely rebuilt frontend** with TypeScript/React
* **Fully configurable interface** elements
* **Modern responsive design**
* **📦 BUILD INCLUDED**: Pre-compiled UI ready to use

***

### 🔐 Access Level & Modification Rights

#### 🔒 **Protected Systems** (FxAP Secured)

* **Clone System** (`clone/` folder) - Core functionality protected
* **Weapon Components** (`component/` folder) - Core functionality protected
* These systems work out-of-the-box but **cannot be modified**

#### ✏️ **Customizable Systems** (Full Access)

* **Clothing System** (`modules/clothe/` folder) - Fully modifiable with debug prints included
* **Filter Configuration** (via convars) - Complete customization available
* **UI Styling** (pre-built but configurable via CSS/convars)

#### 📦 **Pre-built Systems** (Ready to Use)

* **Frontend UI** - Pre-compiled React/TypeScript build included
* **Configuration System** - Full convar control without source access

***

### 📋 Detailed Feature Documentation

#### 🎭 Clone System 🔒

<figure><img src="https://2716755903-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLS6ELQxqmrSnBDsuhbmY%2Fuploads%2FbYCJYGuG7J7HpvvexiHr%2Fox_inv_3.webp?alt=media&#x26;token=1198f46a-8fe3-4096-94e0-bd58cbc7d2c3" alt=""><figcaption></figcaption></figure>

**Central Player Clone**

The inventory displays a 3D clone of your character in the center, providing visual feedback for equipment changes.

**Files involved:** 🔒

* `clone/clone.lua` - Main clone management (PROTECTED)
* Configuration: Automatically enabled with inventory

**Features:**

* Real-time character preview
* Automatic clothing/equipment updates
* Optimized rendering performance

**Nearby Players Clone Exchange**

When the inventory is open, nearby players (within 10 units) appear as interactive 3D models in the top-right corner.

**Files involved:** 🔒

* `clone/clone_players.lua` - Nearby players detection and rendering (PROTECTED)

**Features:**

* **Automatic detection** of nearby players (up to 3)
* **3D player models** positioned in camera view
* **Drag-and-drop** item exchange
* **Visual feedback** with alpha transparency
* **Distance-based sorting** (closest players first)

**How it works:**

1. Players within 10 units are detected
2. 3D clones are created and positioned in the upper-right area
3. Items can be dragged onto these clones to give items
4. Visual feedback shows interaction states

**⚠️ Important:** This system is **fully protected** and works out-of-the-box. No modifications possible but complete functionality included.

***

#### 🔧 Weapon Component System 🔒

**Right-Click Weapon Modification**

<figure><img src="https://2716755903-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLS6ELQxqmrSnBDsuhbmY%2Fuploads%2FZpejls5j6J2ajeDxzF8I%2Fox_inv_5.webp?alt=media&#x26;token=7436cd29-7a2e-4e8a-b3a9-db023d55290c" alt=""><figcaption></figcaption></figure>

**Configuration:**

```lua
weaponcomponent = GetConvarInt('inventory:weaponcomponent', 1) == 1
```

**Files involved:** 🔒

* `component/client.lua` - Client-side weapon component UI (PROTECTED)
* `component/server.lua` - Server-side component management (PROTECTED)
* `component/function.lua` - Optional HUD hooks (CUSTOMIZABLE)

**Features:**

* **Right-click weapons** to open component menu
* **3D weapon preview** with zoom camera
* **Component categorization** (scopes, suppressors, grips, etc.)
* **Conflict detection** (mutually exclusive components)
* **Drag-and-drop** component installation/removal

**Component Categories:**

* `skin` - Weapon skins/tints
* `flashlight` - Flashlights and lights
* `suppressor` - Silencers and muzzle attachments
* `laser` - Laser sights
* `scope` - Scopes and sights
* `grip` - Foregrips and handles
* `stock` - Stocks and stabilizers
* `magazine` - Extended magazines

**Usage:**

1. Right-click on any weapon in inventory
2. 3D weapon preview opens with camera focus
3. Drag components onto weapon to install
4. Click installed components to remove them
5. Automatic conflict resolution prevents incompatible combinations

**⚠️ Important:** This system is **fully protected** and works out-of-the-box. Configuration via convars only, core files cannot be modified.

**HUD Hooks (Hide/Show) ✏️**

To integrate your HUD when the component UI opens/closes, edit `component/function.lua`:

```lua
-- Called when the components UI opens
function ComponentUI_HideHUD()
    -- Example integrations, uncomment and adapt:
    -- TriggerEvent('hud:toggle', false)
    -- exports['qs-hud']:toggle(false)
    DisplayRadar(false) -- default fallback
end

-- Called when the components UI closes
function ComponentUI_ShowHUD()
    -- TriggerEvent('hud:toggle', true)
    -- exports['qs-hud']:toggle(true)
    DisplayRadar(true) -- default fallback
end
```

These functions are automatically called by `component/client.lua` when opening/closing the component UI. If you already handle HUD hiding elsewhere, you can leave defaults.

***

#### 👕 Clothing System ✏️

**Configurable Clothing Slots**

**Configuration:**

```lua
clothingslots = GetConvarInt('inventory:clothingslots', 1) == 1
```

**Files involved:** ✏️

* `modules/clothe/client.lua` - Clothing slot management (FULLY CUSTOMIZABLE)

**Available Slots:**

* **Hat** - Hats and helmets (Component 0)
* **Mask** - Masks and face coverings (Component 1)
* **Top** - Shirts and jackets (Component 3)
* **Undershirt** - Undershirts (Component 8)
* **Pants** - Pants and shorts (Component 4)
* **Shoes** - Shoes and boots (Component 6)
* **Glasses** - Glasses and eyewear (Props)
* **Earring** - Earrings (Props)
* **Chain** - Necklaces and chains (Props)
* **Watch** - Watches and bracelets (Props)

**Customization:** ✏️ Each clothing slot has configurable callbacks for custom behavior:

```lua
callback = function(action, data)
    if action == 'click' then
        print('Hat slot clicked') -- Debug prints included
        -- Handle slot click
    elseif action == 'drop' then
        print('Item dropped on hat slot:', (data.itemName or 'unknown')) -- Debug prints included
        -- Handle item drop on slot
        -- data.itemName contains the dropped item
        -- TODO: Add event handler for clothing slot usage
        -- TriggerEvent('ox_inventory:clothingSlotUsed', 'hat', action, data)
    end
end
```

**✅ Developer Friendly:**

* **Full source access** to clothing system
* **Debug prints included** for easy development
* **TODO comments** showing integration points
* **Modifiable callbacks** for custom functionality
* **Easy integration** with skinchanger/esx\_skin

***

#### 🔍 Advanced Filtering System

**Configurable Item Categories**

**Configuration:**

```lua
-- Enable/disable filters
inventoryfilters = GetConvarInt('inventory:inventoryfilters', 1) == 1

-- Define custom categories
filtercategories = json.decode(GetConvar('inventory:filtercategories', '["food", "weapon", "tool", "other", "money"]'))

-- Define custom icons (FontAwesome classes)
filtercategoryicons = json.decode(GetConvar('inventory:filtercategoryicons', 
    '{"food": "fas fa-utensils", "weapon": "fas fa-gun", "tool": "fas fa-tools", "other": "fas fa-box-open", "money": "fas fa-dollar-sign"}'))
```

**Features:**

* **Dynamic category buttons** in inventory UI
* **FontAwesome icon support** for categories
* **Configurable category list** via convars
* **Automatic item filtering** based on item category
* **Multi-language support** for category names

**Adding Custom Categories:**

1. Add category to `filtercategories` array
2. Define icon in `filtercategoryicons` object
3. Set `category` field in item definitions (data/items.lua)
4. Add translation in locales (optional)

**Example:**

```lua
-- In server.cfg
set inventory:filtercategories '["food", "weapon", "tool", "vehicle", "other", "money"]'
set inventory:filtercategoryicons '{"food": "fas fa-utensils", "weapon": "fas fa-gun", "tool": "fas fa-tools", "vehicle": "fas fa-car", "other": "fas fa-box-open", "money": "fas fa-dollar-sign"}'
```

***

### ⚙️ Configuration Guide

#### Essential Convars

Add these to your `server.cfg` to configure the custom features:

```bash
# Enable weapon component system (right-click weapons)
set inventory:weaponcomponent 1

# Enable clothing slots
set inventory:clothingslots 1

# Enable inventory filters
set inventory:inventoryfilters 1

# Configure filter categories (JSON array)
set inventory:filtercategories '["food", "weapon", "tool", "medical", "other", "money"]'

# Configure category icons (JSON object with FontAwesome classes)
set inventory:filtercategoryicons '{"food": "fas fa-utensils", "weapon": "fas fa-gun", "tool": "fas fa-tools", "medical": "fas fa-medkit", "other": "fas fa-box-open", "money": "fas fa-dollar-sign"}'
```

#### Optional Convars

```bash
# Standard ox_inventory convars still apply
set inventory:slots 50
set inventory:weight 30000
set inventory:screenblur 1
set inventory:keys '["F2", "K", "TAB"]'
```

***

### 🛠️ Installation & Setup

#### Prerequisites

* **ox\_lib** (minimum version 3.27.0)
* **oxmysql** (minimum version 2.7.3)
* **ESX/QBCore** framework support

#### Installation Steps

1. **Replace** your existing ox\_inventory with this enhanced version
2. **Ensure** the resource starts **after** ox\_lib and oxmysql
3. **Configure** convars in server.cfg (see Configuration Guide)
4. **Restart** the resource or server
5. **Test** all features in-game

#### File Structure

```
ox_inventory/
├── clone/                    # Clone system files
│   ├── clone.lua            # Central player clone
│   └── clone_players.lua    # Nearby players system
├── component/               # Weapon component system
│   ├── client.lua          # Component UI and management
│   └── server.lua          # Component server logic
├── modules/clothe/          # Clothing system
│   └── client.lua          # Clothing slots management
├── web/                     # Enhanced UI (React/TypeScript)
│   └── src/                # Source files for UI
└── ... (standard ox_inventory files)
```

***

### 🎨 UI Customization 📦

<figure><img src="https://2716755903-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLS6ELQxqmrSnBDsuhbmY%2Fuploads%2Fi13sEXotM1rvNJR6iJvg%2Fox_inv_6.webp?alt=media&#x26;token=8da36fd1-aa8b-42a3-9545-d062e3d3967e" alt=""><figcaption></figcaption></figure>

#### Frontend Framework

* **React** with TypeScript
* **Tailwind CSS** for styling
* **FontAwesome** icons
* **Fully responsive** design

#### Customizable Elements ✏️

* **Filter categories** and icons (via convars)
* **Clothing slot** labels and behavior (via source access)
* **Component categories** for weapons (protected)
* **Color schemes** and themes (via CSS overrides)
* **Configuration** via convars (no source needed)

#### Pre-built UI 📦

* **Build included** - No compilation required
* **Source not included** - Pre-compiled for protection
* **Configuration via convars** - Full customization without source access
* **CSS overrides supported** for styling modifications

**⚠️ Note:** While the source is not included, the UI is fully functional and customizable through configuration options and CSS overrides.

***

### 📦 What's Included in This Package

#### ✅ **Ready-to-Use Systems**

* **Complete ox\_inventory** with all custom features
* **Pre-compiled UI build** (web/build/ folder)
* **Clone system** (protected but fully functional)
* **Weapon component system** (protected but fully functional)
* **Clothing system** (source included with debug prints)
* **Filter system** (fully configurable)
* **Complete documentation** and setup guide

#### ✏️ **Source Code Included**

* **Clothing system** (`modules/clothe/client.lua`) - Full access with helpful debug prints
* **Configuration files** (`init.lua`) - Enhanced with new convars, original functionality preserved
* **All standard ox\_inventory modules** - Complete original source code untouched and accessible
* **Data files** - Items, shops, etc. fully accessible as per original ox\_inventory
* **Original ox\_inventory functionality** - 100% preserved and open source

#### 🔒 **Protected Systems**

* **Clone logic** (`clone/` folder) - Functional but secured
* **Weapon component logic** (`component/` folder) - Functional but secured
* **UI source code** - Pre-built only, no TypeScript/React source

#### 🚫 **Not Included**

* **UI source files** (TypeScript/React source code)
* **Raw clone system source** (protected via FxAP)
* **Raw weapon component source** (protected via FxAP)

**💡 This approach ensures:**

* **Immediate functionality** - Everything works out of the box
* **Customization where needed** - Clothing system fully modifiable
* **Protection of core innovations** - Clone and weapon systems secured
* **Full configuration control** - Complete customization via convars
* **Original code preserved** - All standard ox\_inventory remains open source and accessible
* **Future update compatibility** - Easy integration of new ox\_inventory versions

***

### 🤝 Support & Compatibility

#### Framework Support

* ✅ **ESX Legacy** (fully supported)
* ✅ **QBCore** (fully supported)
* ✅ **Standalone** mode

#### ox\_inventory Compatibility

* **🔄 Based on latest official version** (v2.44.1+)
* **✅ 100% backward compatible** with existing ox\_inventory setups
* **✅ All original functionality preserved** and open source
* **✅ Easy migration** from standard ox\_inventory
* **🔄 Update strategy**: New ox\_inventory versions can be integrated by updating core files while preserving custom additions

#### Known Compatibility

* Works with **esx\_skin** and **skinchanger**
* Compatible with **weapon shops** and crafting systems
* Supports **custom item** categories and metadata
* **Fully compatible** with existing ox\_inventory plugins and extensions

#### Performance

* **Optimized clone rendering** with automatic cleanup
* **Minimal performance impact** on nearby player detection
* **Efficient component** preview system
* **Smart filtering** without lag
* **No performance degradation** compared to standard ox\_inventory

***

### 🐛 Troubleshooting

#### Common Issues

**Clone not showing:**

* Ensure ox\_lib is properly installed
* Check for console errors related to clone creation
* Verify resource load order

**Weapon components not working:**

* Check `inventory:weaponcomponent` convar is set to 1
* Ensure weapon has proper metadata structure
* Verify component items exist in items.lua

**Filters not appearing:**

* Check `inventory:inventoryfilters` convar is set to 1
* Verify `filtercategories` JSON syntax is valid
* Ensure item categories match configured filters

**Clothing slots not working:**

* Check `inventory:clothingslots` convar is set to 1
* Verify clothing items have proper subcategory metadata

***

### 📝 Credits & License

#### Original Work

* **ox\_inventory** by **Overextended Team** - Full credit to the original developers
* **Base framework and structure** - 100% preserved and open source
* **Core functionality** - All original features remain intact and accessible

#### Our Custom Enhancements (Added On Top)

* **Clone system** implementation - New feature addition
* **Weapon component** management - Enhanced functionality
* **Advanced filtering** system - UI improvements
* **Clothing slots** integration - New feature addition
* **UI redesign** and improvements - Enhanced user experience

#### 🤝 Respect for Original Work

* **✅ No original code modified** - We added features alongside, not replacing
* **✅ Full attribution** to Overextended team maintained
* **✅ Original license respected** - Same terms as official ox\_inventory
* **✅ Open source commitment** - All standard ox\_inventory functionality remains open
* **✅ Community contribution** - Designed to enhance, not replace the original

#### License

This enhanced version maintains the **exact same license** as the original ox\_inventory. We fully respect and credit the **Overextended Team** for their exceptional work. Our additions are built as enhancements on top of their solid foundation.

**📋 Important Note:**

* **Original ox\_inventory source code** is **100% preserved** and **fully accessible**
* **Latest official version** used as base (regularly updated)
* **No vendor lock-in** - You have complete access to the underlying ox\_inventory
* **Future-proof** - Easy to update with new ox\_inventory releases

***

*This documentation covers all custom features added to the standard ox\_inventory. For standard ox\_inventory documentation, please refer to the official Overextended documentation.*


---

# 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://rex-studio.gitbook.io/rex-studio-docs/fivem-script/ox_inventory.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.
