feat(commands): prevent money overflow from blocking further transactions

This commit is contained in:
YOMAN1792
2025-02-25 16:47:05 -05:00
parent 221e23b2b7
commit 91e783c9e9
@@ -272,9 +272,13 @@ ESX.RegisterCommand(
"removeaccountmoney",
"admin",
function(xPlayer, args, showError)
local MAX_AMOUNT = 1.79769e+308
if not args.playerId.getAccount(args.account) then
return showError(TranslateCap("command_removeaccountmoney_invalid"))
end
if args.amount > MAX_AMOUNT then
return showError(("Amount must be between 1 and %s"):format(MAX_AMOUNT))
end
args.playerId.removeAccountMoney(args.account, args.amount, "Government Tax")
if Config.AdminLogging then
ESX.DiscordLogFields("UserActions", "Remove Account Money /removeaccountmoney Triggered!", "pink", {