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
Btw, check the donator column in your MySQL and change donator to yours. Example = donor. In both statements
Add this to CommandProcessor.java
Use !undonor to make someone a normal player
!donor to make someone a donor
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