💡New QBCore Adapt

The necessary codes for New QBCore frameworks are as follows.

Visit this folder for the changes we will make.

qb-core/server/player.lua

  • Find the specified function function QBCore.Player.Login(source, citizenid, newData)

  • Function should be found. else part of if citizenid then query should be opened

  • the function QBCore.Player.CheckPlayerData(source, newData) should be made as follows.

local required = QBCore.Player.CheckPlayerData(source, newData)
TriggerEvent('wais:sendNewCharacterData', required.source, required.cid, required.citizenid)

After pasting the code above, it should look like below.

function QBCore.Player.Login(source, citizenid, newData)
    if source and source ~= '' then
        if citizenid then
            local license = QBCore.Functions.GetIdentifier(source, 'license')
            local PlayerData = MySQL.prepare.await('SELECT * FROM players where citizenid = ?', { citizenid })
            if PlayerData and license == PlayerData.license then
                -- THESE PLACES ARE ACTUALLY FULL OF CODES
            else
                -- THESE PLACES ARE ACTUALLY FULL OF CODES
            end
        else
            local required = QBCore.Player.CheckPlayerData(source, newData)
            TriggerEvent('wais:sendNewCharacterData', required.source, required.cid, required.citizenid)
        end
        return true
    else
        -- THESE PLACES ARE ACTUALLY FULL OF CODES
        return false
    end
end
  • After this section is made as above, the following path should be followed.

  • function QBCore.Player.CreatePlayer(PlayerData, Offline) The specified function must be found and go to the last line of this function.

  • Then the following codes should be pasted

After pasting the code above, it should look like below.

Only the return code content in the last line is important. Pay no attention to other lines of code.

Last updated