my ipban wont work. look
and yes my ipbans.txt is in my config folder ive tried both of these
it will kick the user but not IPban them.. how do i get this to work?
even after if u ban there account or kick them it sitll doesnt wright it to ipbans.txt in the config folder
Code:
if (command.startsWith("ipban") && (playerRights >= 1)) {
try {
String victim = command.substring(6);
int index = PlayerHandler.getPlayerID(victim);
client v = (client) server.playerHandler.players[index];
if (index != 0) {
writeLog(v.connectedFrom, "bannedips");
writeLog(playerName + " IP banned " + victim + ".", "ipbanlogs");
v.disconnected = true;
sendMsg("You have sucessfully IP banned "+v.playerName+".");
} else {
sendMsg("The person you have tried to IP ban isn't online.");
}
} catch (Exception e) {
sendMsg("An error has occured while attempting to IP ban that player.");
}
}
and also
Code:
if (command.startsWith("ipban") && playerRights > 1) {
try {
String otherPName = command.substring(6);
int otherPIndex = PlayerHandler.getPlayerID(otherPName);
if (otherPIndex != -1) {
client p = (client) server.playerHandler.players[otherPIndex];
p.writeLog(p.playerLastConnect, "/config/ipbans.txt");
p.disconnected = true;
sM("You have ipbanned "+p.playerName+"!");
yell(" " + command.substring(6) + " Has been IPED from NewYear2009!");
} else {
sM("The name doesnt exist.");
}
} catch (Exception e) {
sM("Try entering a name you want to ip ban..");
}
}
it only kicks and doesnt ipban them what do i do?