# 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. Install Required Dependencies

This script needs a few extra resources to work properly.\
Below you will find a list of things to download - click the link, download and upload to your server just like other resources.

<table><thead><tr><th width="153.21820068359375">Resource</th><th width="395.5999755859375" data-type="content-ref">Download Link</th><th>Note</th></tr></thead><tbody><tr><td><strong>spawnmanager</strong></td><td><a href="https://github.com/citizenfx/cfx-server-data/tree/master/resources/[managers]/spawnmanager">https://github.com/citizenfx/cfx-server-data/tree/master/resources/%5Bmanagers%5D/spawnmanager</a></td><td><strong>Only for ESX users!</strong></td></tr></tbody></table>

***

## 3. 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.**](https://docs.vames-store.com/helpful/basic-server-knowledge/how-to-import-sql-to-database)
{% endhint %}

<details>

<summary>Database for ESX</summary>

```sql
CREATE TABLE `multichars_slots` (
    `identifier` VARCHAR(60) NOT NULL,
    `slots` INT(11) NOT NULL,
    PRIMARY KEY (`identifier`) USING BTREE,
    INDEX `slots` (`slots`) USING BTREE
) ENGINE=InnoDB;
```

You should already have a disabled column in your users, but in case you don't, you need to import it as well.

```sql
ALTER TABLE `users` ADD COLUMN `disabled` TINYINT(1) NULL DEFAULT '0';
```

</details>

<details>

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

```sql
CREATE TABLE `multichars_slots` (
    `identifier` VARCHAR(60) NOT NULL,
    `slots` INT(11) NOT NULL,
    PRIMARY KEY (`identifier`) USING BTREE,
    INDEX `slots` (`slots`) USING BTREE
) ENGINE=InnoDB;

ALTER TABLE `players` ADD COLUMN `disabled` TINYINT(1) NULL DEFAULT '0';
```

</details>

***

## 4. Environment Requirements

{% stepper %}
{% step %}

### Remove conflict scripts

Remove your previous multicharacter and identity system, e.g. esx\_multicharacter, esx\_identity, qb-multicharacter, qbx-multicharacter.
{% endstep %}

{% step %}

### Make changes to external resources

{% tabs %}
{% tab title="ESX" %}
{% hint style="warning" %}
If you are using an older ESX like 1.8.X, 1.9.X the configuration file path is **es\_extended/config.lua**
{% endhint %}

1. Go to your **es\_extended/shared/config/main.lua** file.
2. Find options `Config.Multichar` and `Config.Identity`
3. Set both parameters to `true`:

```lua
Config.Multichar = true
Config.Identity = true
```

These settings enable multi-character functionality and user identity management, ensuring compatibility with the new system architecture.
{% endtab %}

{% tab title="QBX-Core" %}

1. Go to your **qbx\_core/config.lua** file.
2. Find option `Config.Characters.UseExternalCharacters`
3. Set parameter to `true`:

```lua
Config.Characters.UseExternalCharacters = true
```

{% endtab %}
{% endtabs %}
{% endstep %}
{% endstepper %}

***

## 4. 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)

# VMS Resources
start vms_multichars
start vms_identity
```

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_multichars/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.
