Example #1
0
	@Override
	public void takeMoney(final double value, final CommandSender initiator)
	{
		if (value == 0)
		{
			return;
		}
		setMoney(getMoney() - value);
		sendMessage(_("{0} has been taken from your account.", FormatUtil.displayCurrency(value, ess)));
		if (initiator != null)
		{
			initiator.sendMessage(_("{0} taken from {1} account. New balance: {2}", FormatUtil.displayCurrency(value, ess), this.getPlayer().getDisplayName()));
		}
	}
Example #2
0
	@Override
	public void payUser(final IUser reciever, final double value) throws Exception
	{
		if (value == 0)
		{
			return;
		}
		if (canAfford(value))
		{
			setMoney(getMoney() - value);
			reciever.setMoney(reciever.getMoney() + value);
			sendMessage(_("{0} has been sent to {1}", FormatUtil.displayCurrency(value, ess), reciever.getPlayer().getDisplayName()));
			reciever.sendMessage(_("{0} has been received from {1}", FormatUtil.displayCurrency(value, ess), getPlayer().getDisplayName()));
		}
		else
		{
			throw new Exception(_("You do not have sufficient funds."));
		}
	}