Commands for Donation Points System

Results 1 to 4 of 4
  1. #1
    Member VaD NeRdRaGe is offline
    MemberRank
    Aug 2010 Join Date
    TexasLocation
    67Posts

    Commands for Donation Points System

    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
    Code:
           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;
            }
        }
    ADD to GM.java or Admins.java
    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.");
                }
    AND add anywhere where the CommandDefiniton's are listed except the very bottom unless you know what your doing, preferably in middle.
    Code:
                new CommandDefinition("givedpoints", 3), //use 4 instead of 3 if you put this into Admins.java
    @dpoints Command - Shows how many Donation Points you have.
    Add to PlayerCommands.java
    Code:
    	                 } else if (splitted[0].equals("@dpoints")) {
                mc.dropMessage("You have " + player.getDonationPoints() + "Donation Points");
    AND (just like you did with givedpoints)
    Code:
             new CommandDefinition("dpoints", 0),
    @donate Command - Tells you how many points you get for donating and how to donate.
    Add to PlayerCommands.java
    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).");
    AND:
    Code:
             new CommandDefinition("donate", 0),
    Good luck and please LIKE if this helped you.


  2. #2
    Member CEO is offline
    MemberRank
    Feb 2012 Join Date
    94Posts

    Re: Commands for Donation Points System

    WTF? U just copy the !giftnx command, edit it and release

  3. #3
    Alpha Member Soulfist is offline
    MemberRank
    Dec 2010 Join Date
    a hovelLocation
    1,835Posts

    Re: Commands for Donation Points System

    Quote Originally Posted by CEO View Post
    WTF? U just copy the !giftnx command, edit it and release
    He has to start somewhere I guess. The least he could do is give credit though.

    @TS

    It'd be more believable if you modified the code completely instead of just substituting variable names.

  4. #4
    Member VaD NeRdRaGe is offline
    MemberRank
    Aug 2010 Join Date
    TexasLocation
    67Posts

    Re: Commands for Donation Points System

    Quote Originally Posted by CEO View Post
    WTF? U just copy the !giftnx command, edit it and release
    now why the hell would I start from scratch when I could copy paste and edit something that will do exactly the same thing that I need it to do? Easy, Simple, and took 5 minutes :) My source files didn't have this command so im sure there are some people who may not have this so i released my work in case any new people needed.

    Quote Originally Posted by Soulfist View Post
    He has to start somewhere I guess. The least he could do is give credit though.

    @TS

    It'd be more believable if you modified the code completely instead of just substituting variable names.
    Uhh? Okay.. credits to whom ever created the !giftnx, or which ever one i used cuz I dont remember.. command from XiuzSource.. ??



Advertisement