# Tutorials

[I am missing sql file how to add armor column into my users table in my database?](#id-1)

[How to undress a vest from a player?](#id-2)

[How to steal a player's armor and transfer it to the thief from another script?](#id-3)

[How to check if player has vest from another script?](#id-4)

[How to create new vests?](#id-5)

[How to create new vest plate?](#id-6)

#### 1.

{% hint style="info" %}
**How to add armor column into your users table in your database?**
{% endhint %}

{% 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 %}

***

#### 2.

{% hint style="info" %}
**Remove player vest:**
{% endhint %}

{% tabs %}
{% tab title="Client" %}

```lua
exports.fivecode_armor:RemoveVest()
```

{% endtab %}

{% tab title="Server" %}

```lua
-- 1: Player source
exports.fivecode_armor:RemoveVest(source)
```

{% endtab %}
{% endtabs %}

***

#### **3.**

{% hint style="info" %}
**Steal player vest:**
{% endhint %}

```lua
-- 1: Player source
-- 2: Second player source
-- 3: Animation - (true/false)
exports.fivecode_armor:UndressVest(sourceFor, sourceFrom, anim)
```

***

#### 4.

{% hint style="info" %}
**How to check if player has vest in another script?**
{% endhint %}

```lua
-- 1: Player source
exports.fivecode_armor:HasVest(source)
```

***

#### 5.

{% hint style="info" %}
**How to create new vests?**
{% endhint %}

1. Create new vest in[ config.lua](https://fivecode.gitbook.io/docs/scripts/fivecode-armor/config-file):\
   \- To create a new vest, simply duplicate an existing one from the config for easier setup.<br>

   <pre class="language-lua"><code class="lang-lua">Config.Vests = {
       ['vest_police'] = {
           label = 'Police Vest',
           maxArmor = 100,
           clothing = {
               use = true,
               male = {number = 4, color = 1},
               female = {number = 3, color = 1},
           },
           jobWhitelist = {'police', 'sheriff', 'fbi'},
           jobBlacklist = {},
       },
       ['vest_normal'] = {
           label = 'Normal Vest',
           maxArmor = 80,
           clothing = {
               use = true,
               male = {number = 4, color = 2},
               female = {number = 1, color = 2},
           },
           jobWhitelist = {},
           jobBlacklist = {},
       },
   <strong>    ['vest_example'] = {
   </strong><strong>        label = 'Example Vest',
   </strong><strong>        maxArmor = 50,
   </strong><strong>        clothing = {
   </strong><strong>            use = true,
   </strong><strong>            male = {number = 4, color = 3},
   </strong><strong>            female = {number = 1, color = 3},
   </strong><strong>        },
   </strong><strong>        jobWhitelist = {},
   </strong><strong>        jobBlacklist = {},
   </strong><strong>    },
   </strong>}
   </code></pre>
2. Create a new item with your vests name in your inventory:\
   \- In this example it will be *vest\_example.*\
   \- Look into [Installation Guide](https://fivecode.gitbook.io/docs/scripts/fivecode-armor/installation-guide) if you need help with creating items for your inventory.
3. Enjoy!

***

#### 6.

{% hint style="info" %}
**How to create new vest plates?**
{% endhint %}

1. Create new vest in[ config.lua](https://fivecode.gitbook.io/docs/scripts/fivecode-armor/config-file):\
   \- To create a new vest plate, simply duplicate an existing one from the config for easier setup.<br>

<pre class="language-lua"><code class="lang-lua">Config.Plates = {
    ['vestplate_police'] = {
        strength = 10,
    },
    ['vestplate_normal'] = {
        strength = 5,
    },
<strong>    ['vestplate_example'] = {
</strong><strong>        strength = 2,
</strong><strong>    },
</strong>}
</code></pre>

2. Create a new item with your vests plate name in your inventory:\
   \- In this example it will be *vestplate\_example.*\
   \- Look into [Installation Guide](https://fivecode.gitbook.io/docs/scripts/fivecode-armor/installation-guide) if you need help with creating items for your inventory.
3. Enjoy!

***

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