qb-multicharacter (integration)

If you are using the qb-multicharacter you need to desarrollate this integration with the script:

  1. Open qb-multicharacter/client/main.lua

  2. Find the RegisterNUICallback('cDataPed', function(nData, cb) and reemplate it for this version:

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

        model = model ~= nil and tonumber(model) or false

        if model ~= nil then
            TriggerEvent('origen_clothing:client:qbPreview', {citizenid = cData.citizenid, coords = Config.PedCoords})
        else
            TriggerEvent('origen_clothing:client:qbPreview')
            initializePedModel()
        end
        cb("ok")
    else
        TriggerEvent('origen_clothing:client:qbPreview')
        initializePedModel()
        cb("ok")
    end
end)
  1. Enjoy!! 😄

Last updated