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.
|
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?
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.
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
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;
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;
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.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |