diff --git a/config.lua b/config.lua index af43f7c..9e8cd50 100644 --- a/config.lua +++ b/config.lua @@ -1,4 +1,6 @@ -Config = {} +Config = { + ox_inventory = false -- Enable if you're using ox_inventory +} Config.BusinessAccounts = { ['police'] = { -- Job Name diff --git a/server.lua b/server.lua index 19f57a4..4d99681 100644 --- a/server.lua +++ b/server.lua @@ -2,17 +2,29 @@ local QBCore = exports["qb-core"]:GetCoreObject() local function addCash(src, amount) local Player = QBCore.Functions.GetPlayer(src) - Player.Functions.AddMoney("cash", amount) + if Config.ox_inventory then + exports.ox_inventory:addCash(src,amount) + else + Player.Functions.AddMoney("cash", amount) + end end local function removeCash(src, amount) local Player = QBCore.Functions.GetPlayer(src) - Player.Functions.RemoveMoney("cash", amount) + if Config.ox_inventory then + exports.ox_inventory:removeCash(src,amount) + else + Player.Functions.RemoveMoney("cash", amount) + end end local function getCash(src) local Player = QBCore.Functions.GetPlayer(src) - return Player.PlayerData.money["cash"] or 0 + if Config.ox_inventory then + return exports.ox_inventory:getCash(src) or 0 + else + return Player.PlayerData.money["cash"] or 0 + end end local function loadPlayer(src, citizenid, name)