Base: delta
Problem:unmute command doesnt unmute (remove name form list) or send the messages..
Errors(Compiling Errors):none
Other Information/Media(Pictures, etc):
Code:
if (command.startsWith("unmute") && playerRights > 0) {
try {
StringTokenizer st = new StringTokenizer(command, "-");
if(st.countTokens() == 2) {
st.nextToken();
String otherPName = st.nextToken();
int otherPIndex = PlayerHandler.getPlayerID(otherPName);
if (otherPIndex != -1) {
client p = (client) server.playerHandler.players[otherPIndex];
deleteFromFile("./Data/Mutes.txt", p.connectedFrom);
p.muted = false;
p.sM("You have been un-muted by " + playerName);
}
sM(otherPName + " has been un-muted.");
}
} catch (Exception e) {
sM("Try entering a name you want to unmute..");
}
}
if (command.startsWith("mute") && playerRights > 0) {
try {
String otherPName = command.substring(5);
int otherPIndex = PlayerHandler.getPlayerID(otherPName);
if (otherPIndex != -1) {
client p = (client) server.playerHandler.players[otherPIndex];
p.muted = true;
writeLog(p.playerName, "mutes");
sM("You have muted "+p.playerName+"!");
} else {
sM("The name doesnt exist.");
}
} catch (Exception e) {
sM("Try entering a name you want to mute..");
}
}