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:getSkinaroundline 183inserver/main.luaand 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
cDataPedcallback aroundline 206inclient/main.luaand 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
initializePedModelaroundline 34inclient/main.luaand 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 - Modify
3. Remove previous dependencies
- Remove
qb-clothing,illenium-appearanceor any other apperance resource you have. - Remove
qb-clothingfrom thedependenciesinfxmanifest.luaofqb-housesandqb-apartments - Remove any other appearance resources dependencies you had.