Kartik Scripts

um-multicharacter Setup

This guide details how to integrate kartik-clothing with um-multicharacter (by alp1t).

🛠️ Official File Edits

To add native kartik-clothing support into um-multicharacter, update the following two bridge files:

1. um-multicharacter/bridge/clothingexports.lua

Replace the contents of bridge/clothingexports.lua with:

function ClothingExports(cacheped, skinData)
    if GetResourceState('kartik-clothing') == 'started' then
        exports['kartik-clothing']:setPedAppearance(cacheped, skinData)
    elseif GetResourceState('bl_appearance') == 'started' then
        exports.bl_appearance:SetPlayerPedAppearance(skinData)
    elseif GetResourceState('rcore_clothing') == 'started' then
        exports.rcore_clothing:setPedSkin(cacheped, skinData)
    elseif GetResourceState('crm-appearance') == 'started' then
        exports['crm-appearance']:crm_set_ped_appearance(cacheped, skinData)
    elseif GetResourceState('tgiann-clothing') == 'started' then
        TriggerEvent("tgiann-clothing:client:loadPedClothing", skinData, cacheped)
    elseif GetResourceState('illenium-appearance') == 'started' then
        exports['illenium-appearance']:setPedAppearance(cacheped, skinData)
    elseif GetResourceState('fivem-appearance') == 'started' then
        exports['fivem-appearance']:setPedAppearance(cacheped, skinData)
    elseif GetResourceState('qb-clothing') == 'started' then
        TriggerEvent('qb-clothing:client:loadPlayerClothing', skinData, cacheped)
    elseif GetResourceState('0r-clothing') == 'started' then
        TriggerEvent('0r-clothing:client:loadPlayerClothing', skinData, cacheped)
    else
        Debug('You can add your own clothing exports here.')
    end
end

2. um-multicharacter/bridge/getskin.lua

Replace the contents of bridge/getskin.lua with:

lib.callback.register("um-multicharacter:server:getSkin", function(_, cid)
    if GetResourceState('kartik-clothing') == 'started' then
        local skin = exports['kartik-clothing']:getAppearance(cid)

        if not skin then
            return nil, nil
        end

        return skin.model, skin
    elseif GetResourceState('bl_appearance') == 'started' then
        local appearance = exports.bl_appearance:GetPlayerAppearance(cid)

        if not appearance then
            return nil, nil
        end

        return appearance.model, appearance
    elseif GetResourceState('rcore_clothing') == 'started' then
        local skin = exports.rcore_clothing:getSkinByIdentifier(cid)

        if not skin then
            return nil, nil
        end

        return skin.ped_model, skin.skin
    elseif GetResourceState('tgiann-clothing') == 'started' then
        local skin = MySQL.single.await('SELECT `model`, `skin` FROM `tgiann_skin` WHERE `citizenid` = ? LIMIT 1', { cid })

        if not skin then
            return nil, nil
        end

        return skin.model, json.decode(skin.skin)
    else
        local skinQuery = MySQL.single.await('SELECT * FROM playerskins WHERE citizenid = ? AND active = ? LIMIT 1',
            { cid, 1 })

        if skinQuery ~= nil then
            local skin = json.decode(skinQuery.skin)
            return skinQuery.model or skin.model or nil, skin
        end

        return nil, nil
    end
end)

On this page