Im not sure if this has been released but this is something I decided to put together since I couldn't find it. This goes to [Add-On] Shroom's Donation Points system.
Don't flame, It's lame.
Enjoy, I tried to make this as noob proof as possible. I haven't tested this so if you see anything wrong then please speak up. Thank you :)
!givedpoints Command
-Add to MapleCharacter.java
ADD to GM.java or Admins.javaCode:public void modifyDonationPoints(int type, int quantity) { switch (type) { case 1: this.donationpoints += quantity; break; } } public int getDonationPoints(int type) { switch (type) { case 1: return this.donationpoints; default: return 0; } }
AND add anywhere where the CommandDefiniton's are listed except the very bottom unless you know what your doing, preferably in middle.Code:} else if (splitted[0].equals("!givedpoints")) { MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]); if (victim != null) { int amount; try { amount = Integer.parseInt(splitted[2]); } catch (NumberFormatException ex) { return; } int type = getOptionalIntArg(splitted, 3, 1); victim.modifyDonationPoints(type, amount); victim.dropMessage(5, player.getName() + " gave you " + amount + " Donation Points, Thanks for donating."); mc.dropMessage("DP recieved."); }
@dpoints Command - Shows how many Donation Points you have.Code:new CommandDefinition("givedpoints", 3), //use 4 instead of 3 if you put this into Admins.java
Add to PlayerCommands.java
AND (just like you did with givedpoints)Code:} else if (splitted[0].equals("@dpoints")) { mc.dropMessage("You have " + player.getDonationPoints() + "Donation Points");
@donate Command - Tells you how many points you get for donating and how to donate.Code:new CommandDefinition("dpoints", 0),
Add to PlayerCommands.java
AND:Code:} else if (splitted[0].equals("@donate")) { mc.dropMessage("1 Donation Point = $1 donation."); mc.dropMessage("Visit http://(YOUR LINK HERE) to donate to (Your Server Name Here).");
Good luck and please LIKE if this helped you.Code:new CommandDefinition("donate", 0),


Reply With Quote


