> For the complete documentation index, see [llms.txt](https://piotreq-scripts.gitbook.io/piotreq-scripts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://piotreq-scripts.gitbook.io/piotreq-scripts/assets-and-guides/inventory-redesign/installation-guide.md).

# Installation Guide

## Inventory Installation Guide

This page is dedicated to installation of our Inventory Redesign script. Follow steps listed below to start using pScripts Inventory Redesign on your server.

{% hint style="danger" %}
Remember to DO NOT use other Inventory System's at same time!
{% endhint %}

### Prerequisities

Before you begin, ensure you have:

1. FiveM server with administrator access
2. Access to your server's database
3. File transfer capability (FTP or direct file access)

{% hint style="warning" %}
We do NOT recommend using FileZilla - It's corrupting script files many times!
{% endhint %}

## Step 1: Installing the dependencies

Our script requires 4 dependencies:

1. [ox\_lib](https://github.com/overextended/ox_lib)
2. [oxmysql](https://github.com/overextended/oxmysql/releases)
3. [ox\_target](https://github.com/overextended/ox_target/releases) \[It can be disabled in next step]
4. [p\_bridge](https://github.com/PiotreeQ/p_bridge)

*Additionaly, we recommend you use* [*MariaDB*](https://mariadb.org/) *as your Database Management System.*

***

## Step 2: Installing Inventory CFG

Paste code below into your server.cfg or create a new cfg named inventory.cfg and paste it into this file!

If you create new cfg named inventory.cfg, REMEMBER to add `exec inventory.cfg` into server.cfg

{% hint style="danger" %}
REMEMBER TO DELETE OLD INVENTORY CFG AND SETUP CFG FOR YOUR SERVER!
{% endhint %}

{% code title="inventory.cfg" %}

```editorconfig
# Activate specific event handlers and functions (supported: ox, esx, qb, qbx, nd)
setr inventory:framework "esx"
 
# Maximum carry capacity for players, in grams (frameworks may override this)
setr inventory:weight 30000

# Default number of slots for player inventories (frameworks may override this) [set amount with 14 additional clothing slots if u are using clothing system]
setr inventory:slots: 50
 
# Number of slots for drop inventories
setr inventory:dropslots 50
 
# Maximum drop capacity, in grams
setr inventory:dropweight 30000
 
# Integrated support for qtarget/ox_target stashes, shops, etc
# Note: qtarget is deprecated, a future update may drop support (ox_target only, or gated features)
setr inventory:target true
 
# Jobs with access to police armoury, evidence lockers, etc
setr inventory:police ["police", "sheriff"]
 
# Set dumpsters as networked entities. Not recommended due to CNetObj limits and entity lockdown.
setr inventory:networkdumpsters 0

# Disable/Enable Items rarity
setr inventory:rarity 1

# Disable/Enable Inventory Clothing System
setr inventory:clothing 1

# Disable/Enable Inventory Throwing Feature
setr inventory:throwing 1

# Disable/Enable Inventory Renaming Items
setr inventory:rename 1

### Client
 
# The URL to load item images from
setr inventory:imagepath "nui://ox_inventory/web/images"
 
# Weapons will reload after reaching 0 ammo
setr inventory:autoreload true
 
# Blur the screen while accessing the inventory
setr inventory:screenblur true
 
# Default hotkeys to access primary and secondary inventories, and hotbar
setr inventory:keys ["F2", "K", "TAB"]
 
# Enable control action when inventory is open
setr inventory:enablekeys [249]
 
# Weapons must be aimed before shooting
setr inventory:aimedfiring true
 
# Show a list of all nearby players when giving items
setr inventory:giveplayerlist true
 
# Toggle weapon draw/holster animations
setr inventory:weaponanims true
 
# Toggle item notifications (add/remove)
setr inventory:itemnotify true
 
# Toggle weapon item notifications (equip/holster)
setr inventory:weaponnotify true
 
# Disable drop markers and spawn a prop instead
setr inventory:dropprops true
 
# Set the default model used for drop props
setr inventory:dropmodel "prop_med_bag_01b"
 
# Disarm the player if an unexpected weapon is in use (i.e. did not use the weapon item)
setr inventory:weaponmismatch true
 
# Ignore weapon mismatch checks for the given weapon type (e.g. ['WEAPON_SHOVEL', 'WEAPON_HANDCUFFS'])
setr inventory:ignoreweapons []
 
# Suppress weapon and ammo pickups
setr inventory:suppresspickups 1
 
# Disables weapons for all players 
setr inventory:disableweapons 0
 
### Server
 
# Compare current version to latest release on GitHub
set inventory:versioncheck true
 
# Stashes will be wiped after remaining unchanged for the given time
set inventory:clearstashes "6 MONTH"
 
# Stashes will be saved in groups and not individually per query
set inventory:bulkstashsave 1
 
# Discord webhook url, used for imageurl metadata content moderation (image embeds)
set inventory:webhook ""
 
# Logging via ox_lib (0: Disable, 1: Standard, 2: Include AddItem/RemoveItem, and all shop purchases)
set inventory:loglevel 1
 
# Item prices fluctuate in shops
set inventory:randomprices false
 
# Loot will randomly generate inside unowned vehicles and dumpsters
set inventory:randomloot true
 
# Minimum job grade to remove items from evidence lockers
set inventory:evidencegrade 2
 
# Trim whitespace from vehicle plates when checking owned vehicles
setr inventory:trimplate true
 
# Set the contents of randomly generated inventories
# [item name, minimum, maximum, loot chance]
set inventory:vehicleloot [
    ["cola", 1, 1],
    ["water", 1, 1],
    ["garbage", 1, 2, 50],
    ["panties", 1, 1, 5],
    ["money", 1, 50],
    ["money", 200, 400, 5],
    ["bandage", 1, 1]
]
 
set inventory:dumpsterloot [
    ["mustard", 1, 1],
    ["garbage", 1, 3],
    ["money", 1, 10],
    ["burger", 1, 1]
]
 
# Set the markers for the various drops, stashes, shops
# These all follow the same strucutre, if the json strings are invalid it will fallback to a generic marker
setr inventory:dropmarker {
    "type": 2,
    "colour": [150, 30, 30],
    "scale": [0.3, 0.2, 0.15]
}
 
setr inventory:shopmarker {
    "type": 29,
    "colour": [30, 150, 30],
    "scale": [0.5, 0.5, 0.5]
}
 
setr inventory:evidencemarker {
    "type": 2,
    "colour": [30, 30, 150],
    "scale": [0.3, 0.2, 0.15]
}
 
setr inventory:craftingmarker {
    "type": 2,
    "colour": [150, 150, 30],
    "scale": [0.3, 0.2, 0.15]
}
 
# Set items to sync with framework accounts
set inventory:accounts ["money"]
```

{% endcode %}

***

## Step 3: Import Old Data

If you used ox\_inventory before, copy your items.lua, shops.lua, weapons.lua etc. from your old version and paste them into `data` folder! Same with item images!

REMEMBER to add these clothing items in your items.lua

<details>

<summary>Clothing Items</summary>

```lua
['clothes_hat'] = {
		label = 'Hat',
		weight = 50,
		stack = false,
		close = false,
		buttons = {
			{
				label = 'Show/Hide Hair',
				action = function(slot)
					TriggerEvent('p_itemclothes/client/toggleHair')
				end
			},
		},
		consume = 0,
		server = {
			export = 'p_itemclothes.useClothingItem'
		}
	},

	['clothes_ears'] = {
		label = 'Ear Accessories',
		weight = 50,
		stack = false,
		close = false,
		consume = 0,
		server = {
			export = 'p_itemclothes.useClothingItem'
		}
	},

	['clothes_tshirt'] = {
		label = 'T-Shirt',
		weight = 50,
		stack = false,
		close = false,
		consume = 0,
		server = {
			export = 'p_itemclothes.useClothingItem'
		}
	},

	['clothes_torso'] = {
		label = 'Jacket',
		weight = 50,
		stack = false,
		close = false,
		consume = 0,
		server = {
			export = 'p_itemclothes.useClothingItem'
		}
	},

	['clothes_arms'] = {
		label = 'Gloves',
		weight = 50,
		stack = false,
		close = false,
		consume = 0,
		server = {
			export = 'p_itemclothes.useClothingItem'
		}
	},

	['clothes_pants'] = {
		label = 'Pants',
		weight = 50,
		stack = false,
		close = false,
		consume = 0,
		server = {
			export = 'p_itemclothes.useClothingItem'
		}
	},

	['clothes_shoes'] = {
		label = 'Shoes',
		weight = 50,
		stack = false,
		close = false,
		consume = 0,
		server = {
			export = 'p_itemclothes.useClothingItem'
		}
	},

	['clothes_mask'] = {
		label = 'Mask',
		weight = 50,
		stack = false,
		close = false,
		buttons = {
			{
				label = 'Show/Hide Face',
				action = function(slot)
					TriggerEvent('p_itemclothes/client/toggleFace')
				end
			},
			{
				label = 'Show/Hide Hair',
				action = function(slot)
					TriggerEvent('p_itemclothes/client/toggleHair')
				end
			},
		},
		consume = 0,
		server = {
			export = 'p_itemclothes.useClothingItem'
		}
	},

	['clothes_glasses'] = {
		label = 'Glasses',
		weight = 50,
		stack = false,
		close = false,
		consume = 0,
		server = {
			export = 'p_itemclothes.useClothingItem'
		}
	},

	['clothes_vest'] = {
		label = 'Vest',
		weight = 50,
		stack = false,
		close = false,
		consume = 0,
		server = {
			export = 'p_itemclothes.useClothingItem'
		}
	},

	['clothes_bag'] = {
		label = 'Bag',
		weight = 50,
		stack = false,
		close = false,
		consume = 0,
		server = {
			export = 'p_itemclothes.useClothingItem'
		}
	},

	['clothes_watch'] = {
		label = 'Watch',
		weight = 50,
		stack = false,
		close = false,
		consume = 0,
		server = {
			export = 'p_itemclothes.useClothingItem'
		}
	},

	['clothes_chain'] = {
		label = 'Chain',
		weight = 50,
		stack = false,
		close = false,
		consume = 0,
		server = {
			export = 'p_itemclothes.useClothingItem'
		}
	},

	['clothes_bracelet'] = {
		label = 'Bracelet',
		weight = 50,
		stack = false,
		close = false,
		consume = 0,
		server = {
			export = 'p_itemclothes.useClothingItem'
		}
	},
```

</details>

***

## Step 4: Clothing Script Setup

{% hint style="warning" %}
If there is NO setup for your clothing script, then it's not REQUIRED to change anything in it.
{% endhint %}

### esx\_skin Setup

Option 1: Use attached file and replace it in script \[ONLY FOR FRESH AND LATEST VERSION]

Replace this file with `esx_skin/client/modules/menu.lua`

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

Option 2: Follow guide below and do it by yourself

<details>

<summary>esx_skin Guide</summary>

We recommend using LATEST and FRESH version of esx\_skin to avoid any issues and errors!

#### Add Clothing Events

1. Open `esx_skin/client/modules/menu.lua` and find `function Menu:cancel(data, menu)`
2. Paste this event `TriggerEvent('p_itemclothes/client/updateClothes', Skin.last)` like on screenshot below!

<figure><img src="/files/l8CJXwN7iaBLcFxDx7PJ" alt=""><figcaption></figcaption></figure>

3. Next find `function Menu:Saveable(submitCb, cancelCb, restrict)`
4. Paste this event `TriggerEvent('p_itemclothes/client/updateClothes', skin)` like on screenshot below!

<figure><img src="/files/dCYpv9zTW47VfgRKmcGz" alt=""><figcaption></figcaption></figure>

</details>

***

### qb-clothing Setup

Option 1: Use attached file and replace it in script \[ONLY FOR FRESH AND LATEST VERSION]

Replace this file with `qb-clothing/client/main.lua`

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

Option 2: Follow guide below and do it by yourself

<details>

<summary>qb-clothing Guide</summary>

We recommend using LATEST and FRESH version of qb-clothing to avoid any issues and errors!

#### Add Export to Get Data

1. Go to `qb-clothing/client/main.lua` and paste this code on **BOTTOM** of file!

```lua
exports('GetSkinData', function()
    return skinData
end)
```

#### Add Clothing Events

1. Find `local function resetClothing(data)` and add this code like on screenshot!

```lua
TriggerEvent('p_itemclothes/client/updateClothes', skinData)
```

<figure><img src="/files/nwMRRCsac22R2qkdhAaA" alt=""><figcaption></figcaption></figure>

2. Find `local function SaveSkin()` and add this code like on screenshot!

```lua
TriggerEvent('p_itemclothes/client/updateClothes', skinData)
```

<figure><img src="/files/8l8IOhogyHEunUkz4OXe" alt=""><figcaption></figcaption></figure>

</details>

***

### illenium-appearance Setup

Option 1: Use attached files and replace in script \[ONLY FOR FRESH AND LATEST VERSION]

Replace this file with illenium-appearance/client/client.lua

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

Replace this file with illenium-appearance/client/outfits.lua

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

Replace this file with illenium-appearance/game/customization.lua

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

Replace this file with illenium-appearance/game/util.lua

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

Option 2: Follow guide below and do it by yourself

<details>

<summary>illenium-appearance Guide</summary>

#### Add Clothing Events

1. Go to `illenium-appearance/client/client.lua` and find this below

```lua
RegisterNetEvent("illenium-appearance:client:changeOutfit", function(data)
```

2. Paste this code like on screenshot below!

```lua
TriggerEvent('p_itemclothes/client/updateClothes')
```

<figure><img src="/files/8oL5RRwA23253gHqNXkL" alt=""><figcaption></figcaption></figure>

3. Go to illenium-appearance/client/outfits.lua and find `function LoadJobOutfit(oData)`
4. Paste this code like on screenshot below!

```lua
TriggerEvent('p_itemclothes/client/updateClothes')
```

<figure><img src="/files/HUbXpUuBFkbthCbhNb42" alt=""><figcaption></figcaption></figure>

5. Go to illenium-appearance/game/customization.lua and find&#x20;

`function client.exitPlayerCustomization(appearance)`

5. Paste this code like on screenshot below!

```lua
TriggerEvent('p_itemclothes/client/updateClothes')
```

<figure><img src="/files/SGhdkxZWZgK7mGNYVlQU" alt=""><figcaption></figcaption></figure>

7. Go to illenium-appearance/game/util.lua and find `local function setPlayerAppearance(appearance)`
8. Paste this code like on screenshot below!

```lua
TriggerEvent('p_itemclothes/client/updateClothes')
```

<figure><img src="/files/aqZNhkQPKaBSjxVXQHxc" alt=""><figcaption></figcaption></figure>

9. Find `local function setPedComponents(ped, components)`
10. Paste this code like on screenshot below!

```lua
local invoker = GetInvokingResource() or GetCurrentResourceName()
if invoker ~= "p_itemclothes" then
    TriggerEvent('p_itemclothes/client/updateClothes') -- OUR EVENT HERE
end
```

<figure><img src="/files/sBIoG9u02IYMIKWzi8Kw" alt=""><figcaption></figcaption></figure>

11. Find `local function setPedProps(ped, props)`
12. Paste this code like on screenshot below!&#x20;

```lua
local invoker = GetInvokingResource() or GetCurrentResourceName()
if invoker ~= "p_itemclothes" then
    TriggerEvent('p_itemclothes/client/updateClothes') -- OUR EVENT HERE
end
```

<figure><img src="/files/ZjN6TeldYfmp5fA11QD9" alt=""><figcaption></figcaption></figure>

</details>

***

### crm-appearance Setup

{% hint style="danger" %}
DISABLE Items as Clothes in Config of crm-appearance!
{% endhint %}

<details>

<summary>crm-appearance Guide</summary>

#### Add Clothing Event

1. Go to `crm-appearance/crm-open/crm-client/crm-main.lua`
2. Find `function crm_on_save(crm_type, crm_old, crm_new)` and add code below like on screenshot

```lua
TriggerEvent('p_itemclothes/client/updateClothes', crm_new)
```

<figure><img src="/files/HNojeYT8vIIpyAC5vX5V" alt=""><figcaption></figcaption></figure>

</details>

***

### 0r-clothing Setup

<details>

<summary>0r-clothing Guide</summary>

1. Go to `0r-clothing/shared/config.lua` and add event below in all these functions like on screenshot

```lua
TriggerEvent('p_itemclothes/client/updateClothes')
```

<figure><img src="/files/hzBb4zo18tyaJePDZXKp" alt=""><figcaption></figcaption></figure>

</details>

***

### qs-appearance Setup

<details>

<summary>qs-appearance Guide</summary>

1. Go to `qs-appearance/client/custom/inventory` and add `ox_inventory.lua` here
2. Set Config.Inventory to `ox_inventory`

</details>

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

***

### 17Mov\_CharacterSystem Setup

<details>

<summary>17Mov_CharacterSystem Guide</summary>

1. Go to `17Mov_CharacterSystem/bridge/illenium.lua` and paste code below on bottom of file

```lua
local originalSetSkin = Skin.SetOnPed

Skin.SetOnPed = function(ped, skin)
    local invoker = GetInvokingResource() or "unknown"
    originalSetSkin(ped, skin)
    Citizen.Wait(1000)
    if invoker ~= 'p_itemclothes' then
        TriggerEvent('p_itemclothes/client/updateClothes')
    end
end
```

</details>

***

## Step 5: Downloading the Script

1. Download the script from your [Keymaster](https://portal.cfx.re/assets/granted-assets).
2. Extract the `p_itemclothes` and `ox_inventory` to your resources.

## Step 6: Configuration

1. Open `config.lua` file in the Script folder
2. Configure our script basing on your needs.

## Step 7: P\_Bridge Configuration

1. Download and extract [p\_bridge](https://github.com/PiotreeQ/p_bridge) onto your server.
2. Configure p\_bridge and its funtions in `config.lua`
3. Add the following line to your `server.cfg` **BELOW** your Framework

<pre class="language-editorconfig"><code class="lang-editorconfig"><strong>ensure ox_inventory
</strong><strong>ensure p_bridge
</strong><strong>ensure p_itemclothes
</strong></code></pre>

It's important to start in logical order to prevent any errors in your server console!

{% hint style="warning" %}
It's only EXAMPLE of starting order, should looks similiar but do not copy this.
{% endhint %}

```editorconfig
ensure oxmysql
ensure ox_lib
ensure es_extended # Your Framework Here
ensure ox_target
ensure ox_inventory
ensure p_bridge # Our Bridge must start BEFORE any of our script
ensure p_itemclothes
```

{% hint style="danger" %}
Make sure p\_bridge starts before any of **OUR** scripts
{% endhint %}

## Step 8: Start using our script

1. Save all changes
2. Restart / Start your FiveM server

Enjoy using our Inventory Redesign! :tada:
