# Installation

## 1. Download Resource

Download the purchased resource from [**CFX Portal**](https://portal.cfx.re/assets/granted-assets) - the official site of FiveM with purchased resources.

***

## 2. Import Database Tables

This is a very important step - without it, the script will not work properly.\
Depending on the framework you are using (ESX or QB-Core), select the appropriate section below and **paste the SQL code into your database**.

{% hint style="warning" %}

## Not sure how to do it?

No worries - we've prepared a short guide that shows you step by step how to import an SQL file into your database:\
👉 [**Click here to view the tutorial.**](/helpful/basic-server-knowledge/how-to-import-sql-to-database.md)
{% endhint %}

<details>

<summary>Database for ESX</summary>

```sql
ALTER TABLE users ADD COLUMN `tattoos` LONGTEXT DEFAULT NULL;

CREATE TABLE IF NOT EXISTS `vms_business` (
  `id` varchar(50) NOT NULL DEFAULT '',
  `type` varchar(50) NOT NULL DEFAULT '',
  `owner` mediumtext DEFAULT NULL,
  `employees` longtext DEFAULT '{}',
  `stock` longtext DEFAULT '{}',
  `data` longtext DEFAULT '{}',
  `announcements` longtext DEFAULT '{}',
  `orders` longtext DEFAULT '{}',
  `history` longtext DEFAULT '{}'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
```

</details>

<details>

<summary>Database for QB-Core</summary>

```sql
ALTER TABLE players ADD COLUMN `tattoos` LONGTEXT DEFAULT NULL;

CREATE TABLE IF NOT EXISTS `vms_business` (
  `id` varchar(50) NOT NULL DEFAULT '',
  `type` varchar(50) NOT NULL DEFAULT '',
  `owner` mediumtext DEFAULT NULL,
  `employees` longtext DEFAULT '{}',
  `stock` longtext DEFAULT '{}',
  `data` longtext DEFAULT '{}',
  `announcements` longtext DEFAULT '{}',
  `orders` longtext DEFAULT '{}',
  `history` longtext DEFAULT '{}'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
```

</details>

***

## 3. Add Required Items

The script uses its own items.\
Depending on what inventory you are using, select the appropriate section and add these items to either your item file or database.

<details>

<summary>Items for esx inventory</summary>

```sql
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES
    ("tattoo_machine", "Tattoo Machine", 10, 0, 1),
    ("tattoo_laser", "Tattoo Laser", 10, 0, 1),
    ("tattoo_ink", 'Tattoo Ink', 10, 0, 1);
```

</details>

<details>

<summary>Items for ox_inventory</summary>

```lua
['tattoo_machine'] = {
    label = 'Tattoo Machine',
    weight = 1,
    stack = true
},

['tattoo_laser'] = {
    label = 'Tattoo Laser',
    weight = 1,
    stack = true
},

['tattoo_ink'] = {
    label = 'Tattoo Ink',
    weight = 1,
    stack = true
}
```

</details>

<details>

<summary>Items for qb-inventory / qs-inventory / origen_inventory</summary>

```lua
['tattoo_machine'] = {
    ["name"] = 'tattoo_machine',
    ["label"] = "Tattoo Machine",
    ["weight"] = 10,
    ["type"] = "item",
    ["image"] = "tattoo_machine.png",
    ["unique"] = false,
    ["useable"] = true,
    ["shouldClose"] = false,
    ["combinable"] = nil,
    ["description"] = ""
},

['tattoo_laser'] = {
    ["name"] = 'tattoo_laser',
    ["label"] = "Tattoo Laser",
    ["weight"] = 10,
    ["type"] = "item",
    ["image"] = "tattoo_laser.png",
    ["unique"] = false,
    ["useable"] = true,
    ["shouldClose"] = false,
    ["combinable"] = nil,
    ["description"] = ""
},

['tattoo_ink'] = {
    ["name"] = 'tattoo_ink',
    ["label"] = "Tattoo Ink",
    ["weight"] = 10,
    ["type"] = "item",
    ["image"] = "tattoo_ink.png",
    ["unique"] = false,
    ["useable"] = true,
    ["shouldClose"] = false,
    ["combinable"] = nil,
    ["description"] = ""
},
```

</details>

***

## 4. Register Jobs

Some functions work only if the player has a proper job.\
In this section, you will find ready-made job that you need to add in your framework (ESX/QB).

<details>

<summary>Jobs for ESX</summary>

```sql
INSERT INTO `jobs` (name, label) VALUES
    ('tattoo1', 'Tattoo Shop (1)'),
    ('tattoo2', 'Tattoo Shop (2)'),
    ('tattoo3', 'Tattoo Shop (3)'),
    ('tattoo4', 'Tattoo Shop (4)'),
    ('tattoo5', 'Tattoo Shop (5)'),
    ('tattoo6', 'Tattoo Shop (6)');

INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES
    ('tattoo1', 0, 'trainee', 'Trainee', 150, '{}', '{}'),
    ('tattoo1', 1, 'employee', 'Employee', 200, '{}', '{}'),
    ('tattoo1', 2, 'manager', 'Manager', 300, '{}', '{}'),
    ('tattoo1', 3, 'boss', 'Boss', 350, '{}', '{}'),
    ('tattoo2', 0, 'trainee', 'Trainee', 150, '{}', '{}'),
    ('tattoo2', 1, 'employee', 'Employee', 200, '{}', '{}'),
    ('tattoo2', 2, 'manager', 'Manager', 300, '{}', '{}'),
    ('tattoo2', 3, 'boss', 'Boss', 350, '{}', '{}'),
    ('tattoo3', 0, 'trainee', 'Trainee', 150, '{}', '{}'),
    ('tattoo3', 1, 'employee', 'Employee', 200, '{}', '{}'),
    ('tattoo3', 2, 'manager', 'Manager', 300, '{}', '{}'),
    ('tattoo3', 3, 'boss', 'Boss', 350, '{}', '{}'),
    ('tattoo4', 0, 'trainee', 'Trainee', 150, '{}', '{}'),
    ('tattoo4', 1, 'employee', 'Employee', 200, '{}', '{}'),
    ('tattoo4', 2, 'manager', 'Manager', 300, '{}', '{}'),
    ('tattoo4', 3, 'boss', 'Boss', 350, '{}', '{}'),
    ('tattoo5', 0, 'trainee', 'Trainee', 150, '{}', '{}'),
    ('tattoo5', 1, 'employee', 'Employee', 200, '{}', '{}'),
    ('tattoo5', 2, 'manager', 'Manager', 300, '{}', '{}'),
    ('tattoo5', 3, 'boss', 'Boss', 350, '{}', '{}'),
    ('tattoo6', 0, 'trainee', 'Trainee', 150, '{}', '{}'),
    ('tattoo6', 1, 'employee', 'Employee', 200, '{}', '{}'),
    ('tattoo6', 2, 'manager', 'Manager', 300, '{}', '{}'),
    ('tattoo6', 3, 'boss', 'Boss', 350, '{}', '{}');
```

</details>

<details>

<summary>Jobs for QB-Core</summary>

```lua
['tattoo1'] = {
    label = 'Tattoo Shop (1)',
    defaultDuty = true,
    offDutyPay = false,
    grades = {
        ['0'] = {
            name = 'recruit',
            payment = 50
        },
        ['1'] = {
            name = 'employee',
            payment = 250
        },
        ['2'] = {
            name = 'manager',
            payment = 250,
        },
        ['3'] = {
            name = 'boss',
            payment = 250,
        },
    },
},
['tattoo2'] = {
    label = 'Tattoo Shop (2)',
    defaultDuty = true,
    offDutyPay = false,
    grades = {
        ['0'] = {
            name = 'recruit',
            payment = 50
        },
        ['1'] = {
            name = 'employee',
            payment = 250
        },
        ['2'] = {
            name = 'manager',
            payment = 250,
        },
        ['3'] = {
            name = 'boss',
            payment = 250,
        },
    },
},
['tattoo3'] = {
    label = 'Tattoo Shop (3)',
    defaultDuty = true,
    offDutyPay = false,
    grades = {
        ['0'] = {
            name = 'recruit',
            payment = 50
        },
        ['1'] = {
            name = 'employee',
            payment = 250
        },
        ['2'] = {
            name = 'manager',
            payment = 250,
        },
        ['3'] = {
            name = 'boss',
            payment = 250,
        },
    },
},
['tattoo4'] = {
    label = 'Tattoo Shop (4)',
    defaultDuty = true,
    offDutyPay = false,
    grades = {
        ['0'] = {
            name = 'recruit',
            payment = 50
        },
        ['1'] = {
            name = 'employee',
            payment = 250
        },
        ['2'] = {
            name = 'manager',
            payment = 250,
        },
        ['3'] = {
            name = 'boss',
            payment = 250,
        },
    },
},
['tattoo5'] = {
    label = 'Tattoo Shop (5)',
    defaultDuty = true,
    offDutyPay = false,
    grades = {
        ['0'] = {
            name = 'recruit',
            payment = 50
        },
        ['1'] = {
            name = 'employee',
            payment = 250
        },
        ['2'] = {
            name = 'manager',
            payment = 250,
        },
        ['3'] = {
            name = 'boss',
            payment = 250,
        },
    },
},
['tattoo6'] = {
    label = 'Tattoo Shop (6)',
    defaultDuty = true,
    offDutyPay = false,
    grades = {
        ['0'] = {
            name = 'recruit',
            payment = 50
        },
        ['1'] = {
            name = 'employee',
            payment = 250
        },
        ['2'] = {
            name = 'manager',
            payment = 250,
        },
        ['3'] = {
            name = 'boss',
            payment = 250,
        },
    },
},

```

</details>

***

## 5. Start Resource

To start a resource in your `server.cfg`, ensure that it begins after your framework has been initiated. For instance, if you are using a framework like `es_extended`, you should start resource after it, like so:

```python
start [core] # For example, here is your framework (esx/qb-core)

# Here you run your other resources like esx_policejob etc.

# VMS Resources
start vms_tattooshop
```

Ensure there are no syntax errors or incorrect paths in your `server.cfg`.


---

# 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://docs.vames-store.com/assets/vms_tattooshop/installation.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.
