mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-12 12:23:59 +00:00
Adding option to modify all users balances (including offline) /eco reset ** <amount>
This commit is contained in:
parent
e28f1b1be3
commit
b16a1f7237
1 changed files with 25 additions and 1 deletions
|
@ -34,7 +34,31 @@ public class Commandeco extends EssentialsCommand
|
||||||
throw new NotEnoughArgumentsException(ex);
|
throw new NotEnoughArgumentsException(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args[1].contentEquals("*"))
|
if (args[1].contentEquals("**"))
|
||||||
|
{
|
||||||
|
for (String sUser : ess.getUserMap().getAllUniqueUsers())
|
||||||
|
{
|
||||||
|
final User player = ess.getUser(sUser);
|
||||||
|
switch (cmd)
|
||||||
|
{
|
||||||
|
case GIVE:
|
||||||
|
player.giveMoney(amount);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case TAKE:
|
||||||
|
if (player.canAfford(amount, false))
|
||||||
|
{
|
||||||
|
player.takeMoney(amount);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RESET:
|
||||||
|
player.setMoney(amount == 0 ? ess.getSettings().getStartingBalance() : amount);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (args[1].contentEquals("*"))
|
||||||
{
|
{
|
||||||
for (Player onlinePlayer : server.getOnlinePlayers())
|
for (Player onlinePlayer : server.getOnlinePlayers())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue