Thread: ::players command

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1 ::players command 
    Registered Member
    Shoutbox's Avatar
    Join Date
    Sep 2013
    Posts
    1,748
    Thanks given
    580
    Thanks received
    363
    Rep Power
    834
    How could i make my :layers command like this?

    Screenshot by Lightshot

    Im really confused. i have also looked for some tutorials to find something like this to try get an idea

    Thanks,
    Imperfection
    S A D B O Y S

    私は自分自身を殺すために待つことができない
    Reply With Quote  
     

  2. #2  
    Donator


    Join Date
    Aug 2013
    Posts
    1,163
    Thanks given
    273
    Thanks received
    156
    Rep Power
    445
    Make it open an interface, and do few modifications
    Reply With Quote  
     

  3. #3  
    Seven Lions

    Yvne's Avatar
    Join Date
    Sep 2012
    Posts
    1,204
    Thanks given
    164
    Thanks received
    173
    Rep Power
    81
    Quote Originally Posted by Imperfection View Post
    How could i make my :layers command like this?

    Screenshot by Lightshot

    Im really confused. i have also looked for some tutorials to find something like this to try get an idea

    Thanks,
    Imperfection
    Heir's mine:
    Code:
    if (playerCommand.equalsIgnoreCase("players")) {
    				c.sendMessage("There are currently "
    						+ PlayerHandler.getPlayerCount() + " players online.");
    				c.getPA().sendFrame126("DethWish - Online Players", 8144);
    				c.getPA().sendFrame126(
    						"@dbl@Players online: "
    								+ PlayerHandler.getPlayerCount() + "", 8145);
    				int line = 8147;
    				for (int i = 1; i < Config.MAX_PLAYERS; i++) {
    					Client p = c.getClient(i);
    					if (!c.validClient(i))
    						continue;
    					if (Misc.properPlayerName(p.playerName) != null) {
    						String title = "";
    						if (p.playerRights == 1) {
    							title = "@gr2@Mod ";
    						} else if (p.playerRights == 2) {
    							title = "@red@Admin ";
    						} else if (p.playerRights == 3) {
    							title = "@red@Admin ";
    						}
    						title += "@dbl@Level-" + p.combatLevel;
    						String extra = "";
    						if (c.playerRights > 0) {
    							extra = " " + p.playerId + ". ";
    						}
    						c.getPA().sendFrame126(
    								"@dbl@" + extra + "@dre@"
    										+ Misc.properPlayerName(p.playerName)
    										+ "@dbl@ (" + title
    										+ ") @dre@Kills: @dbl@ " + p.KC
    										+ "  @dre@Deaths: @dbl@" + p.DC, line);
    						line++;
    					}
    				}
    				c.getPA().showInterface(8134);
    				c.flushOutStream();
    			}
    Reply With Quote  
     

  4. Thankful users:


  5. #4  
    Banned

    Join Date
    Nov 2010
    Age
    14
    Posts
    2,639
    Thanks given
    158
    Thanks received
    280
    Rep Power
    0
    Quote Originally Posted by Yvne View Post
    Heir's mine:
    Code:
    if (playerCommand.equalsIgnoreCase("players")) {
    				c.sendMessage("There are currently "
    						+ PlayerHandler.getPlayerCount() + " players online.");
    				c.getPA().sendFrame126("DethWish - Online Players", 8144);
    				c.getPA().sendFrame126(
    						"@dbl@Players online: "
    								+ PlayerHandler.getPlayerCount() + "", 8145);
    				int line = 8147;
    				for (int i = 1; i < Config.MAX_PLAYERS; i++) {
    					Client p = c.getClient(i);
    					if (!c.validClient(i))
    						continue;
    					if (Misc.properPlayerName(p.playerName) != null) {
    						String title = "";
    						if (p.playerRights == 1) {
    							title = "@gr2@Mod ";
    						} else if (p.playerRights == 2) {
    							title = "@red@Admin ";
    						} else if (p.playerRights == 3) {
    							title = "@red@Admin ";
    						}
    						title += "@dbl@Level-" + p.combatLevel;
    						String extra = "";
    						if (c.playerRights > 0) {
    							extra = " " + p.playerId + ". ";
    						}
    						c.getPA().sendFrame126(
    								"@dbl@" + extra + "@dre@"
    										+ Misc.properPlayerName(p.playerName)
    										+ "@dbl@ (" + title
    										+ ") @dre@Kills: @dbl@ " + p.KC
    										+ "  @dre@Deaths: @dbl@" + p.DC, line);
    						line++;
    					}
    				}
    				c.getPA().showInterface(8134);
    				c.flushOutStream();
    			}
    this is buggy af tbh, qj3231-3113 etc
    Reply With Quote  
     

  6. #5  
    Donator


    Join Date
    Aug 2013
    Posts
    1,163
    Thanks given
    273
    Thanks received
    156
    Rep Power
    445
    Quote Originally Posted by Call View Post
    this is buggy af tbh, qj3231-3113 etc
    Can be fixed by:
    Code:
    player.getPackets().sendIComponentText(275, i, "");
    meh, just convert it to 317, and q1, q2 etc are gone
    Reply With Quote  
     

  7. Thankful user:


  8. #6  
    Banned

    Join Date
    Nov 2010
    Age
    14
    Posts
    2,639
    Thanks given
    158
    Thanks received
    280
    Rep Power
    0
    Quote Originally Posted by Steve View Post
    Can be fixed by:
    Code:
    player.getPackets().sendIComponentText(275, i, "");
    meh, just convert it to 317, and q1, q2 etc are gone
    ok, thanks but i wont use atm, whats ur skype?
    Reply With Quote  
     

  9. #7  
    Registered Member
    Shoutbox's Avatar
    Join Date
    Sep 2013
    Posts
    1,748
    Thanks given
    580
    Thanks received
    363
    Rep Power
    834
    Quote Originally Posted by Yvne View Post
    Heir's mine:
    Code:
    if (playerCommand.equalsIgnoreCase("players")) {
    				c.sendMessage("There are currently "
    						+ PlayerHandler.getPlayerCount() + " players online.");
    				c.getPA().sendFrame126("DethWish - Online Players", 8144);
    				c.getPA().sendFrame126(
    						"@dbl@Players online: "
    								+ PlayerHandler.getPlayerCount() + "", 8145);
    				int line = 8147;
    				for (int i = 1; i < Config.MAX_PLAYERS; i++) {
    					Client p = c.getClient(i);
    					if (!c.validClient(i))
    						continue;
    					if (Misc.properPlayerName(p.playerName) != null) {
    						String title = "";
    						if (p.playerRights == 1) {
    							title = "@gr2@Mod ";
    						} else if (p.playerRights == 2) {
    							title = "@red@Admin ";
    						} else if (p.playerRights == 3) {
    							title = "@red@Admin ";
    						}
    						title += "@dbl@Level-" + p.combatLevel;
    						String extra = "";
    						if (c.playerRights > 0) {
    							extra = " " + p.playerId + ". ";
    						}
    						c.getPA().sendFrame126(
    								"@dbl@" + extra + "@dre@"
    										+ Misc.properPlayerName(p.playerName)
    										+ "@dbl@ (" + title
    										+ ") @dre@Kills: @dbl@ " + p.KC
    										+ "  @dre@Deaths: @dbl@" + p.DC, line);
    						line++;
    					}
    				}
    				c.getPA().showInterface(8134);
    				c.flushOutStream();
    			}
    Thanks mate!

    i added and i got these errors... Could you help me fix them please? You've been a massive help!

    Code:
    src\server\game\players\packets\Commands.java:466: error: cannot find symbol
                                            Client p = c.getClient(i);
                                                        ^
      symbol:   method getClient(int)
      location: variable c of type Client
    src\server\game\players\packets\Commands.java:467: error: cannot find symbol
                                            if (!c.validClient(i))
                                                  ^
      symbol:   method validClient(int)
      location: variable c of type Client
    src\server\game\players\packets\Commands.java:469: error: cannot find symbol
                                            if (Misc.properPlayerName(p.playerName)
    != null) {
                                                    ^
      symbol:   method properPlayerName(String)
      location: class Misc
    src\server\game\players\packets\Commands.java:485: error: cannot find symbol
    
    + Misc.properPlayerName(p.playerName)
    
          ^
      symbol:   method properPlayerName(String)
      location: class Misc
    src\server\game\players\packets\Commands.java:487: error: cannot find symbol
    
    + ") @dre@Kills: @dbl@ " + p.KC
    
                                ^
      symbol:   variable KC
      location: variable p of type Client
    src\server\game\players\packets\Commands.java:488: error: cannot find symbol
    
    + "  @dre@Deaths: @dbl@" + p.DC, line);
    
                                ^
      symbol:   variable DC
      location: variable p of type Client
    6 errors
    Press any key to continue . . .
    I think its because i dont have the DC and KC added :3 Im not to sure
    S A D B O Y S

    私は自分自身を殺すために待つことができない
    Reply With Quote  
     

  10. #8  
    Seven Lions

    Yvne's Avatar
    Join Date
    Sep 2012
    Posts
    1,204
    Thanks given
    164
    Thanks received
    173
    Rep Power
    81
    Quote Originally Posted by Imperfection View Post
    Thanks mate!

    i added and i got these errors... Could you help me fix them please? You've been a massive help!

    Code:
    src\server\game\players\packets\Commands.java:466: error: cannot find symbol
                                            Client p = c.getClient(i);
                                                        ^
      symbol:   method getClient(int)
      location: variable c of type Client
    src\server\game\players\packets\Commands.java:467: error: cannot find symbol
                                            if (!c.validClient(i))
                                                  ^
      symbol:   method validClient(int)
      location: variable c of type Client
    src\server\game\players\packets\Commands.java:469: error: cannot find symbol
                                            if (Misc.properPlayerName(p.playerName)
    != null) {
                                                    ^
      symbol:   method properPlayerName(String)
      location: class Misc
    src\server\game\players\packets\Commands.java:485: error: cannot find symbol
    
    + Misc.properPlayerName(p.playerName)
    
          ^
      symbol:   method properPlayerName(String)
      location: class Misc
    src\server\game\players\packets\Commands.java:487: error: cannot find symbol
    
    + ") @dre@Kills: @dbl@ " + p.KC
    
                                ^
      symbol:   variable KC
      location: variable p of type Client
    src\server\game\players\packets\Commands.java:488: error: cannot find symbol
    
    + "  @dre@Deaths: @dbl@" + p.DC, line);
    
                                ^
      symbol:   variable DC
      location: variable p of type Client
    6 errors
    Press any key to continue . . .
    I think its because i dont have the DC and KC added :3 Im not to sure
    Add this in misc.java:

    Code:
    public static String properPlayerName(String in) {
    		final StringBuilder output = new StringBuilder(in.length());
    		String[] words = in.split("\\s");
    		for (byte b = 0, l = (byte) words.length; b < l; ++b) {
    			if (b > 0)
    				output.append(" ");
    			output.append(Character.toUpperCase(words[b].charAt(0))).append(
    					words[b].substring(1));
    		}
    		return output.toString();
    	}
    Add this in player.java for now since you don't have it.

    Code:
    public int KC, DC;
    add this is client.java

    Code:
    public Client getClient(int index) {
    		return ((Client) PlayerHandler.players[index]);
    	}
    and this:

    Code:
    public boolean validClient(int index) {
    		Client p = (Client) PlayerHandler.players[index];
    		if ((p != null) && !p.disconnected) {
    			return true;
    		}
    		return false;
    	}
    Add me on skype, if you have any other issues, I'll add kc and dc if you want aswell.
    Reply With Quote  
     

  11. Thankful user:


  12. #9  
    Registered Member
    Shoutbox's Avatar
    Join Date
    Sep 2013
    Posts
    1,748
    Thanks given
    580
    Thanks received
    363
    Rep Power
    834
    Quote Originally Posted by Steve View Post
    Can be fixed by:
    Code:
    player.getPackets().sendIComponentText(275, i, "");
    meh, just convert it to 317, and q1, q2 etc are gone
    Where would i put this in the command sir?
    S A D B O Y S

    私は自分自身を殺すために待つことができない
    Reply With Quote  
     

  13. #10  
    Seven Lions

    Yvne's Avatar
    Join Date
    Sep 2012
    Posts
    1,204
    Thanks given
    164
    Thanks received
    173
    Rep Power
    81
    Quote Originally Posted by Imperfection View Post
    Where would i put this in the command sir?
    In Client.java add:


    public void clearPlayersInterface() {
    for (int i = 8147; i < 8348; i++) {
    getPA().sendFrame126("",i);
    }
    }

    Still in Client.java, find


    public void initialize() {
    mymessage();
    synchronized (this) {

    and under it add


    clearPlayersInterface();

    So it should look like:


    public void initialize() {
    mymessage();
    synchronized (this) {
    clearPlayersInterface();
    Reply With Quote  
     

  14. Thankful user:


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

Similar Threads

  1. Better players command
    By Gluon in forum Snippets
    Replies: 26
    Last Post: 04-18-2009, 02:34 AM
  2. ::players command in 525
    By Seth1 in forum Tutorials
    Replies: 13
    Last Post: 03-23-2009, 10:26 PM
  3. [508] Player command with player list
    By Martin in forum Tutorials
    Replies: 13
    Last Post: 03-04-2009, 03:48 AM
  4. ::players command that you see all player names
    By pkownage135 in forum Requests
    Replies: 3
    Last Post: 02-14-2009, 07:47 PM
  5. ::players Command
    By cerda in forum Requests
    Replies: 4
    Last Post: 10-13-2008, 01:38 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •