# esx\_multicharacter OLD

{% hint style="warning" %}
This is integration for the old version of esx\_multicharacter (<1.10.9)

If this integration does not match your esx\_multicharacter version, please try the [new one](https://documentation.rcore.cz/paid-resources/rcore_clothing/impl/esx_multicharacter).
{% endhint %}

### Step 1

Open file `esx_multicharacter/server/main.lua` and find `characters[id] = {` (inside function `SetupCharacters`)

Paste the following code **above** it.

```lua
if GetResourceState("rcore_clothing") == "started" then
    if v then
      v.skin = json.encode(exports["rcore_clothing"]:getSkinByIdentifier(v.identifier))
    elseif result and i and result[i] then
      result[i].skin = json.encode(exports["rcore_clothing"]:getSkinByIdentifier(result[i].identifier))
    else
      print("ERROR: Unknown version of multichar")
    end
end
```

Now it should look like the following image:

![](https://1037498771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MZErcztD5BvrKnwRGJq%2Fuploads%2Fgit-blob-f7d4caf35ad63c32316e2f8c2fc789319e6f734e%2Fesxmulti.png?alt=media)

### Step 2

Open file `esx_multicharacter/client/main.lua` and find `TriggerEvent("skinchanger:loadSkin", skin)` (inside function `SetupCharacter`)

Replace the line with the following code:

```lua
if Characters[index].skin then
    exports["rcore_clothing"]:setPlayerSkin(skin)
else
    TriggerEvent("skinchanger:loadSkin", skin)
end
```

Now it should look like the following image:

![](https://1037498771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MZErcztD5BvrKnwRGJq%2Fuploads%2Fgit-blob-55f7358d16de12f55a04d209a5c9076cbdbad556%2Fesxmulti2.png?alt=media)

### Step 3

In the same file as step 2 (`esx_multicharacter/client/main.lua`), find `TriggerEvent("skinchanger:loadSkin", Characters[index].skin)` (inside function `SetupCharacter`)

Replace the line with the following code:

```lua
exports["rcore_clothing"]:setPlayerSkin(Characters[index].skin)
```

Now it should look like the following image:

![](https://1037498771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MZErcztD5BvrKnwRGJq%2Fuploads%2Fgit-blob-6b17c47151a3da2821a4318b2369d39143f01b26%2Fesxmulti3.png?alt=media)

### Step 4

Open file `esx_multicharacter/server/main.lua` and find `local DB_TABLES`.

Now add these entries to the DB\_TABLES variable:

```lua
["rcore_clothing_current"] = "identifier",
["rcore_clothing_purchased"] = "identifier",
["rcore_clothing_outfits"] = "identifier",
```

Now it should look something like this (don't copy this, you may have other existing tables defined, this is just an example):

```lua
local DB_TABLES = { users = "identifier", ["rcore_clothing_current"] = "identifier", ["rcore_clothing_purchased"] = "identifier", ["rcore_clothing_outfits"] = "identifier", }
```
