Multicharacter - Character Selection
Step by step installation guide, common issues & solutions, troubleshooting guide, code snippets, common error codes, config previews, locales previews and changelogs; all in 1 easily accessible place
Buy Here
This resource can be purchased as part of a bundle for a discount here.

Translate

START HERE

1. Unzip the cd_multicharacter.zip and place this folder in your servers resource folder.
2. Add the resource to your server start config: ensure cd_multicharacter (it must be placed anywhere below your framework resource eg., es_extended, not above). The name of the folder must not be changed or the resource will not function correctly.
3. WARNING do not edit the obfuscated files in any way.

INSTALLATION GUIDE

Step 1 - Install the SQL

You MUST import the SQL file to your database. This SQL file is located inside theREAD_ME_AFTER_PURCHASING folder, the file is named SQL_main.sql. Watch this video if you are unsure how to do this HeidiSQL / PHPMyAdmin.

Step 2 - Fxmanifest

You may need to make some changes to the fxmanifest.lua, depending on your framework and dependencies. We have made this easier for you by commenting on the lines which you may need to change.

Step 3 - Configure the resource

You MUST read all of the configurable options inside the config.lua and configure them to suit your server's needs. Please read the ”commented out help text” at the end of each line so you can understand what each config option does.
The most important sections are the options under the Framework and Important sections at the top of the config.lua. Everything else is optional.

Step 4 - Install the dependencies

Open the dependencies folder. The sub-folders inside will be the required dependencies. There will be a text file inside each sub-folder which includes a GitHub link. Download the dependencies from our GitHub using the links provided. Then add it to your resources folder.

Step 5 - ESX Client Edit

We need to do a small modification to stop your framework registering our character instantly when we load into the server.
ESX version 1.1
ESX version 1.2
ESX version 1.final
Extendedmode
ESX Legacy 1.3.x
ESX Legacy 1.6.x
essentialmode/client/main.lua/line 5 - comment out this code.
If your fxmanifest.lua says you are using version 1.2, you need to confirm your version.
If you think you are using esx 1.2 please double-check and compare the code from these snippets, as in both esx 1.2 and esx 1.final say version 1.2 in the fxmanifest.lua. But in fact, the 2 versions are different and will cause major problems during installation if the wrong version is chosen in the config.lua of the multicharacter.
es_extended/client/main.lua/line 36 - comment out this code.
If your fxmanifest.lua says you are using version 1.2, you need to confirm your version.
If you think you are using esx 1.2 please double-check and compare the code from these snippets, as in both esx 1.2 and esx 1.final both say version 1.2 in the fxmanifest.lua. But in fact, the 2 versions are different and will cause major problems during installation if the wrong version is chosen in the config of the multicharacter.
es_extended/client/main.lua/line 3 - comment out this code.
extendedmode/client/main.lua/line 3 - comment out this code.
Make sure the Config.Multichar in es_extended’s config.lua is set to false.
es_extended/client/main.lua/line 3 - comment out this code.
Make sure the Config.Multichar in es_extended’s config.lua is set to false.
es_extended/client/main.lua/line 3 - comment out this code.

Step 6 - Player Skin Edit

We will be setting the skin of your chosen character directly from the cd_multicharacter or cd_identity, so we don't need your skin creator script to do this also.
esx_skin
cui_character
betrayed_clothing
Part 1: Find the block of code that looks similar to the examples below in the client-side main.lua and comment out the code.
There are many different versions and not all will look the exact same.
View the examples below:
Example 1
Example 2
Part 1: Find the block of code below in the client-side main.lua and hash out/delete it This event can normally be found on on line 544. View the example.
Part 2: Copy and paste this block of code below into your cui_character script, anywhere in the client-side main.lua.
1
AddEventHandler('cui_character:SetPedClothes_multi')
2
RegisterNetEvent('cui_character:SetPedClothes_multi', function(new_character, skin)
3
playerLoaded = true
4
if new_character then
5
oldChar = GetDefaultCharacter(true)
6
LoadCharacter(oldChar)
7
TriggerEvent('cui_character:open', { 'identity', 'features', 'style', 'apparel' }, false)
8
else
9
oldLoadout = GetLoadout()
10
oldChar = skin
11
LoadCharacter(skin)
12
end
13
preparingSkin = false
14
end)
Copied!
No changes needed.

Step 7 - Multi-Peds Skin Edit

Now we need to copy and paste some code into your character skin creation script so we can set the skin of the peds. Currently, we support 3 different clothing scripts, although we have 2 different methods for esx_skin as the first supports older versions and the second supports newer versions, but always try the older version first.
esx_skin (older versions)
esx_skin (newer versions)
cui_character
betrayed_clothing
If you use esx_skin, use this version first.
Part 1 - Copy and paste this export below into your skinchanger script, anywhere in the client-side main.lua.
1
exports('GetPedList', function()
2
return pedList
3
end)
Copied!
Part 2 - Copy and paste this block of code below into your skinchanger script, at the very bottom of the client-side main.lua.
1
RegisterNetEvent('skinchanger:loadSkin2')
2
AddEventHandler('skinchanger:loadSkin2', function(multipedID, skin)
3
local MultiPed = {}
4
for i=1, #Components, 1 do
5
MultiPed[Components[i].name] = Components[i].value
6
end
7
for k,v in pairs(skin) do
8
MultiPed[k] = v
9
end
10
11
SetPedHeadBlendData (multipedID, MultiPed['face'], MultiPed['face'], MultiPed['face'], MultiPed['skin'], MultiPed['skin'], MultiPed['skin'], 1.0, 1.0, 1.0, true)
12
13
SetPedHairColor (multipedID, MultiPed['hair_color_1'], MultiPed['hair_color_2']) -- Hair Color
14
SetPedHeadOverlay (multipedID, 3, MultiPed['age_1'], (MultiPed['age_2'] / 10) + 0.0) -- Age + opacity
15
SetPedHeadOverlay (multipedID, 0, MultiPed['blemishes_1'], (MultiPed['blemishes_2'] / 10) + 0.0) -- Blemishes + opacity
16
SetPedHeadOverlay (multipedID, 1, MultiPed['beard_1'], (MultiPed['beard_2'] / 10) + 0.0) -- Beard + opacity
17
SetPedEyeColor (multipedID, MultiPed['eye_color'], 0, 1) -- Eyes color
18
SetPedHeadOverlay (multipedID, 2, MultiPed['eyebrows_1'], (MultiPed['eyebrows_2'] / 10) + 0.0) -- Eyebrows + opacity
19
SetPedHeadOverlay (multipedID, 4, MultiPed['makeup_1'], (MultiPed['makeup_2'] / 10) + 0.0) -- Makeup + opacity
20
SetPedHeadOverlay (multipedID, 8, MultiPed['lipstick_1'], (MultiPed['lipstick_2'] / 10) + 0.0) -- Lipstick + opacity
21
SetPedComponentVariation (multipedID, 2, MultiPed['hair_1'], MultiPed['hair_2'], 2) -- Hair
22
SetPedHeadOverlayColor (multipedID, 1, 1, MultiPed['beard_3'], MultiPed['beard_4']) -- Beard Color
23
SetPedHeadOverlayColor (multipedID, 2, 1, MultiPed['eyebrows_3'], MultiPed['eyebrows_4']) -- Eyebrows Color
24
SetPedHeadOverlayColor (multipedID, 4, 1, MultiPed['makeup_3'], MultiPed['makeup_4']) -- Makeup Color
25
SetPedHeadOverlayColor (multipedID, 8, 1, MultiPed['lipstick_3'], MultiPed['lipstick_4']) -- Lipstick Color
26
SetPedHeadOverlay (multipedID, 5, MultiPed['blush_1'], (MultiPed['blush_2'] / 10) + 0.0) -- Blush + opacity
27
SetPedHeadOverlayColor (multipedID, 5, 2, MultiPed['blush_3']) -- Blush Color
28
SetPedHeadOverlay (multipedID, 6, MultiPed['complexion_1'], (MultiPed['complexion_2'] / 10) + 0.0) -- Complexion + opacity
29
SetPedHeadOverlay (multipedID, 7, MultiPed['sun_1'], (MultiPed['sun_2'] / 10) + 0.0) -- Sun Damage + opacity
30
SetPedHeadOverlay (multipedID, 9, MultiPed['moles_1'], (MultiPed['moles_2'] / 10) + 0.0) -- Moles/Freckles + opacity
31
SetPedHeadOverlay (multipedID, 10, MultiPed['chest_1'], (MultiPed['chest_2'] / 10) + 0.0) -- Chest Hair + opacity
32
SetPedHeadOverlayColor (multipedID, 10, 1, MultiPed['chest_3']) -- Torso Color
33
SetPedHeadOverlay (multipedID, 11, MultiPed['bodyb_1'], (MultiPed['bodyb_2'] / 10) + 0.0) -- Body Blemishes + opacity
34
35
if MultiPed['ears_1'] == -1 then
36
ClearPedProp(multipedID, 2)
37
else
38
SetPedPropIndex (multipedID, 2, MultiPed['ears_1'], MultiPed['ears_2'], 2) -- Ears Accessories
39
end
40
41
SetPedComponentVariation (multipedID, 8, MultiPed['tshirt_1'], MultiPed['tshirt_2'], 2) -- Tshirt
42
SetPedComponentVariation (multipedID, 11, MultiPed['torso_1'], MultiPed['torso_2'], 2) -- torso parts
43
SetPedComponentVariation (multipedID, 3, MultiPed['arms'], MultiPed['arms_2'], 2) -- Amrs
44
SetPedComponentVariation (multipedID, 10, MultiPed['decals_1'], MultiPed['decals_2'], 2) -- decals
45
SetPedComponentVariation (multipedID, 4, MultiPed['pants_1'], MultiPed['pants_2'], 2) -- pants
46
SetPedComponentVariation (multipedID, 6, MultiPed['shoes_1'], MultiPed['shoes_2'], 2) -- shoes
47
SetPedComponentVariation (multipedID, 1, MultiPed['mask_1'], MultiPed['mask_2'], 2) -- mask
48
SetPedComponentVariation (multipedID, 9, MultiPed['bproof_1'], MultiPed['bproof_2'], 2) -- bulletproof
49
SetPedComponentVariation (multipedID, 7, MultiPed['chain_1'], MultiPed['chain_2'], 2) -- chain
50
SetPedComponentVariation (multipedID, 5, MultiPed['bags_1'], MultiPed['bags_2'], 2) -- Bag
51
52
if MultiPed['helmet_1'] == -1 then
53
ClearPedProp(multipedID, 0)
54
else
55
SetPedPropIndex (multipedID, 0, MultiPed['helmet_1'], MultiPed['helmet_2'], 2) -- Helmet
56
end
57
58
if MultiPed['glasses_1'] == -1 then
59
ClearPedProp(multipedID, 1)
60
else
61
SetPedPropIndex (multipedID, 1, MultiPed['glasses_1'], MultiPed['glasses_2'], 2) -- Glasses
62
end
63
64
if MultiPed['watches_1'] == -1 then
65
ClearPedProp(multipedID, 6)
66
else
67
SetPedPropIndex (multipedID, 6, MultiPed['watches_1'], MultiPed['watches_2'], 2) -- Watches
68
end
69
70
if MultiPed['bracelets_1'] == -1 then
71
ClearPedProp(multipedID, 7)
72
else
73
SetPedPropIndex (multipedID, 7, MultiPed['bracelets_1'], MultiPed['bracelets_2'], 2) -- Bracelets
74
end
75
MultiPed = nil
76
end)
Copied!
If you use esx_skin and the first version showed errors in f8 from skinchanger related to blemishes, use this version instead.
Part 1: Copy and paste this export below into your skinchanger script, anywhere in the client-side main.lua.
1
exports('GetPedList', function()
2
return pedList
3
end)
Copied!
Part 2: Copy and paste this block of code below into your skinchanger script, at the very bottom of the client-side main.lua.
1
RegisterNetEvent('skinchanger:loadSkin2')
2
AddEventHandler('skinchanger:loadSkin2', function(multipedID, skin)
3
local MultiPed = {}
4
for i=1, #Components, 1 do
5
MultiPed[Components[i].name] = Components[i].value
6
end
7
for k,v in pairs(skin) do
8
MultiPed[k] = v
9
end
10
11
SetPedHeadBlendData (multipedID, MultiPed['face'], MultiPed['face'], MultiPed['face'], MultiPed['skin'], MultiPed['skin'], MultiPed['skin'], 1.0, 1.0, 1.0, true)
12
13
SetPedHairColor (multipedID, MultiPed['hair_color_1'], MultiPed['hair_color_2']) -- Hair Color
14
SetPedHeadOverlay (multipedID, 3, MultiPed['age_1'], (MultiPed['age_2'] / 10) + 0.0) -- Age + opacity
15
SetPedHeadOverlay (multipedID, 1, MultiPed['beard_1'], (MultiPed['beard_2'] / 10) + 0.0) -- Beard + opacity
16
SetPedEyeColor (multipedID, MultiPed['eye_color'], 0, 1) -- Eyes color
17
SetPedHeadOverlay (multipedID, 2, MultiPed['eyebrows_1'], (MultiPed['eyebrows_2'] / 10) + 0.0) -- Eyebrows + opacity
18
SetPedHeadOverlay (multipedID, 4, MultiPed['makeup_1'], (MultiPed['makeup_2'] / 10) + 0.0) -- Makeup + opacity
19
SetPedHeadOverlay (multipedID, 8, MultiPed['lipstick_1'], (MultiPed['lipstick_2'] / 10) + 0.0) -- Lipstick + opacity
20
SetPedComponentVariation (multipedID, 2, MultiPed['hair_1'], MultiPed['hair_2'], 2) -- Hair
21
SetPedHeadOverlayColor (multipedID, 1, 1, MultiPed['beard_3'], MultiPed['beard_4']) -- Beard Color
22
SetPedHeadOverlayColor (multipedID, 2, 1, MultiPed['eyebrows_3'], MultiPed['eyebrows_4']) -- Eyebrows Color
23
SetPedHeadOverlayColor (multipedID, 4, 1, MultiPed['makeup_3'], MultiPed['makeup_4']) -- Makeup Color
24
SetPedHeadOverlayColor (multipedID, 8, 1, MultiPed['lipstick_3'], MultiPed['lipstick_4']) -- Lipstick Color
25
SetPedHeadOverlay (multipedID, 5, MultiPed['blush_1'], (MultiPed['blush_2'] / 10) + 0.0) -- Blush + opacity
26
SetPedHeadOverlayColor (multipedID, 5, 2, MultiPed['blush_3']) -- Blush Color
27
SetPedHeadOverlay (multipedID, 9, MultiPed['moles_1'], (MultiPed['moles_2'] / 10) + 0.0) -- Moles/Freckles + opacity
28
SetPedHeadOverlay (multipedID, 10, MultiPed['chest_1'], (MultiPed['chest_2'] / 10) + 0.0) -- Chest Hair + opacity
29
SetPedHeadOverlayColor (multipedID, 10, 1, MultiPed['chest_3']) -- Torso Color
30
31
if MultiPed['ears_1'] == -1 then
32
ClearPedProp(multipedID, 2)
33
else
34
SetPedPropIndex (multipedID, 2, MultiPed['ears_1'], MultiPed['ears_2'], 2) -- Ears Accessories
35
end
36
37
SetPedComponentVariation (multipedID, 8, MultiPed['tshirt_1'], MultiPed['tshirt_2'], 2) -- Tshirt
38
SetPedComponentVariation (multipedID, 11, MultiPed['torso_1'], MultiPed['torso_2'], 2) -- torso parts
39
SetPedComponentVariation (multipedID, 3, MultiPed['arms'], MultiPed['arms_2'], 2) -- Amrs
40
SetPedComponentVariation (multipedID, 10, MultiPed['decals_1'], MultiPed['decals_2'], 2) -- decals
41
SetPedComponentVariation (multipedID, 4, MultiPed['pants_1'], MultiPed['pants_2'], 2) -- pants
42
SetPedComponentVariation (multipedID, 6, MultiPed['shoes_1'], MultiPed['shoes_2'], 2) -- shoes
43
SetPedComponentVariation (multipedID, 1, MultiPed['mask_1'], MultiPed['mask_2'], 2) -- mask
44
SetPedComponentVariation (multipedID, 9, MultiPed['bproof_1'], MultiPed['bproof_2'], 2) -- bulletproof
45
SetPedComponentVariation (multipedID, 7, MultiPed['chain_1'], MultiPed['chain_2'], 2) -- chain
46
SetPedComponentVariation (multipedID, 5, MultiPed['bags_1'], MultiPed['bags_2'], 2) -- Bag
47
48
if MultiPed['helmet_1'] == -1 then
49
ClearPedProp(multipedID, 0)
50
else
51
SetPedPropIndex (multipedID, 0, MultiPed['helmet_1'], MultiPed['helmet_2'], 2) -- Helmet
52
end
53
54
if MultiPed['glasses_1'] == -1 then
55
ClearPedProp(multipedID, 1)
56
else
57
SetPedPropIndex (multipedID, 1, MultiPed['glasses_1'], MultiPed['glasses_2'], 2) -- Glasses
58
end
59
60
if MultiPed['watches_1'] == -1 then
61
ClearPedProp(multipedID, 6)
62
else
63
SetPedPropIndex (multipedID, 6, MultiPed['watches_1'], MultiPed['watches_2'], 2) -- Watches
64
end
65
66
if MultiPed['bracelets_1'] == -1 then
67
ClearPedProp(multipedID, 7)
68
else
69
SetPedPropIndex (multipedID, 7, MultiPed['bracelets_1'], MultiPed['bracelets_2'], 2) -- Bracelets
70
end
71
72
SetPedFaceFeature(multipedID, 0, MultiPed['nose_width'])
73
SetPedFaceFeature(multipedID, 1, MultiPed['nose_peak_hight'])
74
SetPedFaceFeature(multipedID, 2, MultiPed['nose_peak_lenght'])
75
SetPedFaceFeature(multipedID, 3, MultiPed['nose_bone_high'])
76
SetPedFaceFeature(multipedID, 4, MultiPed['nose_peak_lowering'])
77
SetPedFaceFeature(multipedID, 5, MultiPed['nose_bone_twist'])
78
SetPedFaceFeature(multipedID, 6, MultiPed['eyebrown_high'])
79
SetPedFaceFeature(multipedID, 7, MultiPed['eyebrown_forward'])
80
SetPedFaceFeature(multipedID, 8, MultiPed['cheeks_bone_high'])
81
SetPedFaceFeature(multipedID, 9, MultiPed['cheeks_bone_width'])
82
SetPedFaceFeature(multipedID, 10, MultiPed['cheeks_width'])
83
SetPedFaceFeature(multipedID, 11, MultiPed['eyes_openning'])
84
SetPedFaceFeature(multipedID, 12, MultiPed['lips_thickness'])
85
SetPedFaceFeature(multipedID, 13, MultiPed['jaw_bone_width'])
86
SetPedFaceFeature(multipedID, 14, MultiPed['jaw_bone_back_lenght'])
87
88
SetPedFaceFeature(multipedID, 15, MultiPed['chimp_bone_lowering'])
89
SetPedFaceFeature(multipedID, 16, MultiPed['chimp_bone_lenght'])
90
SetPedFaceFeature(multipedID, 17, MultiPed['chimp_bone_width'])
91
SetPedFaceFeature(multipedID, 18, MultiPed['chimp_hole'])
92
SetPedFaceFeature(multipedID, 19, MultiPed['neck_thikness'])
93
MultiPed = nil
94
end)
Copied!
Part 1 - Copy and paste this block of code below into your cui_character script, at the very bottom of the client-side main.lua.
1
RegisterNetEvent('cui_character:MultiCharSkin')
2
AddEventHandler('cui_character:MultiCharSkin', function(multipedID, data)
3
-- Face Blend
4
local weightFace = data.face_md_weight / 100 + 0.0
5
local weightSkin = data.skin_md_weight / 100 + 0.0
6
SetPedHeadBlendData(multipedID, data.mom, data.dad, 0, data.mom, data.dad, 0, weightFace, weightSkin, 0.0, false)
7
8
-- Facial Features
9
SetPedFaceFeature(multipedID, 0, (data.nose_1 / 100) + 0.0) -- Nose Width
10
SetPedFaceFeature(multipedID, 1, (data.nose_2 / 100) + 0.0) -- Nose Peak Height
11
SetPedFaceFeature(multipedID, 2, (data.nose_3 / 100) + 0.0) -- Nose Peak Length
12
SetPedFaceFeature(multipedID, 3, (data.nose_4 / 100) + 0.0) -- Nose Bone Height
13
SetPedFaceFeature(multipedID, 4, (data.nose_5 / 100) + 0.0) -- Nose Peak Lowering
14
SetPedFaceFeature(multipedID, 5, (data.nose_6 / 100) + 0.0) -- Nose Bone Twist
15
SetPedFaceFeature(multipedID, 6, (data.eyebrows_5 / 100) + 0.0) -- Eyebrow height
16
SetPedFaceFeature(multipedID, 7, (data.eyebrows_6 / 100) + 0.0) -- Eyebrow depth
17
SetPedFaceFeature(multipedID, 8, (data.cheeks_1 / 100) + 0.0) -- Cheekbones Height
18
SetPedFaceFeature(multipedID, 9, (data.cheeks_2 / 100) + 0.0) -- Cheekbones Width
19
SetPedFaceFeature(multipedID, 10, (data.cheeks_3 / 100) + 0.0) -- Cheeks Width
20
SetPedFaceFeature(multipedID, 11, (data.eye_squint / 100) + 0.0) -- Eyes squint
21
SetPedFaceFeature(multipedID, 12, (data.lip_thickness / 100) + 0.0) -- Lip Fullness
22
SetPedFaceFeature(multipedID, 13, (data.jaw_1 / 100) + 0.0) -- Jaw Bone Width
23
SetPedFaceFeature(multipedID, 14, (data.jaw_2 / 100) + 0.0) -- Jaw Bone Length
24
SetPedFaceFeature(multipedID, 15, (data.chin_1 / 100) + 0.0) -- Chin Height
25
SetPedFaceFeature(multipedID, 16, (data.chin_2 / 100) + 0.0) -- Chin Length
26
SetPedFaceFeature(multipedID, 17, (data.chin_3 / 100) + 0.0) -- Chin Width
27
SetPedFaceFeature(multipedID, 18, (data.chin_4 / 100) + 0.0) -- Chin Hole Size
28
SetPedFaceFeature(multipedID, 19, (data.neck_thickness / 100) + 0.0) -- Neck Thickness
29
30
-- Appearance
31
SetPedComponentVariation(multipedID, 2, data.hair_1, data.hair_2, 2) -- Hair Style
32
SetPedHairColor(multipedID, data.hair_color_1, data.hair_color_2) -- Hair Color
33
SetPedHeadOverlay(multipedID, 2, data.eyebrows_1, data.eyebrows_2 / 100 + 0.0) -- Eyebrow Style + Opacity
34
SetPedHeadOverlayColor(multipedID, 2, 1, data.eyebrows_3, data.eyebrows_4) -- Eyebrow Color
35
SetPedHeadOverlay(multipedID, 1, data.beard_1, data.beard_2 / 100 + 0.0) -- Beard Style + Opacity
36
SetPedHeadOverlayColor(multipedID, 1, 1, data.beard_3, data.beard_4) -- Beard Color
37
38
SetPedHeadOverlay(multipedID, 0, data.blemishes_1, data.blemishes_2 / 100 + 0.0) -- Skin blemishes + Opacity
39
SetPedHeadOverlay(multipedID, 12, data.bodyb_3, data.bodyb_4 / 100 + 0.0) -- Skin blemishes body effect + Opacity
40
41
SetPedHeadOverlay(multipedID, 11, data.bodyb_1, data.bodyb_2 / 100 + 0.0) -- Body Blemishes + Opacity
42
43
SetPedHeadOverlay(multipedID, 3, data.age_1, data.age_2 / 100 + 0.0) -- Age + opacity
44
SetPedHeadOverlay(multipedID, 6, data.complexion_1, data.complexion_2 / 100 + 0.0) -- Complexion + Opacity
45
SetPedHeadOverlay(multipedID, 9, data.moles_1, data.moles_2 / 100 + 0.0) -- Moles/Freckles + Opacity
46
SetPedHeadOverlay(multipedID, 7, data.sun_1, data.sun_2 / 100 + 0.0) -- Sun Damage + Opacity
47
SetPedEyeColor(multipedID, data.eye_color) -- Eyes Color
48
SetPedHeadOverlay(multipedID, 4, data.makeup_1, data.makeup_2 / 100 + 0.0) -- Makeup + Opacity
49
SetPedHeadOverlayColor(multipedID, 4, 0, data.makeup_3, data.makeup_4) -- Makeup Color
50
SetPedHeadOverlay(multipedID, 5, data.blush_1, data.blush_2 / 100 + 0.0) -- Blush + Opacity
51
SetPedHeadOverlayColor(multipedID, 5, 2, data.blush_3) -- Blush Color
52
SetPedHeadOverlay(multipedID, 8, data.lipstick_1, data.lipstick_2 / 100 + 0.0) -- Lipstick + Opacity
53
SetPedHeadOverlayColor(multipedID, 8, 2, data.lipstick_3, data.lipstick_4) -- Lipstick Color
54
SetPedHeadOverlay(multipedID, 10, data.chest_1, data.chest_2 / 100 + 0.0) -- Chest Hair + Opacity
55
SetPedHeadOverlayColor(multipedID, 10, 1, data.chest_3, data.chest_4) -- Chest Hair Color
56
57
-- Clothing and Accessories
58
SetPedComponentVariation(multipedID, 8, data.tshirt_1, data.tshirt_2, 2) -- Undershirts
59
SetPedComponentVariation(multipedID, 11, data.torso_1, data.torso_2, 2) -- Jackets
60
SetPedComponentVariation(multipedID, 3, data.arms, data.arms_2, 2) -- Torsos
61
SetPedComponentVariation(multipedID, 10, data.decals_1, data.decals_2, 2) -- Decals
62
SetPedComponentVariation(multipedID, 4, data.pants_1, data.pants_2, 2) -- Legs
63
SetPedComponentVariation(multipedID, 6, data.shoes_1, data.shoes_2, 2) -- Shoes
64
SetPedComponentVariation(multipedID, 1, data.mask_1, data.mask_2, 2) -- Masks
65
SetPedComponentVariation(multipedID, 9, data.bproof_1, data.bproof_2, 2) -- Vests
66
SetPedComponentVariation(multipedID, 7, data.neckarm_1, data.neckarm_2, 2) -- Necklaces/Chains/Ties/Suspenders
67
SetPedComponentVariation(multipedID, 5, data.bags_1, data.bags_2, 2) -- Bags
68
69
if data.helmet_1 == -1 then
70
ClearPedProp(multipedID, 0)
71
else
72
SetPedPropIndex(multipedID, 0, data.helmet_1, data.helmet_2, 2) -- Hats
73
end
74
75
if data.glasses_1 == -1 then
76
ClearPedProp(multipedID, 1)
77
else
78
SetPedPropIndex(multipedID, 1, data.glasses_1, data.glasses_2, 2) -- Glasses
79
end
80
81
if data.lefthand_1 == -1 then
82
ClearPedProp(multipedID, 6)
83
else
84
SetPedPropIndex(multipedID, 6, data.lefthand_1, data.lefthand_2, 2) -- Left Hand Accessory
85
end
86
87
if data.righthand_1 == -1 then
88
ClearPedProp(multipedID, 7)
89
else
90
SetPedPropIndex(multipedID, 7, data.righthand_1, data.righthand_2, 2) -- Right Hand Accessory
91
end
92
93
if data.ears_1 == -1 then
94
ClearPedProp(multipedID, 2)
95
else
96
SetPedPropIndex (multipedID, 2, data.ears_1, data.ears_2, 2) -- Ear Accessory
97
end
98
end)
Copied!
Part 1 - Copy and paste this block of code below into your clothing script, at the very bottom of the client-side main.lua.
1
RegisterNetEvent('otherclothing:MultiCharSkin')
2
AddEventHandler('otherclothing:MultiCharSkin', function(ped, skin)
3
-----SKIN-------
4
if ped then
5
if skin then
6
if skin['skin'] ~= nil then
7
for i = 1, #drawable_names do
8
if skin['skin'].drawables[0] == nil then
9
if drawable_names[i] == "undershirts" and skin['skin'].drawables[tostring(i-1)][2] == -1 then
10
SetPedComponentVariation(ped, i-1, 15, 0, 2)
11
else
12
SetPedComponentVariation(ped, i-1, skin['skin'].drawables[tostring(i-1)][2], skin['skin'].drawtextures[i][2], 2)
13
end
14
else
15
if drawable_names[i] == "undershirts" and skin['skin'].drawables[i-1][2] == -1 then
16
SetPedComponentVariation(ped, i-1, 15, 0, 2)
17
else
18
SetPedComponentVariation(ped, i-1, skin['skin'].drawables[i-1][2], skin['skin'].drawtextures[i][2], 2)
19
end
20
end
21
end
22
for i = 1, #prop_names do
23
local propZ = (skin['skin'].drawables[0] == nil and skin['skin'].props[tostring(i-1)][2] or skin['skin'].props[i-1][2])
24
ClearPedProp(ped, i-1)
25
SetPedPropIndex(ped,i-1,propZ,skin['skin'].proptextures[i][2], true)
26
end
27
Citizen.Wait(500)
28
if skin['skin'].model == 1885233650 or skin['skin'].model == -1667301416 then
29
-----FACE-------
30
if skin['face'] ~= nil then
31
SetPedHairColor(ped, tonumber(skin['face'].hairColor[1]), tonumber(skin['face'].hairColor[2]))
32
SetPedHeadBlendData(ped,
33
tonumber(skin['face'].headBlend['shapeFirst']),
34
tonumber(skin['face'].headBlend['shapeSecond']),
35
tonumber(skin['face'].headBlend['shapeThird']),
36
tonumber(skin['face'].headBlend['skinFirst']),
37
tonumber(skin['face'].headBlend['skinSecond']),
38
tonumber(skin['face'].headBlend['skinThird']),
39
tonumber(skin['face'].headBlend['shapeMix']),
40
tonumber(skin['face'].headBlend['skinMix']),
41
tonumber(skin['face'].headBlend['thirdMix']),
42
false)
43
44
for i = 1, #face_features do
45
SetPedFaceFeature(ped, i-1, skin['face'].headStructure[i])
46
end
47
if json.encode(skin['face'].headOverlay) ~= "[]" then
48
for i = 1, #head_overlays do
49
if skin['face'].headOverlay[i].name == "eyecolor" then
50
SetPedEyeColor(ped, tonumber(skin['face'].headOverlay[i].val))
51
else
52
SetPedHeadOverlay(ped, i-1, tonumber(skin['face'].headOverlay[i].overlayValue), tonumber(skin['face'].headOverlay[i].overlayOpacity))
53
end
54
end
55
56
SetPedHeadOverlayColor(ped, 0, 0, tonumber(skin['face'].headOverlay[1].firstColour), tonumber(skin['face'].headOverlay[1].secondColour))
57
SetPedHeadOverlayColor(ped, 1, 1, tonumber(skin['face'].headOverlay[2].firstColour), tonumber(skin['face'].headOverlay[2].secondColour))
58
SetPedHeadOverlayColor(ped, 2, 1, tonumber(skin['face'].headOverlay[3].firstColour), tonumber(skin['face'].headOverlay[3].secondColour))
59
SetPedHeadOverlayColor(ped, 3, 0, tonumber(skin['face'].headOverlay[4].firstColour), tonumber(skin['face'].headOverlay[4].secondColour))
60
SetPedHeadOverlayColor(ped, 4, 2, tonumber(skin['face'].headOverlay[5].firstColour), tonumber(skin['face'].headOverlay[5].secondColour))
61
SetPedHeadOverlayColor(ped, 5, 2, tonumber(skin['face'].headOverlay[6].firstColour), tonumber(skin['face'].headOverlay[6].secondColour))
62
SetPedHeadOverlayColor(ped, 6, 0, tonumber(skin['face'].headOverlay[7].firstColour), tonumber(skin['face'].headOverlay[7].secondColour))
63
SetPedHeadOverlayColor(ped, 7, 0, tonumber(skin['face'].headOverlay[8].firstColour), tonumber(skin['face'].headOverlay[8].secondColour))
64
SetPedHeadOverlayColor(ped, 8, 2, tonumber(skin['face'].headOverlay[9].firstColour), tonumber(skin['face'].headOverlay[9].secondColour))
65
SetPedHeadOverlayColor(ped, 9, 0, tonumber(skin['face'].headOverlay[10].firstColour), tonumber(skin['face'].headOverlay[10].secondColour))
66
SetPedHeadOverlayColor(ped, 10, 1, tonumber(skin['face'].headOverlay[11].firstColour), tonumber(skin['face'].headOverlay[11].secondColour))
67
SetPedHeadOverlayColor(ped, 11, 0, tonumber(skin['face'].headOverlay[12].firstColour), tonumber(skin['face'].headOverlay[12].secondColour))
68
end
69
else
70
print('skin[face] is nil')
71
end
72
73
-----TATTOOS-------
74
if skin['tattoo'] ~= nil then
75
ClearPedDecorations(ped)
76
for i = 1, #skin['tattoo'] do
77
ApplyPedOverlay(ped, skin['tattoo'][i][1], skin['tattoo'][i][2])
78
end
79
else
80
print('skin[tattoo] is nil')
81
end
82
end
83
else
84
print('skin[skin] is nil')
85
end
86
else
87
print('skin is nil')
88
end
89
else
90
print('ped is nil')
91
end
92
end)
Copied!

OPTIONAL INSTALATION STEPS

Advanced multi character method

WARNING If you are not 100% sure what you are doing here we would not recommend doing this, but if you insist please do read the information before implementing these changes. If you are unsure what this does, read more about it on our Web Store.
This is completely optional. We do not recommend using this option unless you have basic knowledge of Lua and you understand what needs to be done from reading the instructions below. This method is more complicated and more effort to install but is far more optimized than the standard esx_kashacters method.
Part 1: Set the Config.UseAdvancedMultiCharMethod in the config.lua to true.
Part 2: If you are switching from the standard multicharacter version to the advanced multicharacter version you need to use this command in your server console below before any players join.
1
AdvancedMultichar
Copied!
Part 3: Replace the FiveM native method of getting a players identifier (steam id, license) GetPlayerIdentifiers(source)[1] or GetPlayerIdentifiers(source)[2] with xPlayer.identifier for every server-side resource which uses the identifier to fetch a character's data from the database. xPlayer of course needs to be defined before using it eg., local xPlayer = ESX.GetPlayerFromId(source).
Example 1: Do not change this.
Example 2: Change this.
Part 4: Follow the guide below for your version of ESX.
ESX version 1.1
ESX version 1.2
ESX version 1.final
Extendedmode
ESX Legacy 1.3.x
ESX Legacy 1.6.x
essentialmode/server/main.lua/line 41 - replace the existing block of code with this.
View the Before and After examples here.
1
RegisterServerEvent('es:firstJoinProper')
2
AddEventHandler('es:firstJoinProper', function(charID)
3
local Source = source
4
Citizen.CreateThread(function()
5
local id
6
for k,v in ipairs(GetPlayerIdentifiers(Source)) do
7
if string.match(v, 'steam:') then
8
id = charID..''..v:sub(7)
9
break
10
end
11
end
12
13
if not id then
14
DropPlayer(Source, "SteamID not found, please try reconnecting with Steam open.")
15
else
16
registerUser(id, Source)
17
justJoined[Source] = true
18
if(settings.defaultSettings.pvpEnabled)then
19
TriggerClientEvent("es:enablePvp", Source)
20
end
21
end
22
23
return
24
end)
25
end)
Copied!
es_extended/server/ma.lua/line 1 - replace the existing block of code with this.
View the Before and After examples here.
1
RegisterServerEvent('esx:playerJoined')
2
AddEventHandler('esx:playerJoined', function(charID)
3
onPlayerJoined(source, charID)
4
end)
5
6
function onPlayerJoined(playerId, charID)
7
local identifier
8
9
for k,v in ipairs(GetPlayerIdentifiers(playerId)) do
10
if string.match(v, 'license:') then
11
identifier = charID..''..v:sub(9)
12
break
13
end
14
end
15
16
if identifier then
17
MySQL.Async.fetchScalar('SELECT 1 FROM users WHERE identifier = @identifier', {
18
['@identifier'] = identifier
19
}, function(result)
20
if result then
21
loadESXPlayer(identifier, playerId)
22
else
23
MySQL.Async.execute('INSERT INTO users (identifier) VALUES (@identifier)', {
24
['@identifier'] = identifier
25
}, function(rowsChanged)
26
loadESXPlayer(identifier, playerId)
27
end)
28
end
29
end)
30
else
31
DropPlayer(playerId, 'Your Rockstar license could not be found')
32
end
33
end
Copied!
es_extended/server/main.lua/line 6 - replace the existing block of code with this.
View the Before and After examples here.
1
RegisterServerEvent('esx:onPlayerJoined')
2
AddEventHandler('esx:onPlayerJoined', function(charID)
3
onPlayerJoined(source, charID)
4
end)
5
6
function onPlayerJoined(playerId, charID)
7
local identifier
8
9
for k,v in ipairs(GetPlayerIdentifiers(playerId)) do
10
if string.match(v, 'license:') then
11
identifier = charID..''..v:sub(9)
12
break
13
end
14
end</