diff --git a/[core]/es_extended/locales/en.lua b/[core]/es_extended/locales/en.lua index eeb2f135..749eb13a 100644 --- a/[core]/es_extended/locales/en.lua +++ b/[core]/es_extended/locales/en.lua @@ -69,6 +69,10 @@ Locales['en'] = { ['command_giveaccountmoney_account'] = 'Account to add to', ['command_giveaccountmoney_amount'] = 'Amount to add', ['command_giveaccountmoney_invalid'] = 'Account Name Invalid', + ['command_removeaccountmoney'] = 'Remove Money from a specified Account', + ['command_removeaccountmoney_account'] = 'Account to remove from', + ['command_removeaccountmoney_amount'] = 'Amount to remove', + ['command_removeaccountmoney_invalid'] = 'Account Name Invalid', ['command_giveitem'] = 'Give Player an item', ['command_giveitem_item'] = 'Item name', ['command_giveitem_count'] = 'Quantity', diff --git a/[core]/es_extended/server/commands.lua b/[core]/es_extended/server/commands.lua index a9f5054b..8418f151 100644 --- a/[core]/es_extended/server/commands.lua +++ b/[core]/es_extended/server/commands.lua @@ -155,6 +155,26 @@ end, true, {help = TranslateCap('command_giveaccountmoney'), validate = true, ar {name = 'amount', help = TranslateCap('command_giveaccountmoney_amount'), type = 'number'} }}) +ESX.RegisterCommand('removeaccountmoney', 'admin', function(xPlayer, args, showError) + if not args.playerId.getAccount(args.account) then + return showError(TranslateCap('command_removeaccountmoney_invalid')) + end + args.playerId.removeaccountmoney(args.account, args.amount, "Government Tax") + if Config.AdminLogging then + ESX.DiscordLogFields("UserActions", "Remove Account Money /removeaccountmoney Triggered!", "pink", { + {name = "Player", value = xPlayer.name, inline = true}, + {name = "ID", value = xPlayer.source, inline = true}, + {name = "Target", value = args.playerId.name, inline = true}, + {name = "Account", value = args.account, inline = true}, + {name = "Amount", value = args.amount, inline = true}, + }) + end +end, true, {help = TranslateCap('command_removeaccountmoney'), validate = true, arguments = { + {name = 'playerId', help = TranslateCap('commandgeneric_playerid'), type = 'player'}, + {name = 'account', help = TranslateCap('command_removeaccountmoney_account'), type = 'string'}, + {name = 'amount', help = TranslateCap('command_removeaccountmoney_amount'), type = 'number'} +}}) + if not Config.OxInventory then ESX.RegisterCommand('giveitem', 'admin', function(xPlayer, args, _) args.playerId.addInventoryItem(args.item, args.count)