Thread: Chat Talk delay timer

Results 1 to 3 of 3
  1. #1 Chat Talk delay timer 
    XJCX
    Guest
    Does any one know how to make a Chat talk delay timer, for like public talking so people cant spam? like a 3 second timer or 2 second timer.. Heres what i been thinking somethen like.

    For Player.java

    Code:
    public int chatDelay = 0;

    And then for process()

    Code:
    if (chatDelay > 0) {
        chatDelay--;
    Then in PublicChat.java

    Code:
            if(p.chatDelay == 2){
               p.frames.sendMessage(p, "Please wait "+chatDelay+" seconds before speaking again.");
    } else {
               p.chatTextEffects = p.stream.readUnsignedWord();
               int numChars = p.stream.readUnsignedByte();
               p.chatText = Misc.decryptPlayerChat(p.stream, numChars);
               for (String s : Engine.Censor.censored) {
    	   if (p.chatText.contains(s)) {
    		int length = s.length();
    		String replace = "";
    		for(int i = 0; i < length; i++) {
    		    replace += "*";
    		}
    		p.chatText = p.chatText.replaceAll(s, replace);
    	    }
    	}
    
            p.chatTextUpdateReq = true;
            p.updateReq = true;
           }
    }
    Somethen like that, im 100% that code i wrote up will not work lmao.. but thats like a example. Ty!
    Reply With Quote  
     

  2. #2  
    XJCX
    Guest
    *bump
    Reply With Quote  
     

  3. #3  
    Registered Member
    `*Owned_You*'s Avatar
    Join Date
    Dec 2008
    Age
    30
    Posts
    873
    Thanks given
    13
    Thanks received
    9
    Rep Power
    99
    dont really need a delay... thats why mute is ther for

    < Want One? Try Here =]

    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
  •