diff --git a/config.lua b/config.lua index f0dbf8d1f..3c773097b 100644 --- a/config.lua +++ b/config.lua @@ -8,6 +8,7 @@ QBConfig.StatusInterval = 5000 -- how often to check hu QBConfig.Money = {} QBConfig.Money.MoneyTypes = { cash = 500, bank = 5000, crypto = 0 } -- type = startamount - Add or remove money types for your server (for ex. blackmoney = 0), remember once added it will not be removed from the database! QBConfig.Money.DontAllowMinus = { 'cash', 'crypto' } -- Money that is not allowed going in minus +QBConfig.Money.MinusLimit = -5000 -- The maximum amount you can be negative QBConfig.Money.PayCheckTimeOut = 10 -- The time in minutes that it will give the paycheck QBConfig.Money.PayCheckSociety = false -- If true paycheck will come from the society account that the player is employed at, requires qb-management diff --git a/server/player.lua b/server/player.lua index 7b3363fa6..cbc503222 100644 --- a/server/player.lua +++ b/server/player.lua @@ -341,6 +341,7 @@ function QBCore.Player.CreatePlayer(PlayerData, Offline) end end end + if self.PlayerData.money[moneytype] - amount < QBCore.Config.Money.MinusLimit then return false end self.PlayerData.money[moneytype] = self.PlayerData.money[moneytype] - amount if not self.Offline then