---
description: Follow these steps for flawless installation
---

# Installation Guide

1. Download the script from your [keymaster](https://keymaster.fivem.net/login?return_url=/).\

2. Place the script into your server resource folder:\
   &#xNAN;_`FXServer\server-data\resources\fivecode_armor`_\

3. Write the script into your server.cfg:\
   &#xNAN;_`ensure fivecode_armor`_\

4. Setup your inventory:

<details>

<summary>ox</summary>

Add the following into:\
&#xNAN;_`ox_inventory\modules\items\client.lua`_

```lua
Item('vest_police', function(data, slot)
    TriggerServerEvent('fivecode_armor:useVest', slot)
end)

Item('vest_normal', function(data, slot)
    TriggerServerEvent('fivecode_armor:useVest', slot)
end)

Item('vestplate_police', function(data, slot)
    TriggerServerEvent('fivecode_armor:usePlate', slot)
end)

Item('vestplate_normal', function(data, slot)
    TriggerServerEvent('fivecode_armor:usePlate', slot)
end)
```

and this into:\
&#xNAN;_`ox_inventory\data\items.lua`_

```lua
['vest_police'] = {	
    label = 'Police Vest',
    weight = 10,
    description = 'New police bulletproof vest',
    stack = false,
    close = true,
},

['vest_normal'] = {
    label = 'Normal Vest',
    weight = 10,
    description = 'New normal bulletproof vest',
    stack = false,
    close = true,
},


['vestplate_police'] = {	
    label = 'Police Vest Plate',
    weight = 10,
    description = 'Police Bulletproof Vest Plate',
    stack = true,
    close = true,
},

['vestplate_normal'] = {	
    label = 'Normal Vest Plate',
    weight = 10,
    description = 'Normal Bulletproof Vest Plate',
    stack = true,
    close = true,
},
```

</details>

<details>

<summary>qb</summary>

Add the following into:\
&#xNAN;_`qb-core\shared\items.lua`_

```lua
vest_police           = {name = 'vest_police',           label = 'Police Vest',           weight = 10,   type = 'item',  image = 'vest_police.png',           unique = true,  useable = true,  shouldClose = true,  combinable = nil, description = 'New police bulletproof vest'},
vest_normal           = {name = 'vest_normal',           label = 'Normal Vest',           weight = 10,   type = 'item',  image = 'vest_normal.png',           unique = true,  useable = true,  shouldClose = true,  combinable = nil, description = 'New normal bulletproof vest'},
vestplate_police      = {name = 'vestplate_police',      label = 'Police Vest Plate',     weight = 10,   type = 'item',  image = 'vestplate_police.png',      unique = true,  useable = true,  shouldClose = true,  combinable = nil, description = 'Police Bulletproof Vest Plate'},
vestplate_normal      = {name = 'vestplate_normal',      label = 'Normal Vest Plate',     weight = 10,   type = 'item',  image = 'vestplate_normal.png',      unique = true,  useable = true,  shouldClose = true,  combinable = nil, description = 'Normal Bulletproof Vest Plate'},
```

<mark style="color:red;">**Skip the step bellow if you are using qb-inventory v2.**</mark>

And this to:\
&#xNAN;_`qb-inventory/html/js/app.js`_

<pre class="language-lua"><code class="lang-lua"><strong>New:
</strong>else if (itemData.name == "vestplate_police") {
    return `
        &#x3C;p>&#x3C;strong>${itemData.info.label}&#x3C;/strong>&#x3C;/p>
        &#x3C;p>&#x3C;strong>Strength: &#x3C;/strong>&#x3C;span>${itemData.info.strength}&#x3C;/span>&#x3C;/p>
    `;
}

else if (itemData.name == "vestplate_normal") {
    return `
        &#x3C;p>&#x3C;strong>${itemData.info.label}&#x3C;/strong>&#x3C;/p>
        &#x3C;p>&#x3C;strong>Strength: &#x3C;/strong>&#x3C;span>${itemData.info.strength}&#x3C;/span>&#x3C;/p>
    `;
}

else if (itemData.name == "vest_police") {
    return `
        &#x3C;p>&#x3C;strong>${itemData.info.label}&#x3C;/strong>&#x3C;/p>
        &#x3C;p>&#x3C;strong>Armor: &#x3C;/strong>&#x3C;span>${itemData.info.armor}/${itemData.info.maxArmor}&#x3C;/span>&#x3C;/p>
    `;
}

else if (itemData.name == "vest_normal") {
    return `
        &#x3C;p>&#x3C;strong>${itemData.info.label}&#x3C;/strong>&#x3C;/p>
        &#x3C;p>&#x3C;strong>Armor: &#x3C;/strong>&#x3C;span>${itemData.info.armor}/${itemData.info.maxArmor}&#x3C;/span>&#x3C;/p>
    `;
}

<strong>Old:
</strong>else if (itemData.name == "vestplate_police") {
    $(".item-info-title").html("&#x3C;p>" + itemData.info.label + "&#x3C;/p>");
    $(".item-info-description").html(
        "&#x3C;p>&#x3C;strong>Strenght: &#x3C;/strong>&#x3C;span>" +
        itemData.info.strenght+
        "&#x3C;/span>&#x3C;/p>"
    );
}

else if (itemData.name == "vestplate_normal") {
    $(".item-info-title").html("&#x3C;p>" + itemData.info.label + "&#x3C;/p>");
    $(".item-info-description").html(
        "&#x3C;p>&#x3C;strong>Strenght: &#x3C;/strong>&#x3C;span>" +
        itemData.info.strenght+
        "&#x3C;/span>&#x3C;/p>"
    );
}

else if (itemData.name == "vest_police") {
    $(".item-info-title").html("&#x3C;p>" + itemData.info.label + "&#x3C;/p>");
    $(".item-info-description").html(
        "&#x3C;p>&#x3C;strong>Armor: &#x3C;/strong>&#x3C;span>" +
        itemData.info.armor + "/" + itemData.info.maxArmor +
    "&#x3C;/span>&#x3C;/p>"
    );
}

else if (itemData.name == "vest_normal") {
    $(".item-info-title").html("&#x3C;p>" + itemData.info.label + "&#x3C;/p>");
    $(".item-info-description").html(
        "&#x3C;p>&#x3C;strong>Armor: &#x3C;/strong>&#x3C;span>" +
        itemData.info.armor + "/" + itemData.info.maxArmor +
    "&#x3C;/span>&#x3C;/p>"
    );
}
</code></pre>

</details>

<details>

<summary>qs</summary>

Add the following into:\
&#xNAN;_`qs-inventory\shared\items.lua`_

```lua
['vest_police']       = {name = 'vest_police',        label = 'Police Vest',         weight = 10, type = 'item', image = 'vest_police.png',        unique = true, useable = true, shouldClose = true, combinable = nil, description = 'New police bulletproof vest'},
['vest_normal']       = {name = 'vest_normal',        label = 'Normal Vest',         weight = 10, type = 'item', image = 'vest_normal.png',        unique = true, useable = true, shouldClose = true, combinable = nil, description = 'New normal bulletproof vest'},
['vestplate_police']  = {name = 'vestplate_police',   label = 'Police Vest Plate',   weight = 10, type = 'item', image = 'vestplate_police.png',   unique = true, useable = true, shouldClose = true, combinable = nil, description = 'Police Bulletproof Vest Plate'},
['vestplate_normal']  = {name = 'vestplate_normal',   label = 'Normal Vest Plate',   weight = 10, type = 'item', image = 'vestplate_normal.png',   unique = true, useable = true, shouldClose = true, combinable = nil, description = 'Normal Bulletproof Vest Plate'},
```

And this into:\
&#xNAN;_`qs-inventory\config\metadata.js`_

```lua
else if (itemData.name == "plate") {
    $(".item-info-title").html("<p>" + itemData.info.label + "</p>");
    $(".item-info-description").html(
        "<p><strong>Strenght: </strong><span>" +
        itemData.info.strenght+
        "</span></p>"
    );
}

else if (itemData.name == "bulletproofvest") {
    $(".item-info-title").html("<p>" + itemData.info.label + "</p>");
    $(".item-info-description").html(
        "<p><strong>Armor: </strong><span>" +
        itemData.info.armor + "/" + itemData.info.maxArmor +
    "</span></p>"
    );
}
```

</details>

<details>

<summary><strong>ps</strong></summary>

Add the following into:\
&#xNAN;_`qb-core\shared\items.lua`_

```lua
vest_police           = {name = 'vest_police',           label = 'Police Vest',           weight = 10,   type = 'item',  image = 'vest_police.png',           unique = true,  useable = true,  shouldClose = true,  combinable = nil, description = 'New police bulletproof vest'},
vest_normal           = {name = 'vest_normal',           label = 'Normal Vest',           weight = 10,   type = 'item',  image = 'vest_normal.png',           unique = true,  useable = true,  shouldClose = true,  combinable = nil, description = 'New normal bulletproof vest'},
vestplate_police      = {name = 'vestplate_police',      label = 'Police Vest Plate',     weight = 10,   type = 'item',  image = 'vestplate_police.png',      unique = true,  useable = true,  shouldClose = true,  combinable = nil, description = 'Police Bulletproof Vest Plate'},
vestplate_normal      = {name = 'vestplate_normal',      label = 'Normal Vest Plate',     weight = 10,   type = 'item',  image = 'vestplate_normal.png',      unique = true,  useable = true,  shouldClose = true,  combinable = nil, description = 'Normal Bulletproof Vest Plate'},
```

And this to:\
`ps-inventory/html/js/app.js`

<pre class="language-lua"><code class="lang-lua"><strong>New:
</strong>else if (itemData.name == "vestplate_police") {
    return `
        &#x3C;p>&#x3C;strong>${itemData.info.label}&#x3C;/strong>&#x3C;/p>
        &#x3C;p>&#x3C;strong>Strength: &#x3C;/strong>&#x3C;span>${itemData.info.strength}&#x3C;/span>&#x3C;/p>
    `;
}

else if (itemData.name == "vestplate_normal") {
    return `
        &#x3C;p>&#x3C;strong>${itemData.info.label}&#x3C;/strong>&#x3C;/p>
        &#x3C;p>&#x3C;strong>Strength: &#x3C;/strong>&#x3C;span>${itemData.info.strength}&#x3C;/span>&#x3C;/p>
    `;
}

else if (itemData.name == "vest_police") {
    return `
        &#x3C;p>&#x3C;strong>${itemData.info.label}&#x3C;/strong>&#x3C;/p>
        &#x3C;p>&#x3C;strong>Armor: &#x3C;/strong>&#x3C;span>${itemData.info.armor}/${itemData.info.maxArmor}&#x3C;/span>&#x3C;/p>
    `;
}

else if (itemData.name == "vest_normal") {
    return `
        &#x3C;p>&#x3C;strong>${itemData.info.label}&#x3C;/strong>&#x3C;/p>
        &#x3C;p>&#x3C;strong>Armor: &#x3C;/strong>&#x3C;span>${itemData.info.armor}/${itemData.info.maxArmor}&#x3C;/span>&#x3C;/p>
    `;
}

<strong>Old:
</strong>else if (itemData.name == "vestplate_police") {
    $(".item-info-title").html("&#x3C;p>" + itemData.info.label + "&#x3C;/p>");
    $(".item-info-description").html(
        "&#x3C;p>&#x3C;strong>Strenght: &#x3C;/strong>&#x3C;span>" +
        itemData.info.strenght+
        "&#x3C;/span>&#x3C;/p>"
    );
}

else if (itemData.name == "vestplate_normal") {
    $(".item-info-title").html("&#x3C;p>" + itemData.info.label + "&#x3C;/p>");
    $(".item-info-description").html(
        "&#x3C;p>&#x3C;strong>Strenght: &#x3C;/strong>&#x3C;span>" +
        itemData.info.strenght+
        "&#x3C;/span>&#x3C;/p>"
    );
}

else if (itemData.name == "vest_police") {
    $(".item-info-title").html("&#x3C;p>" + itemData.info.label + "&#x3C;/p>");
    $(".item-info-description").html(
        "&#x3C;p>&#x3C;strong>Armor: &#x3C;/strong>&#x3C;span>" +
        itemData.info.armor + "/" + itemData.info.maxArmor +
    "&#x3C;/span>&#x3C;/p>"
    );
}

else if (itemData.name == "vest_normal") {
    $(".item-info-title").html("&#x3C;p>" + itemData.info.label + "&#x3C;/p>");
    $(".item-info-description").html(
        "&#x3C;p>&#x3C;strong>Armor: &#x3C;/strong>&#x3C;span>" +
        itemData.info.armor + "/" + itemData.info.maxArmor +
    "&#x3C;/span>&#x3C;/p>"
    );
}
</code></pre>

</details>

<details>

<summary><strong>codem</strong></summary>

Add the following into:\
&#xNAN;_`codem-inventory\config\itemlist.lua`_

```lua
vest_police           = {name = 'vest_police',           label = 'Police Vest',           weight = 10,   type = 'item',  image = 'vest_police.png',           unique = true,  useable = true,  shouldClose = true,  combinable = nil, description = 'New police bulletproof vest'},
vest_normal           = {name = 'vest_normal',           label = 'Normal Vest',           weight = 10,   type = 'item',  image = 'vest_normal.png',           unique = true,  useable = true,  shouldClose = true,  combinable = nil, description = 'New normal bulletproof vest'},
vestplate_police      = {name = 'vestplate_police',      label = 'Police Vest Plate',     weight = 10,   type = 'item',  image = 'vestplate_police.png',      unique = true,  useable = true,  shouldClose = true,  combinable = nil, description = 'Police Bulletproof Vest Plate'},
vestplate_normal      = {name = 'vestplate_normal',      label = 'Normal Vest Plate',     weight = 10,   type = 'item',  image = 'vestplate_normal.png',      unique = true,  useable = true,  shouldClose = true,  combinable = nil, description = 'Normal Bulletproof Vest Plate'},
```

</details>

<details>

<summary><strong>core</strong></summary>

Add the following into your database:

```sql
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`, `desc`) VALUES
    ('vest_police', 'Police Vest', 10, 0, 1, 'New police bulletproof vest'),
    ('vest_normal', 'Normal Vest', 10, 0, 1, 'New normal bulletproof vest'),
    ('vestplate_police', 'Police Vest Plate', 10, 0, 1, 'Police Bulletproof Vest Plate'),
    ('vestplate_normal', 'Normal Vest Plate', 10, 0, 1, 'Normal Bulletproof Vest Plate');
```

</details>

<details>

<summary><strong>origen</strong></summary>

Add the following into:\
&#xNAN;_`origen_inventory\config\items.lua`_

```lua
['vest_police']         = {['name'] = 'vest_police',         ['label'] = 'Police Vest',          ['weight'] = 10, ['type'] = 'item', ['image'] = 'vest_police.png',         ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'New police bulletproof vest'},
['vest_normal']         = {['name'] = 'vest_normal',         ['label'] = 'Normal Vest',          ['weight'] = 10, ['type'] = 'item', ['image'] = 'vest_normal.png',         ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'New normal bulletproof vest'},
['vestplate_police']    = {['name'] = 'vestplate_police',    ['label'] = 'Police Vest Plate',    ['weight'] = 10, ['type'] = 'item', ['image'] = 'vestplate_police.png',    ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Police Bulletproof Vest Plate'},
['vestplate_normal']    = {['name'] = 'vestplate_normal',    ['label'] = 'Normal Vest Plate',    ['weight'] = 10, ['type'] = 'item', ['image'] = 'vestplate_normal.png',    ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Normal Bulletproof Vest Plate'},
```

</details>

<details>

<summary><strong>tgiann</strong></summary>

Add the following into:\
&#xNAN;_`items.lua in your framework script`_

```lua
vest_police           = {name = 'vest_police',           label = 'Police Vest',           weight = 10,   type = 'item',  image = 'vest_police.png',           unique = true,  useable = true,  shouldClose = true,  combinable = nil, description = 'New police bulletproof vest'},
vest_normal           = {name = 'vest_normal',           label = 'Normal Vest',           weight = 10,   type = 'item',  image = 'vest_normal.png',           unique = true,  useable = true,  shouldClose = true,  combinable = nil, description = 'New normal bulletproof vest'},
vestplate_police      = {name = 'vestplate_police',      label = 'Police Vest Plate',     weight = 10,   type = 'item',  image = 'vestplate_police.png',      unique = true,  useable = true,  shouldClose = true,  combinable = nil, description = 'Police Bulletproof Vest Plate'},
vestplate_normal      = {name = 'vestplate_normal',      label = 'Normal Vest Plate',     weight = 10,   type = 'item',  image = 'vestplate_normal.png',      unique = true,  useable = true,  shouldClose = true,  combinable = nil, description = 'Normal Bulletproof Vest Plate'},
```

</details>

5. Configure everything to your liking in [config.lua](config-file).\

6. Add the following into your database:

{% tabs %}
{% tab title="ESX" %}
```sql
ALTER TABLE `users` ADD COLUMN IF NOT EXISTS `armor` LONGTEXT DEFAULT NULL;
```
{% endtab %}

{% tab title="QB" %}
```sql
ALTER TABLE `players` ADD COLUMN IF NOT EXISTS `armor` LONGTEXT DEFAULT NULL;
```
{% endtab %}
{% endtabs %}

7. Restart your inventory script and start fivecode\_armor, or restart your server.\

8. Enjoy the script!\

9. \[Optional] If you want to have item images in your inventory, go into the folder bellow and copy the images into your inventory:\
   &#xNAN;_`fivecode_armor/Installation #9 - Images`_\
   \
   \- _`ox_inventory\web\images`_\
   \- _`qb-inventory\html\images`_\
   \- _`qs-inventory\html\images`_\
   \- _`ps-inventory\html\images`_\
   \- _`codem-inventory\html\itemimages`_\
   \- _`core_inventory\html\img`_\
   _- `origen_inventory\html\images`_\
   _- `tgiann-inventory\inventory_images/images`_

> If you need help with anything else, do not hesitate and open a support ticket in our [discord](https://discord.gg/Yf7GrHDuUr).
