- Joined
- Apr 27, 2009
- Messages
- 19
- Reaction score
- 0
Code:
if (splitted[0].equalsIgnoreCase("!gift")) {
String type = splitted[2].toLowerCase();
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
int amount = Integer.parseInt(splitted[3]);
if (type.equalsIgnoreCase("mesos")) {
if (victim.getMeso() + amount > Integer.MAX_VALUE)
player.dropMessage(1, "If you give " + victim.getName() + " this many mesos, they will have more than " + Integer.MAX_VALUE + ".");
else {
victim.gainMeso(amount, true);
victim.dropMessage("[Server] " + player.getName() + " has just given you " + amount + " mesos.");
}
}else if (type.equalsIgnoreCase("nx")) {
victim.modifyCSPoints(1, amount);
victim.dropMessage(5, amount >= 0 ? "[Server] " + player.getName() + " has gifted you " + amount + " NX Cash." : "[Server] " + player.getName() + " has taken away " + amount + " NX Cash from you.");
}
}
Thanks to X-Stasis for fixing & cleaning it up.
Last edited:

