Thread: [PI]Mute Command

Results 1 to 7 of 7
  1. #1 [PI]Mute Command 
    Registered Member
    Join Date
    Mar 2009
    Posts
    17
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    Code:
    			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.");
    				}			
    			}
    Can some ellaborate please why this wont work?
    the command works, it messages the muted player "you have been muted by .." but they can carry on talking o.-'
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Jan 2009
    Age
    31
    Posts
    2,661
    Thanks given
    66
    Thanks received
    207
    Rep Power
    0
    First of all add this add the very top of the method.

    Code:
    String[] cmd = playerCommand.split(" ");
    cmd[0] = cmd[0].toLowerCase();
    now add this

    Code:
    else if (cmd[0].equals("mute")) {
    	if(cmd.length == 2) {
    		Connection.addNameToMuteList(cmd[1]);
    		for(Player p : Server.playerHandler.players) {
    			if(p.playerName.equals(cmd[1])) {
    				Client c = (Client) p;
    				c.sendMessage("Your have been muted by: "+playerName);
    			}
    		}
    	}
    }
    Reply With Quote  
     

  3. #3  
    Registered Member Richie's Avatar
    Join Date
    Sep 2009
    Age
    28
    Posts
    791
    Thanks given
    81
    Thanks received
    18
    Rep Power
    6
    Quote Originally Posted by digistr View Post
    First of all add this add the very top of the method.

    Code:
    String[] cmd = playerCommand.split(" ");
    cmd[0] = cmd[0].toLowerCase();
    now add this

    Code:
    else if (cmd[0].equals("mute")) {
    	if(cmd.length == 2) {
    		Connection.addNameToMuteList(cmd[1]);
    		for(Player p : Server.playerHandler.players) {
    			if(p.playerName.equals(cmd[1])) {
    				Client c = (Client) p;
    				c.sendMessage("Your have been muted by: "+playerName);
    			}
    		}
    	}
    }
    Thanks digistr mine was messed up to.
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Mar 2009
    Posts
    17
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    Quote Originally Posted by mudboi222 View Post
    Thanks digistr mine was messed up to.
    That works? o.o'
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Mar 2009
    Posts
    17
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    No, it doesnt work. D:

    Ftl, anyone else got the Fix For PI? (Project Insanity)
    Reply With Quote  
     

  6. #6  
    Registered Member

    Join Date
    Feb 2009
    Age
    27
    Posts
    2,861
    Thanks given
    127
    Thanks received
    226
    Rep Power
    700
    I've got it, use ::ipmute?
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Mar 2009
    Posts
    17
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    Quote Originally Posted by Jarba View Post
    I've got it, use ::ipmute?
    ::ipmute does not work either, i should have mentioned that.. o.o
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •