QBCore

  • Remove qb-clothing script.

  • Delete 'qb-clothing' from dependencies from fxmanifest.lua in qb-apartments and qb-houses.

  • Replace code in qb-multicharacters.

---returns ped model and skin
local model, skin = lib.callback.await('nf-skin:server:getSkin', false, citizenId)

---updates ped skin
exports['nf-skin']:SetPedAppearance(pedId, skin)

---set up current player model and skin
exports['nf-skin']:SetPedModel(model, function(playerPed)
    exports['nf-skin']:SetPedAppearance(playerPed, skin)
end)
RegisterNUICallback('cDataPed', function(nData, cb)
    local cData = nData.cData
    SetEntityAsMissionEntity(charPed, true, true)
    DeleteEntity(charPed)
    if cData ~= nil then
        if not cached_player_skins[cData.citizenid] then
            local temp_model = promise.new()
            local temp_data = promise.new()

            QBCore.Functions.TriggerCallback('qb-multicharacter:server:getSkin', function(model, data)
                temp_model:resolve(model)
                temp_data:resolve(data)
            end, cData.citizenid)

            local resolved_model = Citizen.Await(temp_model)
            local resolved_data = Citizen.Await(temp_data)

            cached_player_skins[cData.citizenid] = {model = resolved_model, data = resolved_data}
        end

        local model = cached_player_skins[cData.citizenid].model
        local data = cached_player_skins[cData.citizenid].data

        -- CHANGE MODEL number to name
        model = model ~= nil and model or false

        if model ~= nil then
            initializePedModel(model, json.decode(data))
        else
            initializePedModel()
        end
        cb("ok")
    else
        initializePedModel()
        cb("ok")
    end
end)

Last updated