Installation
If you can't do something, open a ticket on discord and we'll fix it.
qb-core
You have to go here and find this. qb-core/server/player.lua find QBCore.Player.Save(source) and change :
function QBCore.Player.Save(source)
local ped = GetPlayerPed(source)
local pcoords = GetEntityCoords(ped)
local PlayerData = QBCore.Players[source].PlayerData
if PlayerData then
local result = MySQL.query.await('SELECT * FROM players WHERE citizenid=@citizenid', {['@citizenid'] = PlayerData.citizenid})
if result[1] == nil then
MySQL.insert('INSERT INTO players (citizenid, cid, license, name, money, charinfo, job, gang, position, metadata) VALUES (:citizenid, :cid, :license, :name, :money, :charinfo, :job, :gang, :position, :metadata) ON DUPLICATE KEY UPDATE cid = :cid, name = :name, money = :money, charinfo = :charinfo, job = :job, gang = :gang, position = :position, metadata = :metadata', {
citizenid = PlayerData.citizenid,
cid = tonumber(PlayerData.cid),
license = PlayerData.license,
name = PlayerData.name,
money = json.encode(PlayerData.money),
charinfo = json.encode(PlayerData.charinfo),
job = json.encode(PlayerData.job),
gang = json.encode(PlayerData.gang),
position = json.encode(pcoords),
metadata = json.encode(PlayerData.metadata)
})
else
MySQL.update("UPDATE players SET license = ?, name = ?, money = ?, charinfo = ?, job = ?, gang = ?, position = ?, metadata = ?", {
PlayerData.license,
PlayerData.name,
json.encode(PlayerData.money),
json.encode(PlayerData.charinfo),
json.encode(PlayerData.job),
json.encode(PlayerData.gang),
json.encode(pcoords),
json.encode(PlayerData.metadata),
})
end
if GetResourceState('qb-inventory') ~= 'missing' then exports['qb-inventory']:SaveInventory(source) end
QBCore.ShowSuccess(GetCurrentResourceName(), PlayerData.name .. ' PLAYER SAVED!')
else
QBCore.ShowError(GetCurrentResourceName(), 'ERROR QBCORE.PLAYER.SAVE - PLAYERDATA IS EMPTY!')
end
endAfter change: You have to go here and find this. qb-core/server/player.lua find QBCore.Player.SaveOffline(source)
qbx-core
You have to go here and find this. qbx-core/server/storage.lua find UpsertPlayerEntity(request)and change :
Last updated