money = Double.parseDouble(args[1]);
} catch (NumberFormatException e) {
return false;
}
Account victim = plugin.getShortenedAccount(args[0]);
if (victim == null) {
Phrase.ACCOUNT_DOES_NOT_EXIST.sendWithPrefix(sender);
return true;
}
if (!victim.canReceive(money)) {
Phrase.MAX_BALANCE_REACHED.sendWithPrefix(sender, victim.getName());
return true;
}
String formattedMoney = plugin.getAPI().format(money);
victim.deposit(money);
Phrase.PLAYER_GRANT_MONEY.sendWithPrefix(sender, formattedMoney, victim.getName());
Player receiverPlayer = plugin.getServer().getPlayerExact(victim.getName());
if (receiverPlayer != null) {
Phrase.PLAYER_GRANTED_MONEY.sendWithPrefix(receiverPlayer, formattedMoney, sender.getName());
}