Thread: Mute/IP Mute is not working... WILL REP+ + +

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 Mute/IP Mute is not working... WILL REP+ + + 
    Registered Member
    Join Date
    May 2008
    Posts
    374
    Thanks given
    3
    Thanks received
    1
    Rep Power
    47
    So bascially all my mute commands do is disable the person from private messaging...

    here they are

    Code:
      if (command.startsWith("mute") && playerRights >= 1) {
    
                    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..");
    
                    }
    
                }

    Code:
         if (command.startsWith("ipmute") && playerRights >= 1) {
    
                    try {
    
                        String otherPName = command.substring(7);
    
                        int otherPIndex = PlayerHandler.getPlayerID(otherPName);
    
    
    
                        if (otherPIndex != -1) {
    
                            client p = (client) server.playerHandler.players[otherPIndex];
    
                            writeLog(p.connectedFrom, "mutes2");
    
    			p.muted = true;
    
                            p.sM(
    
                                    "You have been ip muted by " + playerName);
    
    			sM("You have ip muted "+p.playerName+"");
    
                        } else { 
    
                           sM("The name doesnt exist."); 
    
                        }
    
                    } catch (Exception e) { 
    
                        sM("Try entering a name you want to tele to ip mute..");
    
                    }
    
                }

    Do It!

    Mmm
    Reply With Quote  
     

  2. #2  
    Valar Morghulis

    Laxika's Avatar
    Join Date
    Sep 2006
    Age
    32
    Posts
    2,813
    Thanks given
    1,804
    Thanks received
    274
    Rep Power
    2128
    You should add a check to your chatting method... (What send out other player's messanges messanges to players.)
    Reply With Quote  
     

  3. #3  
    Registered Member
    craig903's Avatar
    Join Date
    Sep 2007
    Age
    30
    Posts
    1,357
    Thanks given
    14
    Thanks received
    92
    Rep Power
    238
    You need to surround the incomming packet code for talking with a boolean check.
    Code:
    if (isMuted == false) {
        // run through the code
    } else {
        // Send a message ... You are currently muted and cannot talk.
    }
    Visit Rune Miracle Here
    Reply With Quote  
     

  4. #4  
    Valar Morghulis

    Laxika's Avatar
    Join Date
    Sep 2006
    Age
    32
    Posts
    2,813
    Thanks given
    1,804
    Thanks received
    274
    Rep Power
    2128
    Quote Originally Posted by q a z7o View Post
    You need to surround the incomming packet code for talking with a boolean check.
    Code:
    if (isMuted == false) {
        // run through the code
    } else {
        // Send a message ... You are currently muted and cannot talk.
    }
    Code:
    if (!isMuted) {
        // run through the code
    } else {
        // Send a message ... You are currently muted and cannot talk.
    }
    yep, you should do this.
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    May 2008
    Posts
    374
    Thanks given
    3
    Thanks received
    1
    Rep Power
    47
    So where should I add that? Or is that not even a fix?

    Do It!

    Mmm
    Reply With Quote  
     

  6. #6  
    Registered Member
    ViperSniper's Avatar
    Join Date
    Apr 2007
    Age
    30
    Posts
    2,417
    Thanks given
    367
    Thanks received
    82
    Rep Power
    976
    if(muted)
    {
    sendMessage("NOU!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
    break;
    }

    under case 4:
    :indeed:
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    May 2008
    Posts
    374
    Thanks given
    3
    Thanks received
    1
    Rep Power
    47
    spoon feed time :]

    client.java:10381: cannot find symbol
    symbol : variable Muted
    location: class client
    if(Muted) {
    ^
    1 error
    Press any key to continue . . .

    Do It!

    Mmm
    Reply With Quote  
     

  8. #8  
    Registered Member
    PSNB's Avatar
    Join Date
    Aug 2009
    Posts
    885
    Thanks given
    8
    Thanks received
    103
    Rep Power
    590
    Quote Originally Posted by arr0wtohell View Post
    spoon feed time :]

    client.java:10381: cannot find symbol
    symbol : variable Muted
    location: class client
    if(Muted) {
    ^
    1 error
    Press any key to continue . . .
    You can't be serious?
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    May 2008
    Posts
    374
    Thanks given
    3
    Thanks received
    1
    Rep Power
    47
    I iz srsly srs :]

    Do It!

    Mmm
    Reply With Quote  
     

  10. #10  
    Donator


    Join Date
    Oct 2007
    Posts
    1,052
    Thanks given
    113
    Thanks received
    32
    Rep Power
    573
    Lol'd at error.
    Reply With Quote  
     

Page 1 of 2 12 LastLast

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
  •