Thread: custom public chat [z508]

Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1 custom public chat [z508] 
    Member
    Join Date
    Jul 2008
    Posts
    221
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    this for the custom clan chat for donator+ and ive been making it to help new poeple in your packets>publicchat.java replace it with this

    Code:
    /*
     * Class PublicChat
     *
     * Version 1.0
     *
     * Sunday, August 17, 2008
     *
     * Created by Codeusa palis was crap i re did it
     */
    
    package net.com.codeusa.net.packethandler;
    
    import net.com.codeusa.Server;
    import net.com.codeusa.model.Player;
    import net.com.codeusa.util.Misc;
    
    public class PublicChat implements Packet {
        /**
         * Handles player chatting.
         * @param p The Player which the frame should be handled for.
         * @param packetId The packet id this belongs to.
         * @param packetSize The amount of bytes being recieved for this packet.
         */
        public void handlePacket(Player p, int packetId, int packetSize) {
            if (p == null || p.stream == null) {
                return;
            }
            p.chatTextEffects = p.stream.readUnsignedWord();
            int numChars = p.stream.readUnsignedByte();
            p.chatText = Misc.decryptPlayerChat(p.stream, numChars);
    	if (p.muteType > 0) {
    		p.getActionSender().sendMessage(p, "You are muted and cannot talk.");
    		return;
    	}
    	if (p.chatText.startsWith("/")) {
    		try {
    			String chat = p.activeChat;
    			for (Player player : Server.engine.players) {
    				if (player != null) {
    					if (player.activeChatOwner.equals(p.activeChatOwner)) {
    						if (p.rights == 0) {
    							p.getActionSender().sendMessage(p, "You must be a donator or apart of the staff to use yell.");
    						} else if (p.rights == 1) {
    							player.getActionSender().sendMessage(player, "[<col=0000ff>"+chat+"</col>] <img=0>"+p.username.substring(0, 1).toUpperCase()+p.username.substring(1)+": <col=880000>"+p.chatText.substring(1) +":clan:");
    						} else if (p.rights >= 2) {
    							player.getActionSender().sendMessage(player, "[<col=0000ff>"+chat+"</col>] <img=1>"+p.username.substring(0, 1).toUpperCase()+p.username.substring(1)+": <col=880000>"+p.chatText.substring(1) +":clan:");
    					}
    				}
    			}
    		} catch (Exception e) {
    			return;
    		}
    		return;
    	}
            p.chatTextUpdateReq = true;
            p.updateReq = true;
        }
    }
    have fun

    Reply With Quote  
     

  2. #2  
    Member custom public chat [z508] Market Banned


    Luke132's Avatar
    Join Date
    Dec 2007
    Age
    35
    Posts
    12,574
    Thanks given
    199
    Thanks received
    7,106
    Rep Power
    5000
    I've moved it for you .

    Attached imageAttached image
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Sep 2009
    Posts
    57
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    Leecher, from Rule-12.
    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    Jul 2008
    Posts
    539
    Thanks given
    4
    Thanks received
    8
    Rep Power
    89
    Quote Originally Posted by hitman View Post

    if (p.muteType > 0) {
    p.getActionSender().sendMessage(p, "You are muted and cannot talk.");
    return;
    }

    How many types of mutes are there?
    Reply With Quote  
     

  5. #5  
    Registered Member

    Join Date
    Aug 2008
    Posts
    1,151
    Thanks given
    21
    Thanks received
    86
    Rep Power
    558
    Quote Originally Posted by Hoster View Post
    How many types of mutes are there?
    It's a type.

    0 = Not muted, 1 = Muted????

    нacкυя

    Reply With Quote  
     

  6. #6  
    Registered Member

    Join Date
    Jul 2008
    Posts
    539
    Thanks given
    4
    Thanks received
    8
    Rep Power
    89
    Quote Originally Posted by Hackur View Post
    It's a type.

    0 = Not muted, 1 = Muted????
    well why not just use a boolean
    Reply With Quote  
     

  7. #7  
    Registered Member

    Join Date
    Aug 2008
    Posts
    1,151
    Thanks given
    21
    Thanks received
    86
    Rep Power
    558
    Quote Originally Posted by Hoster View Post
    well why not just use a boolean
    Well why dont you ask him

    нacкυя

    Reply With Quote  
     

  8. #8  
    Registered Member

    Join Date
    Jul 2008
    Posts
    539
    Thanks given
    4
    Thanks received
    8
    Rep Power
    89
    Quote Originally Posted by Hackur View Post
    Well why dont you ask him
    I will.

    Why you a int when you could use a boolean?
    Reply With Quote  
     

  9. #9  
    Registered Member
    _slam's Avatar
    Join Date
    Oct 2009
    Posts
    309
    Thanks given
    5
    Thanks received
    1
    Rep Power
    441
    Quote Originally Posted by Hoster View Post
    I will.

    Why you a int when you could use a boolean?
    I expect they struggle on saving a boolean or don't know what or how to use it.
    Reply With Quote  
     

  10. #10  
    Registered Member

    Join Date
    Jul 2008
    Posts
    539
    Thanks given
    4
    Thanks received
    8
    Rep Power
    89
    Quote Originally Posted by slam. View Post
    I expect they struggle on saving a boolean or don't know what or how to use it.
    it a simple 1 or 0
    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
  •