donor Changing donor status in game!

Joined
Apr 29, 2008
Messages
1,297
Reaction score
509
Location
Malaysia
Here's a release that lets you make someone a donor using a command in game.
Tested and working =)
If you're going to use this.
Give me credits please. Thank you

Credits goes to :
Me ( For making this )
nejevoli ( For giving me the idea and testing )



Add this to MapleCharacter.java
Code:
        public void makeDonor() {
            	client.getSession().close();
		try {
			Connection con = DatabaseConnection.getConnection();
			PreparedStatement ps = con.prepareStatement("UPDATE characters SET donator = ? WHERE accountid = ?");
			ps.setInt(1, 1);
			ps.setInt(2, accountid);
			ps.executeUpdate();
			ps.close();
		} catch (SQLException ex) {
			log.error("Error while changing status", ex);
		}
	}
        
        public void unDonor() {
            	client.getSession().close();
		try {
			Connection con = DatabaseConnection.getConnection();
			PreparedStatement ps = con.prepareStatement("UPDATE characters SET donator = ? WHERE accountid = ?");
			ps.setInt(1, 0);
			ps.setInt(2, accountid);
			ps.executeUpdate();
			ps.close();
		} catch (SQLException ex) {
			log.error("Error while changing status", ex);
		}
	}

Btw, check the donator column in your MySQL and change donator to yours. Example = donor. In both statements

Add this to CommandProcessor.java
Code:
                        } else if (splitted[0].equals("!donor")) {
				MapleCharacter target = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
				target.makeDonor();
				mc.dropMessage("Changed donor status for " + target) ;
                        } else if (splitted[0].equals("!undonor")) {
				MapleCharacter target = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
				target.unDonor();
				mc.dropMessage("Changed donor status for " + target) ;

Use !undonor to make someone a normal player
!donor to make someone a donor
 
Re: [Release]!donor Changing donor status in game!

this is kool can it be reservered or restricted to admin only and not all GMs ?
 
Re: [Release]!donor Changing donor status in game!

its easier threw the mysql but w/e bro i wont complain
 
Re: [Release]!donor Changing donor status in game!

Code:
        public void makeDonor() {
            	client.getSession().close();
		try {
			Connection con = DatabaseConnection.getConnection();
			PreparedStatement ps = con.prepareStatement("UPDATE characters SET donator = ? WHERE accountid = ?");
			ps.setInt(1, 1);
			ps.setInt(2, accountid);
			ps.executeUpdate();
			ps.close();
		} catch (SQLException ex) {
			log.error("Error while changing status", ex);
		}
	}
I'm not getting how the MySQL works right now. It's not working for me.
Shouldn't
Code:
("UPDATE characters SET donator = ? WHERE accountid = ?");
be
Code:
("UPDATE characters SET donator = ? WHERE name = ?");
When I do !donor, it drops the correct message but there are no results.
 
Re: [Release]!donor Changing donor status in game!

cserv.getPlayerStorage().getCharacterByName(splitted[1]);
OH YEAH THIS TRANSLATE TO THE CHARACTER ID RIGHT?
then wouldn't you need the id, not account id?
 
Re: [Release]!donor Changing donor status in game!

==..
Code:
MapleCharacter target = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
Is to get the target when you use the command
So it can apply the effect ==..
The accountid is in MapleCharacter.
 
Re: [Release]!donor Changing donor status in game!

THat's what I was talking about...
It gets the character. Isn't that what I said? Well it still doesn't work for me. It drops the message that it is changed but there is no effect.

And for every other script, it's always UPDATE characters SET <thing> =? WHERE id = ?
 
Re: [Release]!donor Changing donor status in game!

Nice release dude , But theres any way to make Somebody Donor or Donator exactly when he donates via paypal? Like Nexon and NXCash XP
 
Re: [Release]!donor Changing donor status in game!

You can make it so when they press the donation button they can change their donator stuats to 1
 
Back