cui_character

cui_character

cui_character have troubles with skinchanger bridge, which is why you may need to do following changes.

server/main.lua

    RegisterServerEvent('esx_skin:save')
    AddEventHandler('esx_skin:save', function(data)
        charSave(data, source)
    end)

    RegisterServerEvent('cui_character:save')
    AddEventHandler('cui_character:save', function(data)
        charSave(data, source)
    end)

    function charSave(data, Source)
        local xPlayer = ESX.GetPlayerFromId(Source)

        if ESX.GetConfig and ESX.GetConfig().Multichar and xPlayer == nil then
            charSkins[Source] = data
            return
        else
            charSkins[Source] = nil
        end

        MySQL.ready(function()
            MySQL.Async.execute('UPDATE users SET skin = @data WHERE identifier = @identifier', {
                ['@data'] = json.encode(data),
                ['@identifier'] = xPlayer.identifier
            })
        end)
    end

client/main.lua

There are another ways around it, you can get a pre-done version :)

Last updated

Was this helpful?