- Joined
- Apr 29, 2008
- Messages
- 1,297
- Reaction score
- 509
Hmm, i got this idea from Roamer from this thread http://forum.ragezone.com/showthread.php?p=3757381
So i just made this out of boredom
Add this to your MapleCharacter.java
And this to your CommandProcessor.java
Btw, you can either change !ban to this one
or just change this to something else like !banacc
Btw, didnt test this.
If it doesnt work tell me please.
Ty
So i just made this out of boredom
Add this to your MapleCharacter.java
Code:
public void Ban(String reason) {
if (lastmonthfameids == null) {
throw new RuntimeException("Trying to ban a non-loaded character (testhack)");
}
try {
Connection con = DatabaseConnection.getConnection();
PreparedStatement ps = con.prepareStatement("UPDATE accounts SET banned = ?, banreason = ? WHERE id = ?");
ps.setInt(1, 1);
ps.setString(2, reason);
ps.setInt(3, accountid);
ps.executeUpdate();
ps.close();
} catch (SQLException ex) {
log.error("Error while banning", ex);
}
client.getSession().close();
}
And this to your CommandProcessor.java
Btw, you can either change !ban to this one
or just change this to something else like !banacc
Code:
} else if (splitted[0].equals("!ban")) {
if (splitted.length < 3) {
new ServernoticeMapleClientMessageCallback(2, c).dropMessage("Syntaxhelper : Syntax: !ban charname reason");
return true;
}
String originalReason = StringUtil.joinStringFrom(splitted, 2);
String reason = c.getPlayer().getName() + " banned " + splitted[1] + ": " +
originalReason;
MapleCharacter target = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
if (target != null) {
String readableTargetName = MapleCharacterUtil.makeMapleReadable(target.getName());
target.Ban(reason);
mc.dropMessage("Banned " + readableTargetName + " reason: " + originalReason);
} else {
if (MapleCharacter.ban(splitted[1], reason, false)) {
mc.dropMessage("Offline Banned " + splitted[1]);
} else {
mc.dropMessage("Failed to ban " + splitted[1]);
}
}
Btw, didnt test this.
If it doesnt work tell me please.
Ty