Create /paytoggle command. Resolves #413

This commit is contained in:
Ali Moghnieh 2016-07-26 16:23:34 +01:00
parent f1d9cda5eb
commit 2493c655f8
No known key found for this signature in database
GPG key ID: F09D3A1BAF2E6D70
29 changed files with 131 additions and 0 deletions

View file

@ -44,6 +44,10 @@ public class Commandpay extends EssentialsLoopCommand {
protected void updatePlayer(final Server server, final CommandSource sender, final User player, final String[] args) throws ChargeException {
User user = ess.getUser(sender.getPlayer());
try {
if (!player.isAcceptingPay()) {
sender.sendMessage(tl("notAcceptingPay", player.getDisplayName()));
return;
}
user.payUser(player, amount);
Trade.log("Command", "Pay", "Player", user.getName(), new Trade(amount, ess), player.getName(), new Trade(amount, ess), user.getLocation(), ess);
} catch (MaxMoneyException ex) {