Thread: help with ::players command

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 help with ::players command 
    Registered Member Dark9Boy's Avatar
    Join Date
    Dec 2013
    Posts
    197
    Thanks given
    88
    Thanks received
    1
    Rep Power
    11
    hey guys i am majed coding a small server 718 and i've a proplem in my :layers command
    that sows whos online and how much is online



    if there are 2 players at the server (example me and the co-owner)
    sometimes the co-owner name will show and there will be no name for me

    and some times i have a name and the co-owner dont

    and same with players

    here a picutre :


    Screenshot by Lightshot


    whos can help me with that plaease?
    [Owner/Developer] Of Taybe-Scape
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Mar 2010
    Posts
    2,218
    Thanks given
    170
    Thanks received
    262
    Rep Power
    0
    I wouldn't recommend using that interface because if you have more then 20? you cannot scroll. Also i don't think theirs a scroll config for it.
    Reply With Quote  
     

  3. #3  
    Registered Member Dark9Boy's Avatar
    Join Date
    Dec 2013
    Posts
    197
    Thanks given
    88
    Thanks received
    1
    Rep Power
    11
    Quote Originally Posted by Teek View Post
    I wouldn't recommend using that interface because if you have more then 20? you cannot scroll. Also i don't think theirs a scroll config for it.

    so what interface you
    recommend


    and if i use it the proplem will be fixed?
    [Owner/Developer] Of Taybe-Scape
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Mar 2010
    Posts
    2,218
    Thanks given
    170
    Thanks received
    262
    Rep Power
    0
    lol, i'd recommend using the 275 interface i think.

    Also you'll need to add boolean checks to see if the rank shows e.g

    } else if (player.getRights() == 1) {//mod
    Interface+string then... and you would add somehting like.. player.getDisplayName() + "");

    I'll help you over skype or teamviewer if you like. Feel free to add me.

    ya.boy.tk
    Reply With Quote  
     

  5. Thankful user:


  6. #5  
    Registered Member Dark9Boy's Avatar
    Join Date
    Dec 2013
    Posts
    197
    Thanks given
    88
    Thanks received
    1
    Rep Power
    11
    Quote Originally Posted by Teek View Post
    lol, i'd recommend using the 275 interface i think.

    Also you'll need to add boolean checks to see if the rank shows e.g

    } else if (player.getRights() == 1) {//mod
    Interface+string then... and you would add somehting like.. player.getDisplayName() + "");

    I'll help you over skype or teamviewer if you like. Feel free to add me.

    ya.boy.tk

    yeah sure i w'll add u now
    [Owner/Developer] Of Taybe-Scape
    Reply With Quote  
     

  7. #6  
    Registered Member
    shed's Avatar
    Join Date
    Dec 2010
    Posts
    1,835
    Thanks given
    504
    Thanks received
    576
    Rep Power
    5000
    well I'm not going to guess your command, can you paste it?
    "We don't submit to terror. We make the terror." - #FU2016
    Reply With Quote  
     

  8. Thankful user:


  9. #7  
    Registered Member Dark9Boy's Avatar
    Join Date
    Dec 2013
    Posts
    197
    Thanks given
    88
    Thanks received
    1
    Rep Power
    11
    Quote Originally Posted by January View Post
    well I'm not going to guess your command, can you paste it?

    Sure


    Code:
    case "players":
    				player.getInterfaceManager().sendInterface(1245);
    				int number = 0;
    					for (int i = 0; i < 100; i++) {
    				player.getPackets().sendIComponentText(1245, i, "");
    				}
    					for(Player p5 : World.getPlayers()) {
    						if(p5 == null)
    						continue;
    						number++;
    						String titles = "";
                    if (p5.getRights() == 0) {
    				titles = "<col=80FF80>[Player]</col=80FF80> ";
    				}
    				if (player.getOnlineTime() >= 120 && player.getRights() == 0
    						&& !p5.isExtremeDonator() && !p5.isDonator()) {
    				titles = "<col=0461E8>Dedicated Player</col> "; 
    				}
    				if (player.getOnlineTime() >= 1200 && player.getRights() == 0
    						&& !p5.isExtremeDonator() && !p5.isDonator()) {
    				titles = "<col=0461E8>Dedicated Player</col> "; 
    				}
    				if (player.getOnlineTime() >= 2400 && player.getRights() == 0
    						&& !p5.isExtremeDonator() && !p5.isDonator()) {
    				titles = "<col=0461E8>Dedicated Player</col> "; 
    				}
    				if (p5.isDonator() && player.getRights() == 0) {
    				titles = "<col=981546><img=8>Donator<img=8></col> ";
    				}
    				if (p5.isExtremeDonator() && player.getRights() == 0) {
    				titles = "<col=2543AA><img=11>Extreme Donator<img=11></col> ";
    				}
    				if (p5.isSupporter() && player.getRights() == 0) {
    				titles = "<col=02AEC5>Supporter</col> ";
    				}
    				if (p5.isGraphicDesigner() && player.getRights() == 0) {
    					titles = "<col=0D5452><img=9>GFX Designer<img=9></col> ";
    					}
    				if (p5.isForumModerator() && player.getRights() == 0) {
    					titles = "<col=0F6723><img=6>Forum Mod<img=6></col> ";
    					}
    				if (p5.getRights() == 1) {
    				titles = "<col=80FF80><img=0>Moderator<img=0></col=80FF80> ";
    				}
    				if (p5.getRights() == 2) {
    				titles = "<col=FFFFA3><img=1>Administrator<img=1></col=B20000> ";
    				}
    				if (p5.getDisplayName().equalsIgnoreCase("")) { 
    				titles = "<col=183777><img=1>Head Admin</col> ";  
    				}
    				if (p5.getDisplayName().equalsIgnoreCase("")) {
    				titles = "<col=DB0000><img=1>Owner<img=1></col> "; 
    				}
    				if (p5.getDisplayName().equalsIgnoreCase("naser")&& (p5.getRights() == 2)) {
    				titles = "<col=DB0000><img=1>[Co-Owner]<img=1></col> ";
    				}  
    				if (p5.getDisplayName().equalsIgnoreCase("majed")&& (p5.getRights() == 2)) {
    				titles = "<col=DB5213><img=1>[Owner/Developer]<img=1></col=FFFFA3> ";
    				}  
    				player.getPackets().sendIComponentText(1245, 330, "<u=000080>Taybe-Scape Players</u>");
     				player.getPackets().sendIComponentText(1245, 13, "Players Online: "+ World.getPlayers().size() + "");
     				player.getPackets().sendIComponentText(1245, 14, "Players");
     				//player.getInterfaceManager().sendInterface(1245,"" ); 
    				
    				player.getPackets().sendIComponentText(1245, (13+number), titles + ""+ p5.getDisplayName());
    				}
    				player.getPackets().sendIComponentText(1245, 1, Settings.SERVER_NAME+" players online");
    				player.getPackets().sendIComponentText(1245, 10, " ");
    				player.getPackets().sendGameMessage(
    						"There are currently " + World.getPlayers().size()
    								+ " players playing " + Settings.SERVER_NAME
    								+ "."); 
    				return true;
    [Owner/Developer] Of Taybe-Scape
    Reply With Quote  
     

  10. #8  
    Registered Member
    shed's Avatar
    Join Date
    Dec 2010
    Posts
    1,835
    Thanks given
    504
    Thanks received
    576
    Rep Power
    5000
    here is a more organized code for it, and also use interface 275 since it has a scrollbar and your current one doesn:

    Code:
    case "players":
    				player.getInterfaceManager().sendInterface(275);
    				int number = 0;
    				for (int i = 0; i < 100; i++) {
    					player.getPackets().sendIComponentText(275, i, "");
    				}
    				for (Player p5 : World.getPlayers()) {
    					if (p5 == null)
    						continue;
    					number++;
    					String titles = "";
    					if ((p5.getRights() == 0)) {
    						titles = "[Player]";
    					}
    					if ((p5.isDonator())) {
    						titles = "[<img=11><col=02AB2F>Donator</col>]";
    					}
    					if ((p5.isSuperDonator())) {
    						titles = "[<img=13><col=58ACFA>Super Donator</col>]";
    					}
    					if ((p5.isExtremeDonator())) {
    						titles = "[<img=8><col=FF0000>Extreme Donator</col>]";
    					}
    					if ((p5.isVIPDonator())) {
    						titles = "[<img=14><col=CC6600>VIP Donator</col>]";
    					}
    					if (p5.isSupporter()) {
    						titles = "[<img=15><col=58ACFA><shad=2E2EFE>Support</shad></col>]";
    					}
    					if (p5.getRights() == 1) {
    						titles = "[<img=0><col=FF0000>Moderator</col>]";
    					}
    					if (p5.getRights() == 2) {
    						titles = "[<img=1><col=FF0000>Administrator</col>]";
    					}
    					if (p5.getDisplayName().equalsIgnoreCase("")) {
    						titles = "[<img=1><col=FF0000>Co-Owner</col>]";
    					}
    					if (p5.getDisplayName().equalsIgnoreCase("")) {
    						titles = "[<img=10><col=FF0000>Owner</col>]";
    					}
    					player.getPackets().sendIComponentText(275, (13 + number),
    							titles + "" + p5.getDisplayName());
    				}
    				player.getPackets()
    						.sendIComponentText(275, 1, "yourPSNAME On-line Players");
    				player.getPackets().sendIComponentText(275, 10, " ");
    				player.getPackets().sendIComponentText(275, 11,
    						"Players Online: " + number);
    				player.getPackets().sendGameMessage(
    						"There are currently " + World.getPlayers().size()
    								+ " players playing " + Settings.SERVER_NAME
    								+ " please vote to help us grow");
    				return true;
    "We don't submit to terror. We make the terror." - #FU2016
    Reply With Quote  
     

  11. #9  
    Registered Member Dark9Boy's Avatar
    Join Date
    Dec 2013
    Posts
    197
    Thanks given
    88
    Thanks received
    1
    Rep Power
    11
    Quote Originally Posted by January View Post
    here is a more organized code for it, and also use interface 275 since it has a scrollbar and your current one doesn:

    Code:
    case "players":
    				player.getInterfaceManager().sendInterface(275);
    				int number = 0;
    				for (int i = 0; i < 100; i++) {
    					player.getPackets().sendIComponentText(275, i, "");
    				}
    				for (Player p5 : World.getPlayers()) {
    					if (p5 == null)
    						continue;
    					number++;
    					String titles = "";
    					if ((p5.getRights() == 0)) {
    						titles = "[Player]";
    					}
    					if ((p5.isDonator())) {
    						titles = "[<img=11><col=02AB2F>Donator</col>]";
    					}
    					if ((p5.isSuperDonator())) {
    						titles = "[<img=13><col=58ACFA>Super Donator</col>]";
    					}
    					if ((p5.isExtremeDonator())) {
    						titles = "[<img=8><col=FF0000>Extreme Donator</col>]";
    					}
    					if ((p5.isVIPDonator())) {
    						titles = "[<img=14><col=CC6600>VIP Donator</col>]";
    					}
    					if (p5.isSupporter()) {
    						titles = "[<img=15><col=58ACFA><shad=2E2EFE>Support</shad></col>]";
    					}
    					if (p5.getRights() == 1) {
    						titles = "[<img=0><col=FF0000>Moderator</col>]";
    					}
    					if (p5.getRights() == 2) {
    						titles = "[<img=1><col=FF0000>Administrator</col>]";
    					}
    					if (p5.getDisplayName().equalsIgnoreCase("")) {
    						titles = "[<img=1><col=FF0000>Co-Owner</col>]";
    					}
    					if (p5.getDisplayName().equalsIgnoreCase("")) {
    						titles = "[<img=10><col=FF0000>Owner</col>]";
    					}
    					player.getPackets().sendIComponentText(275, (13 + number),
    							titles + "" + p5.getDisplayName());
    				}
    				player.getPackets()
    						.sendIComponentText(275, 1, "yourPSNAME On-line Players");
    				player.getPackets().sendIComponentText(275, 10, " ");
    				player.getPackets().sendIComponentText(275, 11,
    						"Players Online: " + number);
    				player.getPackets().sendGameMessage(
    						"There are currently " + World.getPlayers().size()
    								+ " players playing " + Settings.SERVER_NAME
    								+ " please vote to help us grow");
    				return true;

    i've got these errors


    Screenshot by Lightshot
    [Owner/Developer] Of Taybe-Scape
    Reply With Quote  
     

  12. #10  
    Registered Member
    shed's Avatar
    Join Date
    Dec 2010
    Posts
    1,835
    Thanks given
    504
    Thanks received
    576
    Rep Power
    5000
    did you delete your first case "Players" first lol

    also, go in world.java and check which method checks for online players.

    mine differs from yours.
    "We don't submit to terror. We make the terror." - #FU2016
    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

Similar Threads

  1. Need help with clientside commands
    By Colby in forum Help
    Replies: 5
    Last Post: 01-26-2009, 05:08 AM
  2. Help with ::players
    By afroman in forum Help
    Replies: 0
    Last Post: 11-11-2008, 07:31 AM
  3. Need help with a command..
    By W x 3 in forum Help
    Replies: 10
    Last Post: 10-27-2008, 08:35 PM
  4. Help With "Run (Command Runner)"
    By Tnt Pk in forum Software
    Replies: 2
    Last Post: 05-22-2008, 10:42 PM
  5. [REQ] Help with a Command Prompt...
    By Cky Poons in forum Chat
    Replies: 2
    Last Post: 03-24-2008, 07:08 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
  •