add something like if muted return in your talking method.
|
Is there anything wrong with that its dosent mute them ?if (playerCommand.startsWith("mute")) {
try {
String playerToBan = playerCommand.substring(5);
Connection.addNameToMuteList(playerToBan);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
Client c2 = (Client)Server.playerHandler.players[i];
c2.sendMessage("You have been muted by: " + c.playerName);
break;
}
}
}
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}
}
add something like if muted return in your talking method.
did u fix it? cus i have same problem
Under talking packet, not sure which id
if (isMuted == true) {
return;
}
Okay, so I gathered some perhaps maybe a little useful intel...
when I type ::ban it adds the username to the Usersbanned document in the ban folder and the person logs out
when i type ::mute it adds the username to the UsersMuted document also in the ban folder and it sends the message "you have been banned by blah blah" but the person can still chat. I think it has something to do with the game not looking in the UsersMuted document but I'm not sure what file i would have to edit to make it look in there and not let a person speak.
here's the fix :
rep me if this helped.Code:if (playerCommand.startsWith("mute") && c.playerRights >= 1) { try { if(c.playerRights == 0 || c.playerRights == 5){ return; } String playerToBan = playerCommand.substring(5); Connection.addNameToMuteList(playerToBan); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) { Client c2 = (Client)Server.playerHandler.players[i]; c2.sendMessage("You have been muted by: " + c.playerName); break; } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } }
It's not a problem with the COMMAND it's deeper than that.. thanks for the help anyways, other people looking at this thread looking for a command fix will be thankful for you =]
but we still have our problem; the command is doing everything it should but the game just doesnt care. its not looking in the UsersMuted file still...
Anyone got any ideas??
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |