LogoLogo
  • Codesign Documentation
  • Information
    • Discord Roles
    • FiveM Asset Escrow System
    • Authentication & Transfers
  • Coding Information
    • Register Key Mapping
    • Code Snippets
    • Self Debugging
  • Paid scripts
    • Arm Wrestling
      • Configs, Locales & SQL
    • Car HUD
      • Configs, Locales & SQL
    • CCTV Cameras
      • Configs, Locales & SQL
    • Darts
      • Configs, Locales & SQL
    • Dispatch
      • Configs, Locales & SQL
      • Resource Integration
    • Door Lock
      • Configs, Locales & SQL
    • Garage
      • Keys/Chat/Events/Exports
      • Optional Features
      • Configs, Locales & SQL
      • Resource Integration
    • Gun Range
      • Configs, Locales & SQL
    • Identity
      • Configs, Locales & SQL
    • Multicharacter
      • Configs, Locales & SQL
    • Player HUD
      • Configs, Locales & SQL
    • Props
      • Configs, Locales & SQL
    • Radar
      • Configs, Locales & SQL
    • Spawn Select
      • Configs, Locales & SQL
    • Terminal Hacker
      • Configs, Locales & SQL
    • Vehicle Control
      • Configs, Locales & SQL
    • VIP Shop
      • Configs, Locales & SQL
  • Free Scripts
    • Easytime
      • Keys/Chat/Events/Exports
      • Optional Features
      • Configs & Locales
    • Drawtext UI
    • Devtools
    • Keymaster - Minigame
    • Staff Support
    • Notifications
Powered by GitBook
LogoLogo

Codesign Software © All rights reserved

On this page
  • INSTALLATION GUIDE
  • Step 0 - First Steps
  • Step 1 - Fxmanifest
  • Step 2 - Configure Resource
  • Step 3 - SQL Database
  • Step 4 - Install Dependencies
  • Step 5 - ESX Client Edit
  • Step 6 - Player Skin Edit
  • Step 7 - Multi-Peds Skin Edit
  • OPTIONAL FEATURES
  • Advanced multi-character method
  • Switching Characters
  • INFORMATION
  • Default Key Binds
  • Chat Commands
  • COMMON ISSUES
  • ERROR CODES
  • FRESH TEST SERVER
  • CHANGELOG

Was this helpful?

  1. Paid scripts

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.

PreviousConfigs, Locales & SQLNextConfigs, Locales & SQL

Last updated 12 months ago

Was this helpful?

This resource can be purchased as part of a bundle for a discount .

Translate

INSTALLATION GUIDE

Step 0 - First Steps

1. Download your resource from .

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

Step 2 - Configure Resource

Step 3 - SQL Database

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

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.

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.

There are many different versions and not all will look the exact same.

View the examples below:

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.

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(skin['face'].headOverlay[6].firstColour), tonumber(skin['face'].headOverlay[6].secondColour))
                            SetPedHeadOverlayColor(ped, 6, 0, tonumber(skin['face'].headOverlay[7].firstColour), tonumber(skin['face'].headOverlay[7].secondColour))
                            SetPedHeadOverlayColor(ped, 7, 0, tonumber(skin['face'].headOverlay[8].firstColour), tonumber(skin['face'].headOverlay[8].secondColour))
                            SetPedHeadOverlayColor(ped, 8, 2, tonumber(skin['face'].headOverlay[9].firstColour), tonumber(skin['face'].headOverlay[9].secondColour))
                            SetPedHeadOverlayColor(ped, 9, 0, tonumber(skin['face'].headOverlay[10].firstColour), tonumber(skin['face'].headOverlay[10].secondColour))
                            SetPedHeadOverlayColor(ped, 10, 1, tonumber(skin['face'].headOverlay[11].firstColour), tonumber(skin['face'].headOverlay[11].secondColour))
                            SetPedHeadOverlayColor(ped, 11, 0, tonumber(skin['face'].headOverlay[12].firstColour), tonumber(skin['face'].headOverlay[12].secondColour))
                        end
                    else
                        print('skin[face] is nil')
                    end

                    -----TATTOOS-------
                    if skin['tattoo'] ~= nil then
                        ClearPedDecorations(ped)
                        for i = 1, #skin['tattoo'] do
                            ApplyPedOverlay(ped, skin['tattoo'][i][1], skin['tattoo'][i][2])
                        end
                    else
                        print('skin[tattoo] is nil')
                    end
                end
            else
                print('skin[skin] is nil')
            end
        else
            print('skin is nil')
        end
    else
        print('ped is nil')
    end
end)

OPTIONAL FEATURES

This section is to help you understand how the built-in features of this resource work, and if applicable, how you can make them compatible with other resources. These features are not required, they are optional and can be configured in the [configs/config.lua].

Advanced multi-character method

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 multi-character version to the advanced multicharacter version you need to use this command in your server console below before any players join.

Use this chat command in the server console.
AdvancedMultichar

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

Part 4: Follow the guide below for your version of ESX.

essentialmode/server/main.lua/line 41 - replace the existing block of code with this.

RegisterServerEvent('es:firstJoinProper')
AddEventHandler('es:firstJoinProper', function(charID)
    local Source = source
    Citizen.CreateThread(function()
        local id
        for k,v in ipairs(GetPlayerIdentifiers(Source)) do
            if string.match(v, 'steam:') then
                id = charID..''..v:sub(7)
                break
            end
        end

        if not id then
            DropPlayer(Source, "SteamID not found, please try reconnecting with Steam open.")
        else
            registerUser(id, Source)
            justJoined[Source] = true
            if(settings.defaultSettings.pvpEnabled)then
                TriggerClientEvent("es:enablePvp", Source)
            end
        end

        return
    end)
end)

es_extended/server/ma.lua/line 1 - replace the existing block of code with this.

RegisterServerEvent('esx:playerJoined')
AddEventHandler('esx:playerJoined', function(charID)
    onPlayerJoined(source, charID)
end)

function onPlayerJoined(playerId, charID)
    local identifier

    for k,v in ipairs(GetPlayerIdentifiers(playerId)) do
        if string.match(v, 'license:') then
            identifier = charID..''..v:sub(9)
            break
        end
    end

    if identifier then
        MySQL.Async.fetchScalar('SELECT 1 FROM users WHERE identifier = @identifier', {
            ['@identifier'] = identifier
        }, function(result)
            if result then
                loadESXPlayer(identifier, playerId)
            else
                MySQL.Async.execute('INSERT INTO users (identifier) VALUES (@identifier)', {
                    ['@identifier'] = identifier
                }, function(rowsChanged)
                    loadESXPlayer(identifier, playerId)
                end)
            end
        end)
    else
        DropPlayer(playerId, 'Your Rockstar license could not be found')
    end
end

es_extended/server/main.lua/line 6 - replace the existing block of code with this.

RegisterServerEvent('esx:onPlayerJoined')
AddEventHandler('esx:onPlayerJoined', function(charID)
    onPlayerJoined(source, charID)
end)

function onPlayerJoined(playerId, charID)
    local identifier

    for k,v in ipairs(GetPlayerIdentifiers(playerId)) do
        if string.match(v, 'license:') then
            identifier = charID..''..v:sub(9)
            break
        end
    end

    if identifier then
        if ESX.GetPlayerFromIdentifier(identifier) then
            DropPlayer(playerId, ('there was an error loading your character!\nError code: identifier-active-ingame\n\nThis error is caused by a player on this server who has the same identifier as you have. Make sure you are not playing on the same Rockstar account.\n\nYour Rockstar identifier: %s'):format(identifier))
        else
            MySQL.Async.fetchScalar('SELECT 1 FROM users WHERE identifier = @identifier', {
                ['@identifier'] = identifier
            }, function(result)
                if result then
                    loadESXPlayer(identifier, playerId)
                else
                    local accounts = {}

                    for account,money in pairs(Config.StartingAccountMoney) do
                        accounts[account] = money
                    end

                    MySQL.Async.execute('INSERT INTO users (accounts, identifier) VALUES (@accounts, @identifier)', {
                        ['@accounts'] = json.encode(accounts),
                        ['@identifier'] = identifier
                    }, function(rowsChanged)
                        loadESXPlayer(identifier, playerId)
                    end)
                end
            end)
        end
    else
        DropPlayer(playerId, 'there was an error loading your character!\nError code: identifier-missing-ingame\n\nThe cause of this error is not known, your identifier could not be found. Please come back later or report this problem to the server administration team.')
    end
end

extendedmode/server/main.lua/line 1 - replace the existing block of code with this.

RegisterServerEvent('esx:onPlayerJoined')
AddEventHandler('esx:onPlayerJoined', function(charID)
	if not ESX.Players[source] then
		onPlayerJoined(source, charID)
	end
end)

function onPlayerJoined(playerId, charID)
	local identifier
	local license
	
	for k,v in ipairs(GetPlayerIdentifiers(playerId)) do
		if string.match(v, Config.PrimaryIdentifier) then
            if Config.PrimaryIdentifier == 'steam' then
                identifier = charID..''..v:sub(7)
            elseif Config.PrimaryIdentifier == 'license' then
                identifier = charID..''..v:sub(9)
            end
		end
		if string.match(v, 'license:') then
			license = v
		end
	end

	if identifier then
		if ESX.GetPlayerFromIdentifier(identifier) then
			DropPlayer(playerId, ('there was an error loading your character!\nError code: identifier-active-ingame\n\nThis error is caused by a player on this server who has the same identifier as you have. Make sure you are not playing on the same Rockstar account.\n\nYour Rockstar identifier: %s'):format(identifier))
		else
			MySQL.Async.fetchScalar('SELECT 1 FROM users WHERE identifier = @identifier', {
				['@identifier'] = identifier
			}, function(result)
				if result then
					loadESXPlayer(identifier, playerId)
				else
					local accounts = {}

					for account,money in pairs(Config.StartingAccountMoney) do
						accounts[account] = money
					end

					MySQL.Async.execute('INSERT INTO users (accounts, identifier, license) VALUES (@accounts, @identifier, @license)', {
						['@accounts'] = json.encode(accounts),
						['@identifier'] = identifier,
						['@license'] = license,						
					}, function(rowsChanged)
						loadESXPlayer(identifier, playerId)
					end)
				end
			end)
		end
	else
		DropPlayer(playerId, 'there was an error loading your character!\nError code: identifier-missing-ingame\n\nThe cause of this error is not known, your identifier could not be found. Please come back later or report this problem to the server administration team.')
	end
end

Make sure the Config.Multichar in es_extended’s config.lua is set to false.

es_extended/server/main.lua/line 26 - replace the existing block of code with this.

if Config.Multichar then
	AddEventHandler('esx:onPlayerJoined', function(src, char, data)
		if not ESX.Players[src] then
			local identifier = char..':'..ESX.GetIdentifier(src)
			if data then
				createESXPlayer(identifier, src, data)
			else
				loadESXPlayer(identifier, src, false)
			end
		end
	end)
else
	RegisterServerEvent('esx:onPlayerJoined')
	AddEventHandler('esx:onPlayerJoined', function(charID)
		if not ESX.Players[source] then
			onPlayerJoined(source, charID)
		end
	end)
end

function onPlayerJoined(playerId, charID)
	local identifier = charID..''..ESX.GetIdentifier(playerId)
	if identifier then
		if ESX.GetPlayerFromIdentifier(identifier) then
			DropPlayer(playerId, ('there was an error loading your character!\nError code: identifier-active-ingame\n\nThis error is caused by a player on this server who has the same identifier as you have. Make sure you are not playing on the same Rockstar account.\n\nYour Rockstar identifier: %s'):format(identifier))
		else
			MySQL.Async.fetchScalar('SELECT 1 FROM users WHERE identifier = @identifier', {
				['@identifier'] = identifier
			}, function(result)
				if result then
					loadESXPlayer(identifier, playerId, false)
				else createESXPlayer(identifier, playerId) end
			end)
		end
	else
		DropPlayer(playerId, 'there was an error loading your character!\nError code: identifier-missing-ingame\n\nThe cause of this error is not known, your identifier could not be found. Please come back later or report this problem to the server administration team.')
	end
end

Make sure the Config.Multichar in es_extended’s config.lua is set to false.

es_extended/server/main.lua/line 17 - replace the existing block of code with this.

if Config.Multichar then
	AddEventHandler('esx:onPlayerJoined', function(src, char, data)
		while not next(ESX.Jobs) do Wait(50) end

		if not ESX.Players[src] then
			local identifier = char..':'..ESX.GetIdentifier(src)
			if data then
				createESXPlayer(identifier, src, data)
			else
				loadESXPlayer(identifier, src, false)
			end
		end
	end)
else
	RegisterServerEvent('esx:onPlayerJoined')
	AddEventHandler('esx:onPlayerJoined', function(charID)
		while not next(ESX.Jobs) do Wait(50) end

		if not ESX.Players[source] then
			onPlayerJoined(source, charID)
		end
	end)
end

function onPlayerJoined(playerId, charID)
	local identifier = charID..''..ESX.GetIdentifier(playerId)
	if identifier then
		if ESX.GetPlayerFromIdentifier(identifier) then
			DropPlayer(playerId, ('there was an error loading your character!\nError code: identifier-active-ingame\n\nThis error is caused by a player on this server who has the same identifier as you have. Make sure you are not playing on the same Rockstar account.\n\nYour Rockstar identifier: %s'):format(identifier))
		else
			local result = MySQL.scalar.await('SELECT 1 FROM users WHERE identifier = ?', { identifier })
			if result then
				loadESXPlayer(identifier, playerId, false)
			else
				createESXPlayer(identifier, playerId)
			end
		end
	else
		DropPlayer(playerId, 'there was an error loading your character!\nError code: identifier-missing-ingame\n\nThe cause of this error is not known, your identifier could not be found. Please come back later or report this problem to the server administration team.')
	end
end

Switching Characters

Part 1: Copy and paste this block of code below into your character skin creator script, at the very bottom of the client-side main.lua.

RegisterNetEvent('skinchanger:ResetPlayerSkin')
AddEventHandler('skinchanger:ResetPlayerSkin', function()
	Character = {}
	for i=1, #Components, 1 do
		Character[Components[i].name] = Components[i].value
	end
	TriggerEvent('skinchanger:loadSkin', {sex = 0})
end)

No action needed.

No action needed.

Part 2: We need to add 2 events to your es_extended resource to tell the code that we are switching characters.

ESX (all versions) - /server/main.lua - add this block of code at the bottom of the file.

RegisterServerEvent('esx:cd_multicharacter:SwitchCharacter')
AddEventHandler('esx:cd_multicharacter:SwitchCharacter', function(_source)
	if type(_source) ~= 'number' then _source = source end
	local xPlayer = ESX.GetPlayerFromId(_source)
	if xPlayer then
		TriggerEvent('esx:playerDropped', _source, 'multichar-switch_char')
		TriggerClientEvent('esx:cd_multicharacter:SwitchCharacter', _source)
		TriggerClientEvent('esx:onPlayerLogout', _source)
		if Core then
            Core.SavePlayer(xPlayer, function()
                ESX.Players[_source] = nil
            end)
        else
            ESX.SavePlayer(xPlayer, function()
                ESX.Players[_source] = nil
            end)
        end
	end
end)

ESX (all versions) - /client/main.lua - add this block of code at the bottom of the file.

RegisterNetEvent('esx:cd_multicharacter:SwitchCharacter')
AddEventHandler('esx:cd_multicharacter:SwitchCharacter', function()
	ESX.PlayerLoaded = false
end)

INFORMATION

Default Key Binds

Key

Description

Enter / Left Mouse

Select a character.

Left / Right Arrows

Cycle through the characters.

Chat Commands

The exact usage for each command will be displayed in the chat suggestions when using the commands in-game.

Command

Description

/charslots

(staff command) To check/add/remove a player's character slots.

/switchcharacter

If enabled, this will allow players to change characters in-game.

/DatabaseCleaner

(console command) This will remove all of the unneeded rows in your database which ESX resources unnecessarily add. Should only be needed a couple of times per month.

/SetAllMaxChars

(console command) This will set the max character slots for all player's in the database - if you ever need to change them all.

/AdvancedMultichar

COMMON ISSUES

🔔 Folder Name Make sure the name of the folder is cd_multicharacter.

🔔 Encrypted Files Do not edit the encrypted files in any way.

🔔 Always F8 Quit Make sure you and your players fully close FiveM before reconnecting to your server by either F8 quitting or force closing FiveM; this is a known issue with FiveM, not the multicharacter.

🔔 Always Restart Server Never restart the resource while the server is live; always restart the server to ensure no unforeseen issues.

SERVER-SIDE (database)

SQL Unknown Column Error?

eg., if you see an SQL error in the server console similar to this example - ER_BAD_FIELD_ERROR: Unknown colum 'max_chars' in 'where clause'.

✔️ You are missing one of the required database columns. The SQL file can be found in the "READ_ME_AFTER_PURCHASING" folder OR this specific column you have entered into the Config.Database table does not exist in the DatabaseTable.

SQL Table Doesn't Exist Error?

eg., if you see an SQL error in the server console similar to this example - ER_NO_SUCH_TABLE: Table 'exampletable' dosesn't exist'.

✔️ You have added this ”exampletable” into the Config.Database table but it does not exist in your database. Remove it from the Config.DatabaseTable.

SQL Duplicate Entry Error? (datastore table)

eg., if you see an SQL error saying you have a duplicate entry in the datastore table similar to this: [ERROR] [MySQL] An error happens on MySQL for query "INSERT INTO datastore_data (name, owner, data) VALUES ('property', 'steam:111738473874', '{}')": ER_DUP_ENTRY: Duplicate entry 'property-steam:111738473874' for key 'index_datastore_data_name_owner'.

✔️ There is a public fix for such issues on the [] or this can be avoided by using the advanced method.

SERVER-SIDE

Characters not saving after re-logging?

eg., if your characters don't save after you create them or some data is not being saved in the database.

✔️ Then most likely the length of the columns in your database tables have not been automatically set to 50. You need to do this because if you are using the r* license identifier type, the length of this identifier along with the extra Char1:  make the total length of the identifier more than the maximum default length of 40 characters. You can manually change the length of the identifier column in your HeidiSQL/PhpMyAdmin database viewer.

All of my characters are default peds with no character info?

eg., if you see default peds with no character information being display when you are certain you have characters saved in the database.

✔️ This is something to do with your characters identifiers in the users table. The identifier the script is using does not match your characters identifier in the users database table, you will need to compare the 2. This usually happens when you have a modified framework which uses steamid’s (Char1:110000105bdca75) for example but the default framework uses rockstar license (Char1:23498202342384729830327487320) so the script can not find the identifier in the users database table.

UI not displaying the correct sex?

eg., if you see "Non-Binary" on the character selection UI, this means the script could not find one of the standard sex types eg., m, male, f, female in the sex column for this character in the users database table. And if you see "Autosexual" that means the sex column for one of your characters is empty.

✔️ This means your identity script is not adding the correct data to the database so you should check why. But a quick fix is to manually add m into the sex column which is currently empty.

CLIENT-SIDE

Ped visible on first spawn?

eg., if you see your ped when first loading into the server before the character selection screen activates.

✔️ This should not happen, there should be a black screen, so means another script is conflicting. This is most likely caused by 1 line of code in es_extended or essentialmode or spawnmanager. Search for DoScreenFadeIn in the client-side of either of these resources and remove it then restart your server. (It could be in other resources too but these are the common ones).

Ped in front of camera?

eg., if you see your player's ped standing in front of the camera during the character selection screen.

✔️ Modify the Config.Cam x, y, z coordinates of the camera in the config.lua. This will most likely be trial and error on your side to get the correct camera position.

No such export GetPedList in resource skinchanger?

eg., if you see an error similar to this in the client F8 console.

✔️ This could either mean you have not complete Step 7 correctly, or the name your skinchanger script has been changed. The easy fix is to make sure the name of your skinchanger script is skinchanger Or rename the export in the client_customise_me.lua to the name of your renamed skinchanger script.

Character floating in the sky

✔️ Remove this line from the fxmanifest.lua in your loading screen resource -loadscreen_manual_shutdown 'yes'.

Issues with skins not loading?

eg., if your peds skins are not loading.

✔️ This is caused by low end spec PC's or server hosting. There's two working solutions to solving this issue.

Fix 1: Add a Wait prior to the event that loads the skin to give ample time for it to load in correctly. Example below from the client_customise_me.lua of where the wait should be added:
if Config.SkinScript == 'esx_skin' then       
    Wait(3000)            
    TriggerEvent('skinchanger:loadSkin', skin)

Fix 2: Remove the default ped integration within es_extended. It should look similar to the code blocks below. Example below needs this code block hashed out/removed from the main.lua of the client of es_extended:
if GetEntityModel(PlayerPedId()) == GetHashKey('PLAYER_ZERO') then
    local defaultModel = GetHashKey('a_m_y_stbla_02')
    RequestModel(defaultModel)

    while not HasModelLoaded(defaultModel) do
        Citizen.Wait(10)
    end

    SetPlayerModel(PlayerId(), defaultModel)
    SetPedDefaultComponentVariation(PlayerPedId())
    SetPedRandomComponentVariation(PlayerPedId(), true)
    SetModelAsNoLongerNeeded(defaultModel)
end

Characters not showing but blue arrows do show

eg., if your character is not showing but the blue arrows are showing.

✔️ Replace the SetCoords function in the funtions.lua with the function below:
function SetCoords(coords)
    local ped = PlayerPedId()
    RequestCollisionAtCoord(coords.x, coords.y, coords.z) local timeout=0 while not HasCollisionLoadedAroundEntity(ped) and timeout <=1000 do RequestCollisionAtCoord(coords.x, coords.y, coords.z) Citizen.Wait(10) timeout=timeout+1 end
    SetEntityCoords(ped, coords.x, coords.y, coords.z)
    SetEntityHeading(ped, coords.h)
end

ERROR CODES

665 - This is because you have copied and pasted the Config.DatabaseTables from an old version or from esx_kashacters. Use the table format from the default config and add to it.

634 - There is an error in the GetSkin() function in the configs/client_customise_me.lua. Please try to troubleshoot this yourself before contacting support.

778 - The sex column for one of your characters in the users database table is empty. It should contain m, male, f, female etc., in a string format. This means your identity script is not adding the correct data to the database so you should check why. But a quick fix is to manually add m into the database column which is currently empty.

897/654 - The GetIdentifier function in the server_customise_me.lua is returning a nil value, when it should be returning the player's identifier as a string. This is because the string inside the Config.ESX_version is invalid. Only one of the following options is acceptable: [ '1.1' / '1.2' / '1.final' / 'exm' / 'legacy' ], or because the Config.Identifiertype has a typo in it.

331/487/905 - The GetUserInfos function in the server_customise_me.lua is not returning a table. This is most likely due to an issue in the database. You can try removing the characters for the player(s) having the issue and tell them to relog. But you still need to debug this yourself.

5647 - The player’s maximum character amount in the max_chars column in the user_lastcharacter database table is more than the available ped spawn locations in the config.lua’s Config.PedSpawnCoords. You need to add more locations to match with the maxium amount of characters you allow a player to have.

6745665 / 5154 - The sex inside the skin column in the users database table should be a number, but currently, it is not. You need to find out why esx_skin is not saving the data correctly. A temp fix is to change the value to 0.

6841 - The SpawnPeds function in the client_customise_me.lua is not returning a table. If the error print says that it‘s returning nill, then that means the Config.SkinScript is invalid. If not then you need to debug this yourself.

6846854 - This is because there are limits to the number of .ymt’s that can be assigned to a freemode ped: build 1604‘s limit is 14, build 2189’s limit is 6, build 2372’s limit is 4.

FRESH TEST SERVER

PLEASE READ: The only purpose of the steps below is to help you debug the multicharacter script if you are having issues that are not common andunable to debug the cause of the issues.

We recommend you do this on a test server/local host.

Test Environment Setup

  • Operating System: Windows 10

  • MySQL Database Server: 10.4.13-MariaDB

  • OneSync: Infinity

Guide

Step 1 - Download Server Files

Download our full FiveM Server folder from our GitHub.

Step 2 - Add License Key

Step 3 - Import Database

Step 4 - Add Codesign Scripts

Make sure you download the latest versions of cd_multicharacter / cd_spawnselect / cd_identity and add them into the [Codesign] folder.

Now start the server, create a character, relog and choose your newly created character.

CHANGELOG

Files Changed

Not every update requires you to replace the whole folder. We do this because we understand it's a pain to redo the configs for every update.

  • All Files - This means you should delete your old cd_multicharacter folder, download and add in the latest version, reconfigure the configs folder and restart your server.

  • All Files Except config.lua - This means you should do all of the above (in the All Files section) but additionally make a backup of the config.lua file and replace the new config.lua file with the one you made a backup of.

  • Specific Files - This means you can copy and paste the SPECIFIC new files over the old ones and restart the server.

Update Type

On rare occasions, you are forced to update to the latest version. Mostly due to authentication updates where the old versions will no longer work.

  • Mandatory - This means you MUST update to this new version, or the old versions will no longer work.

  • Optional - This means it's completely your choice whether you wish to update to the latest version. But we do not offer support for old versions for obvious reasons; they are old.

Skipping Updates

If you are attempting to update to the latest version but have skipped previous updates, you should update all files just to be safe. For example., let's say you are currently on v4.0.1, you did not update when v4.0.2 was released, and now v4.0.3 is released, and you want to update; you should always use the “All Files” update method.

26/12/2020 - 10/08/2021

v3.0.0 - v3.2.0

Files Changed:

Update Type:

Changelog:

Add

  • Added in the "kashactersS:CharacterChosen" which will send the charid just like esx_kashacters does so scripts that use this will not need modifying.

  • Added the ability to switch characters in game using a chat command.

  • Added easier to understand error handling methods.

  • Added support for the use of ghmattimysql along side mysql.

  • Added support EXM (essentialmode).

  • Added support for modified versions of es_extended which use a different identifier type. For example if you use esx 1.2 but you have modified it to use steamid instead of license.

  • Added the ability to rename all esx events such as the setjob and playerloaded events.

  • Added the option to only allow players to switch characters at set locations using a command or keypress and optional blips on the map.

  • Added drag and drop support for the new esx legacy version.

  • Added support for the use of ped models on the character selection screen.

  • Added the ability to customize the job name which is displayed on the UI without compromising the optimization.

  • Added extra checks to make sure that incompatible database tables that people add to the Config.DatabaseTables such as user_lastcharacter etc do not get ran as that would cause a script breaking problem.

Edit

  • Made modifications for this to work out of the box with "cd_identity".

  • Changed "Database cleaner" to be a command instead of being used every restart as its only really needed to be used once every week to a month.

  • Modified the "Config.DatabaseTables" to be easier to understand for new people.

  • Updated the codesign error handlers.

  • Updated the SetAllMaxChars console command to also update the max_chars column default value in the user_lastcharacter database table with the new value.

  • Added some extra fail-safe checks to ensure stability - If a player's maximum character limit in the user_lastcharacter database table is larger than the maximum amount of ped coordinates that the script is currently configured for, the script will fix itself and show the default 5 characters as a temporary fix until the server devs can resolve the issue.

  • Added checks so the spawnmanager exports are only triggered for certain versions of esx.

  • Fixed compatibility with linden_inventory.

  • When you change the Config.DefaultCharAmount it will automatically modify the default maximum character value in the database.

  • All of your Config.DatabaseTables identifier column lengths are automatically checked and set to the minimum value of 50 if needed.

  • All of the code required to add compatibility with other clothing/skin resources is now available to edit.

  • Your chosen characters skin data is now sent to the CharacterHasLoaded_EXISTING function in order to reduce SQL queries.

  • Removed some config options which ask you if you are using other Codesign resources and replaced them the GetResourceState() FiveM native to ensure people don't misconfigure the config which would cause script breaking problems.

  • Moved the code to change the location of the peds to the config to be more ”new developer friendly“.

  • Removed some unneeded config options and rewrote the config to be more "new developer friendly".

  • Removed some unneeded SQL queries along with greatly optimising others such as the get character data quiey and the get skin queries.

  • Rewrote huge portions of the server and the client side code to be more optimized.

Fix

  • Fixed random server error on server start.

  • Fixed the typo with the "Delete" button on the UI.

  • Optimised server side.

  • Fixed a typo with the "kashactersS:CharacterChosen" trigger event sending the wrong data.

  • Fixed a random crash on linux servers.

  • Small minor clean-ups.

  • Fixed a typo causing which caused errors when using only 1 character

  • Fixed a bug causing the drawtextui for the switch character to not work correctly.

  • Fixed a typo causing the advanced multi character method to not work correctly.

  • Test fix for a NUI state related issue.

  • Fixed the trigger event to initialise esx.

  • Fixed the bug where sometimes your ped would fall when first spawning.

  • Added better checks to make sure your ped and other players peds are invisible during the character selection.

  • Fixed the Config.Emoji not being able to be disabled.

  • Temporary fix for the canary issue until the new Tebex FiveM license system is ready to launch, when this is released we will be fully switching over to the new system.

  • Fixed compatibility with cui_character (read the read me and complete the newly edited steps).

  • Switching characters in game is no longer experimental and now should be fully ready to use.

    • Fixed the bug where when you switch characters in game and create a new character it would show your previous characters clothes instead of a default ped.

    • Hide the esx hud during the character selection screen when switching character in game.

    • Fixed the screen fade not fully disabling when switching character in game

    • Force save the coords of your previous character when you switch character in game.

  • Fixed the "xPlayer is nil" errors in external resources such as cd_spawnselect or cd_identity etc when triggering events from the multicharacter after the player chosen their character, as now these events will only be triggered after ESX has fully loaded a players character data.

  • Re-added and improved the code to shut down the loading screen early to avoid seeing the bridge as long.

05/11/2021

Files Changed:

Update Type:

Changelog:

Authentication

  • We are now using the official Authentication System provided by FiveM. The old auth system will be taken offline 1 week from now (give or take a few days if needed).

Add

  • Added compatibility for oxmysql

08/11/2021

Files Changed:

fxmanifest.lua - (IMPORTANT)
server/main/server.lua - (IMPORTANT)
client/main/client.lua - (IMPORTANT)
html (FULL FOLDER) - (IMPORTANT)

Update Type:

Changelog:

Authentication

  • Small authentication update to ensure stability.

25/04/2022

Files Changed:

Update Type:

Changelog:

Add

  • Added a new config option for ESX legacy 1.6.x.

  • Added support for the latest oxymysql.

Edit

  • Automated one of the installation steps (database tables) to ensure an easier installation.

  • Added more fail-safe checks to warn you of typos you made in the config which could break the script.

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 on the lines you possibly need to change.

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 at the end of each line so you can understand what each config option does.

The most important sections are the options under the and sections at the top of the config.lua. Everything else is optional.

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

Part 1: Find the block of code that looks similar to the examples below in the client-side main.lua and the code.

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 .

WARNING If you are not 100% sure what you are doing here we would not recommend doing this, but if you insist please read the information before implementing these changes. If you are unsure what this does, read more about it on our .

View the and examples here.

View the and examples here.

View the and examples here.

View the and examples here.

View the and examples here.

View the and examples here.

These keys can be modified and/or disabled in the section of the [configs/config.lua].

These chat commands can be renamed and/or disabled in the section of the [configs/config.lua].

(console command)

Please check out our before contacting our support.

eg., if your character is floating in the sky ().

If you see an error code not listed below please open a script support ticket in the .

FiveM Server Artifacts:

Database Viewer:

FiveM MySQL Resource:

Framework:

Do you use esx_skin?

Do you use cui_character?

Open the server.cfg and add in your .

Buy Here
FiveM Forums Post
YouTube Showcase Video
here
Click here to translate this page.
How do I change language?
FiveM’s Keymaster
commenting
”commented out help text”
Framework
Important
HeidiSQL
PHPMyAdmin
View the Example here.
View the Example here.
View the Example here.
View the Example here.
View the Example here.
View the Example here.
comment out
Example 1
Example 2
example
Web Store
Example 1: Do not change this.
Example 2: Change this.
Before
After
Before
After
Before
After
Before
After
Before
After
Before
After
Keys and Commands
Keys and Commands
Troubleshooting Guide
like this
Codesign Discord
Latest Recommended (5562)
HeidiSQL Version 11.3.0.6295 (64 Bit)
mysql-async Version 3.3.2
ESX Legacy
Download this version.
Download this version.
licenseKey
Watch this video if you are unsure how to do this.
Github
Read here before using.
7KB
Multicharacter_Test.sql