feat(es_extended): /removeaccountmoney

This commit is contained in:
Cyzxin
2023-05-25 08:57:50 +01:00
parent fff399dd48
commit de0d33b2f6
2 changed files with 24 additions and 0 deletions
+4
View File
@@ -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',
+20
View File
@@ -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)