From 36ce1524fbf1765971fe33db4b81c6bd3fd20313 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Tue, 22 Oct 2024 15:03:03 -0700 Subject: [PATCH 1/5] added config option to limit negative amount No Config option and since bank isn't listed in QBConfig.Money.DontAllowMinus then **any** script that has ``` if Player.Functions.RemoveMoney('bank'. Value) then ``` will allot them to go 11 characters negative causing massive exploits --- config.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/config.lua b/config.lua index f0dbf8d..69a4c85 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 From 06f7f6e96764155714ca68b6edcbc3afb370e009 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Tue, 22 Oct 2024 15:06:17 -0700 Subject: [PATCH 2/5] Update config.lua --- config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.lua b/config.lua index 69a4c85..3c77309 100644 --- a/config.lua +++ b/config.lua @@ -8,7 +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.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 From 080556c4256d8766d7586cd4fa0fd5f3bffad6d5 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Tue, 22 Oct 2024 15:07:23 -0700 Subject: [PATCH 3/5] checks to see if RemoveMoney has enough removes exploit to allow bank to be -99999999999 --- server/player.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/server/player.lua b/server/player.lua index 7b3363f..d446cf3 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 <= QBConfig.Money.MinusLimit then return false end self.PlayerData.money[moneytype] = self.PlayerData.money[moneytype] - amount if not self.Offline then From 1ce5dd831bf1b3c44db0f17eecb6bd915b6c4a52 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Thu, 7 Nov 2024 20:22:12 -0800 Subject: [PATCH 4/5] Update player.lua --- server/player.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/player.lua b/server/player.lua index d446cf3..dbf91b2 100644 --- a/server/player.lua +++ b/server/player.lua @@ -341,7 +341,7 @@ function QBCore.Player.CreatePlayer(PlayerData, Offline) end end end - if self.PlayerData.money[moneytype] - amount <= QBConfig.Money.MinusLimit then return false end + if self.PlayerData.money[moneytype] - amount < QBConfig.Money.MinusLimit then return false end self.PlayerData.money[moneytype] = self.PlayerData.money[moneytype] - amount if not self.Offline then From 304a6f42a04b3b953714c7276ad69575954f1bc6 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Thu, 7 Nov 2024 20:47:22 -0800 Subject: [PATCH 5/5] Update player.lua --- server/player.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/player.lua b/server/player.lua index dbf91b2..cbc5032 100644 --- a/server/player.lua +++ b/server/player.lua @@ -341,7 +341,7 @@ function QBCore.Player.CreatePlayer(PlayerData, Offline) end end end - if self.PlayerData.money[moneytype] - amount < QBConfig.Money.MinusLimit then return false 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