mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-08 07:36:42 +02:00
Adding option to modify all users balances (including offline) /eco reset ** <amount>
This commit is contained in:
@@ -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())
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user