mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 03:01:31 +00:00
feat(inventory): implement maximum amount cap for account money transactions
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
local Inventory
|
||||
local MAX_AMOUNT = 1.79769e+308
|
||||
|
||||
if Config.CustomInventory ~= "ox" then return end
|
||||
|
||||
@@ -45,6 +46,7 @@ Core.PlayerFunctionOverrides.OxInventory = {
|
||||
setAccountMoney = function(self)
|
||||
return function(accountName, money, reason)
|
||||
reason = reason or "unknown"
|
||||
money = money <= MAX_AMOUNT and money or MAX_AMOUNT
|
||||
if money < 0 then return end
|
||||
local account = self.getAccount(accountName)
|
||||
|
||||
@@ -64,6 +66,7 @@ Core.PlayerFunctionOverrides.OxInventory = {
|
||||
addAccountMoney = function(self)
|
||||
return function(accountName, money, reason)
|
||||
reason = reason or "unknown"
|
||||
money = money <= MAX_AMOUNT and money or MAX_AMOUNT
|
||||
if money < 1 then return end
|
||||
|
||||
local account = self.getAccount(accountName)
|
||||
@@ -82,6 +85,7 @@ Core.PlayerFunctionOverrides.OxInventory = {
|
||||
removeAccountMoney = function(self)
|
||||
return function(accountName, money, reason)
|
||||
reason = reason or "unknown"
|
||||
money = money <= MAX_AMOUNT and money or MAX_AMOUNT
|
||||
if money < 1 then return end
|
||||
|
||||
local account = self.getAccount(accountName)
|
||||
|
||||
Reference in New Issue
Block a user