Links

Multicharacter

Step-by-step installation guide, common issues & solutions, code snippets, error codes, config previews, locales previews, SQL 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

INSTALLATION GUIDE

Step 0 - First Steps

1. Download your resource from FiveM’s Keymaster.
2. Unzip the cd_multicharacter.zip folder and place this folder in your server's resource folder.
3. Add the resource to your server start config (server.cfg): ensure cd_multicharacter. If you are using a framework, it must be placed anywhere below your framework resource e.g., es_extended, not above.
ensure es_extended
ensure cd_multicharacter

Step 1 - Fxmanifest

Depending on your framework and dependencies, you may need to make some changes inside the [cd_multicharacter/fxmanifest.lua]. We have made this easier by commenting on the lines you possibly need to change.

Step 2 - Configure Resource

You MUST read all configurable options inside the [cd_multicharacter/configs/config.lua] file 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 3 - SQL Database

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 4 - Install Dependencies

Where can I find these dependencies?
Open the [cd_multicharacter/dependencies] folder. The folders inside are the required dependencies. You will find a text file inside each folder that includes a GitHub download link. Alternatively, they are listed in the table below.
Where should I put these dependencies?
These resources should be placed in your resources folder like any other, but remember, you shouldn't put them in the cd_multicharacter folder.
Do I need to add them to the server start config?
No, it will start automatically because it is listed as a dependency for this resource.
Resource Name
Download
Details
cd_drawtextui
Github
REQUIRED by default for the switch character locations if enabled but can be replaced/removed.

Step 5 - ESX Client Edit

We need to do a small modification to stop your framework from registering our character instantly when you 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.
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 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.
AddEventHandler('cui_character:SetPedClothes_multi')
RegisterNetEvent('cui_character:SetPedClothes_multi', function(new_character, skin)
playerLoaded = true
if new_character then
oldChar = GetDefaultCharacter(true)
LoadCharacter(oldChar)
TriggerEvent('cui_character:open', { 'identity', 'features', 'style', 'apparel' }, false)
else
oldLoadout = GetLoadout()
oldChar = skin
LoadCharacter(skin)
end
preparingSkin = false
end)
No changes are needed.

Step 7 - Multi-Peds Skin Edit

Now we need to copy and paste some code into your character skin creation script to set the skin of the peds. Currently, we support 3 different clothing scripts. However, 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.
exports('GetPedList', function()
return pedList
end)
Part 2 - Copy and paste this block of code below into your skinchanger script, at the very bottom of the client-side main.lua.
RegisterNetEvent('skinchanger:loadSkin2')
AddEventHandler('skinchanger:loadSkin2', function(multipedID, skin)
local MultiPed = {}
for i=1, #Components, 1 do
MultiPed[Components[i].name] = Components[i].value
end
for k,v in pairs(skin) do
MultiPed[k] = v
end
SetPedHeadBlendData (multipedID, MultiPed['face'], MultiPed['face'], MultiPed['face'], MultiPed['skin'], MultiPed['skin'], MultiPed['skin'], 1.0, 1.0, 1.0, true)
SetPedHairColor (multipedID, MultiPed['hair_color_1'], MultiPed['hair_color_2']) -- Hair Color
SetPedHeadOverlay (multipedID, 3, MultiPed['age_1'], (MultiPed['age_2'] / 10) + 0.0) -- Age + opacity
SetPedHeadOverlay (multipedID, 0, MultiPed['blemishes_1'], (MultiPed['blemishes_2'] / 10) + 0.0) -- Blemishes + opacity
SetPedHeadOverlay (multipedID, 1, MultiPed['beard_1'], (MultiPed['beard_2'] / 10) + 0.0) -- Beard + opacity
SetPedEyeColor (multipedID, MultiPed['eye_color'], 0, 1) -- Eyes color
SetPedHeadOverlay (multipedID, 2, MultiPed['eyebrows_1'], (MultiPed['eyebrows_2'] / 10) + 0.0) -- Eyebrows + opacity
SetPedHeadOverlay (multipedID, 4, MultiPed['makeup_1'], (MultiPed['makeup_2'] / 10) + 0.0) -- Makeup + opacity
SetPedHeadOverlay (multipedID, 8, MultiPed['lipstick_1'], (MultiPed['lipstick_2'] / 10) + 0.0) -- Lipstick + opacity
SetPedComponentVariation (multipedID, 2, MultiPed['hair_1'], MultiPed['hair_2'], 2) -- Hair
SetPedHeadOverlayColor (multipedID, 1, 1, MultiPed['beard_3'], MultiPed['beard_4']) -- Beard Color
SetPedHeadOverlayColor (multipedID, 2, 1, MultiPed['eyebrows_3'], MultiPed['eyebrows_4']) -- Eyebrows Color
SetPedHeadOverlayColor (multipedID, 4, 1, MultiPed['makeup_3'], MultiPed['makeup_4']) -- Makeup Color
SetPedHeadOverlayColor (multipedID, 8, 1, MultiPed['lipstick_3'], MultiPed['lipstick_4']) -- Lipstick Color
SetPedHeadOverlay (multipedID, 5, MultiPed['blush_1'], (MultiPed['blush_2'] / 10) + 0.0) -- Blush + opacity
SetPedHeadOverlayColor (multipedID, 5, 2, MultiPed['blush_3']) -- Blush Color
SetPedHeadOverlay (multipedID, 6, MultiPed['complexion_1'], (MultiPed['complexion_2'] / 10) + 0.0) -- Complexion + opacity
SetPedHeadOverlay (multipedID, 7, MultiPed['sun_1'], (MultiPed['sun_2'] / 10) + 0.0) -- Sun Damage + opacity
SetPedHeadOverlay (multipedID, 9, MultiPed['moles_1'], (MultiPed['moles_2'] / 10) + 0.0) -- Moles/Freckles + opacity
SetPedHeadOverlay (multipedID, 10, MultiPed['chest_1'], (MultiPed['chest_2'] / 10) + 0.0) -- Chest Hair + opacity
SetPedHeadOverlayColor (multipedID, 10, 1, MultiPed['chest_3']) -- Torso Color
SetPedHeadOverlay (multipedID, 11, MultiPed['bodyb_1'], (MultiPed['bodyb_2'] / 10) + 0.0) -- Body Blemishes + opacity
if MultiPed['ears_1'] == -1 then
ClearPedProp(multipedID, 2)
else
SetPedPropIndex (multipedID, 2, MultiPed['ears_1'], MultiPed['ears_2'], 2) -- Ears Accessories
end
SetPedComponentVariation (multipedID, 8, MultiPed['tshirt_1'], MultiPed['tshirt_2'], 2) -- Tshirt
SetPedComponentVariation (multipedID, 11, MultiPed['torso_1'], MultiPed['torso_2'], 2) -- torso parts
SetPedComponentVariation (multipedID, 3, MultiPed['arms'], MultiPed['arms_2'], 2) -- Amrs
SetPedComponentVariation (multipedID, 10, MultiPed['decals_1'], MultiPed['decals_2'], 2) -- decals
SetPedComponentVariation (multipedID, 4, MultiPed['pants_1'], MultiPed['pants_2'], 2) -- pants
SetPedComponentVariation (multipedID, 6, MultiPed['shoes_1'], MultiPed['shoes_2'], 2) -- shoes
SetPedComponentVariation (multipedID, 1, MultiPed['mask_1'], MultiPed['mask_2'], 2) -- mask
SetPedComponentVariation (multipedID, 9, MultiPed['bproof_1'], MultiPed['bproof_2'], 2) -- bulletproof
SetPedComponentVariation (multipedID, 7, MultiPed['chain_1'], MultiPed['chain_2'], 2) -- chain
SetPedComponentVariation (multipedID, 5, MultiPed['bags_1'], MultiPed['bags_2'], 2) -- Bag
if MultiPed['helmet_1'] == -1 then
ClearPedProp(multipedID, 0)
else
SetPedPropIndex (multipedID, 0, MultiPed['helmet_1'], MultiPed['helmet_2'], 2) -- Helmet
end
if MultiPed['glasses_1'] == -1 then
ClearPedProp(multipedID, 1)
else
SetPedPropIndex (multipedID, 1, MultiPed['glasses_1'], MultiPed['glasses_2'], 2) -- Glasses
end
if MultiPed['watches_1'] == -1 then
ClearPedProp(multipedID, 6)
else
SetPedPropIndex (multipedID, 6, MultiPed['watches_1'], MultiPed['watches_2'], 2) -- Watches
end
if MultiPed['bracelets_1'] == -1 then
ClearPedProp(multipedID, 7)
else
SetPedPropIndex (multipedID, 7, MultiPed['bracelets_1'], MultiPed['bracelets_2'], 2) -- Bracelets
end
MultiPed = nil
end)
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.
exports('GetPedList', function()
return pedList
end)
Part 2: Copy and paste this block of code below into your skinchanger script, at the very bottom of the client-side main.lua.
RegisterNetEvent('skinchanger:loadSkin2')
AddEventHandler('skinchanger:loadSkin2', function(multipedID, skin)
local MultiPed = {}
for i=1, #Components, 1 do
MultiPed[Components[i].name] = Components[i].value
end
for k,v in pairs(skin) do
MultiPed[k] = v
end
SetPedHeadBlendData (multipedID, MultiPed['face'], MultiPed['face'], MultiPed['face'], MultiPed['skin'], MultiPed['skin'], MultiPed['skin'], 1.0, 1.0, 1.0, true)
SetPedHairColor (multipedID, MultiPed['hair_color_1'], MultiPed['hair_color_2']) -- Hair Color
SetPedHeadOverlay (multipedID, 3, MultiPed['age_1'], (MultiPed['age_2'] / 10) + 0.0) -- Age + opacity
SetPedHeadOverlay (multipedID, 1, MultiPed['beard_1'], (MultiPed['beard_2'] / 10) + 0.0) -- Beard + opacity
SetPedEyeColor (multipedID, MultiPed['eye_color'], 0, 1) -- Eyes color
SetPedHeadOverlay (multipedID, 2, MultiPed['eyebrows_1'], (MultiPed['eyebrows_2'] / 10) + 0.0) -- Eyebrows + opacity
SetPedHeadOverlay (multipedID, 4, MultiPed['makeup_1'], (MultiPed['makeup_2'] / 10) + 0.0) -- Makeup + opacity
SetPedHeadOverlay (multipedID, 8, MultiPed['lipstick_1'], (MultiPed['lipstick_2'] / 10) + 0.0) -- Lipstick + opacity
SetPedComponentVariation (multipedID, 2, MultiPed['hair_1'], MultiPed['hair_2'], 2) -- Hair
SetPedHeadOverlayColor (multipedID, 1, 1, MultiPed['beard_3'], MultiPed['beard_4']) -- Beard Color
SetPedHeadOverlayColor (multipedID, 2, 1, MultiPed['eyebrows_3'], MultiPed['eyebrows_4']) -- Eyebrows Color
SetPedHeadOverlayColor (multipedID, 4, 1, MultiPed['makeup_3'], MultiPed['makeup_4']) -- Makeup Color
SetPedHeadOverlayColor (multipedID, 8, 1, MultiPed['lipstick_3'], MultiPed['lipstick_4']) -- Lipstick Color
SetPedHeadOverlay (multipedID, 5, MultiPed['blush_1'], (MultiPed['blush_2'] / 10) + 0.0) -- Blush + opacity
SetPedHeadOverlayColor (multipedID, 5, 2, MultiPed['blush_3']) -- Blush Color
SetPedHeadOverlay (multipedID, 9, MultiPed['moles_1'], (MultiPed['moles_2'] / 10) + 0.0) -- Moles/Freckles + opacity
SetPedHeadOverlay (multipedID, 10, MultiPed['chest_1'], (MultiPed['chest_2'] / 10) + 0.0) -- Chest Hair + opacity
SetPedHeadOverlayColor (multipedID, 10, 1, MultiPed['chest_3']) -- Torso Color
if MultiPed['ears_1'] == -1 then
ClearPedProp(multipedID, 2)
else
SetPedPropIndex (multipedID, 2, MultiPed['ears_1'], MultiPed['ears_2'], 2) -- Ears Accessories
end
SetPedComponentVariation (multipedID, 8, MultiPed['tshirt_1'], MultiPed['tshirt_2'], 2) -- Tshirt
SetPedComponentVariation (multipedID, 11, MultiPed['torso_1'], MultiPed['torso_2'], 2) -- torso parts
SetPedComponentVariation (multipedID, 3, MultiPed['arms'], MultiPed['arms_2'], 2) -- Amrs
SetPedComponentVariation (multipedID, 10, MultiPed['decals_1'], MultiPed['decals_2'], 2) -- decals
SetPedComponentVariation (multipedID, 4, MultiPed['pants_1'], MultiPed['pants_2'], 2) -- pants
SetPedComponentVariation (multipedID, 6, MultiPed['shoes_1'], MultiPed['shoes_2'], 2) -- shoes
SetPedComponentVariation (multipedID, 1, MultiPed['mask_1'], MultiPed['mask_2'], 2) -- mask
SetPedComponentVariation (multipedID, 9, MultiPed['bproof_1'], MultiPed['bproof_2'], 2) -- bulletproof
SetPedComponentVariation (multipedID, 7, MultiPed['chain_1'], MultiPed['chain_2'], 2) -- chain
SetPedComponentVariation (multipedID, 5, MultiPed['bags_1'], MultiPed['bags_2'], 2) -- Bag
if MultiPed['helmet_1'] == -1 then
ClearPedProp(multipedID, 0)
else
SetPedPropIndex (multipedID, 0, MultiPed['helmet_1'], MultiPed['helmet_2'], 2) -- Helmet
end
if MultiPed['glasses_1'] == -1 then
ClearPedProp(multipedID, 1)
else
SetPedPropIndex (multipedID, 1, MultiPed['glasses_1'], MultiPed['glasses_2'], 2) -- Glasses
end
if MultiPed['watches_1'] == -1 then
ClearPedProp(multipedID, 6)
else
SetPedPropIndex (multipedID, 6, MultiPed['watches_1'], MultiPed['watches_2'], 2) -- Watches
end
if MultiPed['bracelets_1'] == -1 then
ClearPedProp(multipedID, 7)
else
SetPedPropIndex (multipedID, 7, MultiPed['bracelets_1'], MultiPed['bracelets_2'], 2) -- Bracelets
end
SetPedFaceFeature(multipedID, 0, MultiPed['nose_width'])
SetPedFaceFeature(multipedID, 1, MultiPed['nose_peak_hight'])
SetPedFaceFeature(multipedID, 2, MultiPed['nose_peak_lenght'])
SetPedFaceFeature(multipedID, 3, MultiPed['nose_bone_high'])
SetPedFaceFeature(multipedID, 4, MultiPed['nose_peak_lowering'])
SetPedFaceFeature(multipedID, 5, MultiPed['nose_bone_twist'])
SetPedFaceFeature(multipedID, 6, MultiPed['eyebrown_high'])
SetPedFaceFeature(multipedID, 7, MultiPed['eyebrown_forward'])
SetPedFaceFeature(multipedID, 8, MultiPed['cheeks_bone_high'])
SetPedFaceFeature(multipedID, 9, MultiPed['cheeks_bone_width'])
SetPedFaceFeature(multipedID, 10, MultiPed['cheeks_width'])
SetPedFaceFeature(multipedID, 11, MultiPed['eyes_openning'])
SetPedFaceFeature(multipedID, 12, MultiPed['lips_thickness'])
SetPedFaceFeature(multipedID, 13, MultiPed['jaw_bone_width'])
SetPedFaceFeature(multipedID, 14, MultiPed['jaw_bone_back_lenght'])
SetPedFaceFeature(multipedID, 15, MultiPed['chimp_bone_lowering'])
SetPedFaceFeature(multipedID, 16, MultiPed['chimp_bone_lenght'])
SetPedFaceFeature(multipedID, 17, MultiPed['chimp_bone_width'])
SetPedFaceFeature(multipedID, 18, MultiPed['chimp_hole'])
SetPedFaceFeature(multipedID, 19, MultiPed['neck_thikness'])
MultiPed = nil
end)
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.
RegisterNetEvent('cui_character:MultiCharSkin')
AddEventHandler('cui_character:MultiCharSkin', function(multipedID, data)
-- Face Blend
local weightFace = data.face_md_weight / 100 + 0.0
local weightSkin = data.skin_md_weight / 100 + 0.0
SetPedHeadBlendData(multipedID, data.mom, data.dad, 0, data.mom, data.dad, 0, weightFace, weightSkin, 0.0, false)
-- Facial Features
SetPedFaceFeature(multipedID, 0, (data.nose_1 / 100) + 0.0) -- Nose Width
SetPedFaceFeature(multipedID, 1, (data.nose_2 / 100) + 0.0) -- Nose Peak Height
SetPedFaceFeature(multipedID, 2, (data.nose_3 / 100) + 0.0) -- Nose Peak Length
SetPedFaceFeature(multipedID, 3, (data.nose_4 / 100) + 0.0) -- Nose Bone Height
SetPedFaceFeature(multipedID, 4, (data.nose_5 / 100) + 0.0) -- Nose Peak Lowering
SetPedFaceFeature(multipedID, 5, (data.nose_6 / 100) + 0.0) -- Nose Bone Twist
SetPedFaceFeature(multipedID, 6, (data.eyebrows_5 / 100) + 0.0) -- Eyebrow height
SetPedFaceFeature(multipedID, 7, (data.eyebrows_6 / 100) + 0.0) -- Eyebrow depth
SetPedFaceFeature(multipedID, 8, (data.cheeks_1 / 100) + 0.0) -- Cheekbones Height
SetPedFaceFeature(multipedID, 9, (data.cheeks_2 / 100) + 0.0) -- Cheekbones Width
SetPedFaceFeature(multipedID, 10, (data.cheeks_3 / 100) + 0.0) -- Cheeks Width
SetPedFaceFeature(multipedID, 11, (data.eye_squint / 100) + 0.0) -- Eyes squint
SetPedFaceFeature(multipedID, 12, (data.lip_thickness / 100) + 0.0) -- Lip Fullness
SetPedFaceFeature(multipedID, 13, (data.jaw_1 / 100) + 0.0) -- Jaw Bone Width
SetPedFaceFeature(multipedID, 14, (data.jaw_2 / 100) + 0.0) -- Jaw Bone Length
SetPedFaceFeature(multipedID, 15, (data.chin_1 / 100) + 0.0) -- Chin Height
SetPedFaceFeature(multipedID, 16, (data.chin_2 / 100) + 0.0) -- Chin Length
SetPedFaceFeature(multipedID, 17, (data.chin_3 / 100) + 0.0) -- Chin Width
SetPedFaceFeature(multipedID, 18, (data.chin_4 / 100) + 0.0) -- Chin Hole Size
SetPedFaceFeature(multipedID, 19, (data.neck_thickness / 100) + 0.0) -- Neck Thickness
-- Appearance
SetPedComponentVariation(multipedID, 2, data.hair_1, data.hair_2, 2) -- Hair Style
SetPedHairColor(multipedID, data.hair_color_1, data.hair_color_2) -- Hair Color
SetPedHeadOverlay(multipedID, 2, data.eyebrows_1, data.eyebrows_2 / 100 + 0.0) -- Eyebrow Style + Opacity
SetPedHeadOverlayColor(multipedID, 2, 1, data.eyebrows_3, data.eyebrows_4) -- Eyebrow Color
SetPedHeadOverlay(multipedID, 1, data.beard_1, data.beard_2 / 100 + 0.0) -- Beard Style + Opacity
SetPedHeadOverlayColor(multipedID, 1, 1, data.beard_3, data.beard_4) -- Beard Color
SetPedHeadOverlay(multipedID, 0, data.blemishes_1, data.blemishes_2 / 100 + 0.0) -- Skin blemishes + Opacity
SetPedHeadOverlay(multipedID, 12, data.bodyb_3, data.bodyb_4 / 100 + 0.0) -- Skin blemishes body effect + Opacity
SetPedHeadOverlay(multipedID, 11, data.bodyb_1, data.bodyb_2 / 100 + 0.0) -- Body Blemishes + Opacity
SetPedHeadOverlay(multipedID, 3, data.age_1, data.age_2 / 100 + 0.0) -- Age + opacity
SetPedHeadOverlay(multipedID, 6, data.complexion_1, data.complexion_2 / 100 + 0.0) -- Complexion + Opacity
SetPedHeadOverlay(multipedID, 9, data.moles_1, data.moles_2 / 100 + 0.0) -- Moles/Freckles + Opacity
SetPedHeadOverlay(multipedID, 7, data.sun_1, data.sun_2 / 100 + 0.0) -- Sun Damage + Opacity
SetPedEyeColor(multipedID, data.eye_color) -- Eyes Color
SetPedHeadOverlay(multipedID, 4, data.makeup_1, data.makeup_2 / 100 + 0.0) -- Makeup + Opacity
SetPedHeadOverlayColor(multipedID, 4, 0, data.makeup_3, data.makeup_4) -- Makeup Color
SetPedHeadOverlay(multipedID, 5, data.blush_1, data.blush_2 / 100 + 0.0) -- Blush + Opacity
SetPedHeadOverlayColor(multipedID, 5, 2, data.blush_3) -- Blush Color
SetPedHeadOverlay(multipedID, 8, data.lipstick_1, data.lipstick_2 / 100 + 0.0) -- Lipstick + Opacity
SetPedHeadOverlayColor(multipedID, 8, 2, data.lipstick_3, data.lipstick_4) -- Lipstick Color
SetPedHeadOverlay(multipedID, 10, data.chest_1, data.chest_2 / 100 + 0.0) -- Chest Hair + Opacity
SetPedHeadOverlayColor(multipedID, 10, 1, data.chest_3, data.chest_4) -- Chest Hair Color
-- Clothing and Accessories
SetPedComponentVariation(multipedID, 8, data.tshirt_1, data.tshirt_2, 2) -- Undershirts
SetPedComponentVariation(multipedID, 11, data.torso_1, data.torso_2, 2) -- Jackets
SetPedComponentVariation(multipedID, 3, data.arms, data.arms_2, 2) -- Torsos
SetPedComponentVariation(multipedID, 10, data.decals_1, data.decals_2, 2) -- Decals
SetPedComponentVariation(multipedID, 4, data.pants_1, data.pants_2, 2) -- Legs
SetPedComponentVariation(multipedID, 6, data.shoes_1, data.shoes_2, 2) -- Shoes
SetPedComponentVariation(multipedID, 1, data.mask_1, data.mask_2, 2) -- Masks
SetPedComponentVariation(multipedID, 9, data.bproof_1, data.bproof_2, 2) -- Vests
SetPedComponentVariation(multipedID, 7, data.neckarm_1, data.neckarm_2, 2) -- Necklaces/Chains/Ties/Suspenders
SetPedComponentVariation(multipedID, 5, data.bags_1, data.bags_2, 2) -- Bags
if data.helmet_1 == -1 then
ClearPedProp(multipedID, 0)
else
SetPedPropIndex(multipedID, 0, data.helmet_1, data.helmet_2, 2) -- Hats
end
if data.glasses_1 == -1 then
ClearPedProp(multipedID, 1)
else
SetPedPropIndex(multipedID, 1, data.glasses_1, data.glasses_2, 2) -- Glasses
end
if data.lefthand_1 == -1 then
ClearPedProp(multipedID, 6)
else
SetPedPropIndex(multipedID, 6, data.lefthand_1, data.lefthand_2, 2) -- Left Hand Accessory
end
if data.righthand_1 == -1 then
ClearPedProp(multipedID, 7)
else
SetPedPropIndex(multipedID, 7, data.righthand_1, data.righthand_2, 2) -- Right Hand Accessory
end
if data.ears_1 == -1 then
ClearPedProp(multipedID, 2)
else
SetPedPropIndex (multipedID, 2, data.ears_1, data.ears_2, 2) -- Ear Accessory
end
end)
Part 1 - Copy and paste this block of code below into your clothing script, at the very bottom of the client-side main.lua.
RegisterNetEvent('otherclothing:MultiCharSkin')
AddEventHandler('otherclothing:MultiCharSkin', function(ped, skin)
-----SKIN-------
if ped then
if skin then
if skin['skin'] ~= nil then
for i = 1, #drawable_names do
if skin['skin'].drawables[0] == nil then
if drawable_names[i] == "undershirts" and skin['skin'].drawables[tostring(i-1)][2] == -1 then
SetPedComponentVariation(ped, i-1, 15, 0, 2)
else
SetPedComponentVariation(ped, i-1, skin['skin'].drawables[tostring(i-1)][2], skin['skin'].drawtextures[i][2], 2)
end
else
if drawable_names[i] == "undershirts" and skin['skin'].drawables[i-1][2] == -1 then
SetPedComponentVariation(ped, i-1, 15, 0, 2)
else
SetPedComponentVariation(ped, i-1, skin['skin'].drawables[i-1][2], skin['skin'].drawtextures[i][2], 2)
end
end
end
for i = 1, #prop_names do
local propZ = (skin['skin'].drawables[0] == nil and skin['skin'].props[tostring(i-1)][2] or skin['skin'].props[i-1][2])
ClearPedProp(ped, i-1)
SetPedPropIndex(ped,i-1,propZ,skin['skin'].proptextures[i][2], true)
end
Citizen.Wait(500)
if skin['skin'].model == 1885233650 or skin['skin'].model == -1667301416 then
-----FACE-------
if skin['face'] ~= nil then
SetPedHairColor(ped, tonumber(skin['face'].hairColor[1]), tonumber(skin['face'].hairColor[2]))
SetPedHeadBlendData(ped,
tonumber(skin['face'].headBlend['shapeFirst']),
tonumber(skin['face'].headBlend['shapeSecond']),
tonumber(skin['face'].headBlend['shapeThird']),
tonumber(skin['face'].headBlend['skinFirst']),
tonumber(skin['face'].headBlend['skinSecond']),
tonumber(skin['face'].headBlend['skinThird']),
tonumber(skin['face'].headBlend['shapeMix']),
tonumber(skin['face'].headBlend['skinMix']),
tonumber(skin['face'].headBlend['thirdMix']),
false)
for i = 1, #face_features do
SetPedFaceFeature(ped, i-1, skin['face'].headStructure[i])
end
if json.encode(skin['face'].headOverlay) ~= "[]" then
for i = 1, #head_overlays do
if skin['face'].headOverlay[i].name == "eyecolor" then
SetPedEyeColor(ped, tonumber(skin['face'].headOverlay[i].val))
else
SetPedHeadOverlay(ped, i-1, tonumber(skin['face'].headOverlay[i].overlayValue), tonumber(skin['face'].headOverlay[i].overlayOpacity))
end
end
SetPedHeadOverlayColor(ped, 0, 0, tonumber(skin['face'].headOverlay[1].firstColour), tonumber(skin['face'].headOverlay[1].secondColour))
SetPedHeadOverlayColor(ped, 1, 1, tonumber(skin['face'].headOverlay[2].firstColour), tonumber(skin['face'].headOverlay[2].secondColour))
SetPedHeadOverlayColor(ped, 2, 1, tonumber(skin['face'].headOverlay[3].firstColour), tonumber(skin['face'].headOverlay[3].secondColour))
SetPedHeadOverlayColor(ped, 3, 0, tonumber(skin['face'].headOverlay[4].firstColour), tonumber(skin['face'].headOverlay[4].secondColour))
SetPedHeadOverlayColor(ped, 4, 2, tonumber(skin['face'].headOverlay[5].firstColour), tonumber(skin['face'].headOverlay[5].secondColour))
SetPedHeadOverlayColor(ped, 5, 2, tonumber(