mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-31 18:28:52 +00:00
feat(es_extended): /removeaccountmoney
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user