From 10e184afb0d0886ae34f1fe2570f56306e85c4b5 Mon Sep 17 00:00:00 2001 From: Jim Shield Date: Thu, 18 Jan 2024 00:52:00 +0000 Subject: [PATCH] move old/new qbcore info fixes --- wrapper.lua | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/wrapper.lua b/wrapper.lua index 33bb1f4..1aa09dd 100644 --- a/wrapper.lua +++ b/wrapper.lua @@ -1083,12 +1083,21 @@ function getPlayer(source) local Player = {} bank = info.Functions.GetMoney("bank"), } elseif GetResourceState(QBExport):find("start") and not GetResourceState(QBXExport):find("start") then - local info = exports[QBExport]:GetPlayer(src) - Player = { - name = info.PlayerData.charinfo.firstname.." "..info.PlayerData.charinfo.lastname, - cash = info.PlayerData.money["cash"], - bank = info.PlayerData.money["bank"], - } + if Core.Functions.GetPlayer ~= nil then -- support older qb-core functions + local info = Core.Functions.GetPlayer(src).PlayerData + Player = { + name = info.charinfo.firstname.." "..info.charinfo.lastname, + cash = info.money["cash"], + bank = info.money["bank"], + } + else + local info = exports[QBExport]:GetPlayer(src).PlayerData + Player = { + name = info.charinfo.firstname.." "..info.charinfo.lastname, + cash = info.money["cash"], + bank = info.money["bank"], + } + end end else if GetResourceState(ESXExport):find("start") and ESX ~= nil then