QB Installation

Follow Below for installation for a Fresh Installation.

No backwards compatibility is required.

1. Modify qb-multicharacter > server

  • This is only for other resources that use this callback, but we wont use it anymore because we will call the export directly in the client. But its basically the same thing.
  • Go to the callback definition for qb-multicharacter:server:getSkin around line 183 in server/main.lua and change it to:
    QBCore.Functions.CreateCallback("qb-multicharacter:server:getSkin", function(_, cb, cid)
        local appearance = exports.bl_appearance:GetPlayerAppearance(cid)
        if not appearance then 
            return cb(nil)
        end
        cb(appearance.model, appearance.skin)
    end)

2. Modify qb-multicharacter > client

  • Go to the cDataPed callback around line 206 in client/main.lua and replace the event with the following:

    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 resolved_data = exports.bl_appearance:GetPlayerPedAppearance(cData.citizenid) or {}
                local resolved_model = resolved_data.model
     
                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
     
            model = model ~= nil and tonumber(model) or false
     
            if model ~= nil then
                initializePedModel(model, data)
            else
                initializePedModel()
            end
            cb("ok")
        else
            initializePedModel()
            cb("ok")
        end
    end)
    • Modify initializePedModel around line 34 in client/main.lua and replace it with the following:
    local function initializePedModel(model, data)
        CreateThread(function()
            if not model then
                model = joaat(randommodels[math.random(#randommodels)])
            end
            loadModel(model)
            charPed = CreatePed(2, model, Config.PedCoords.x, Config.PedCoords.y, Config.PedCoords.z - 0.98, Config.PedCoords.w, false, true)
            SetPedComponentVariation(charPed, 0, 0, 0, 2)
            FreezeEntityPosition(charPed, false)
            SetEntityInvincible(charPed, true)
            PlaceObjectOnGroundProperly(charPed)
            SetBlockingOfNonTemporaryEvents(charPed, true)
            if data and data.model then
                exports.bl_appearance:SetPedAppearance(charPed, data) 
            end
        end)
    end

3. Remove previous dependencies

  • Remove qb-clothing, illenium-appearance or any other apperance resource you have.
  • Remove qb-clothing from the dependencies in fxmanifest.lua of qb-houses and qb-apartments
  • Remove any other appearance resources dependencies you had.