Okay so basically I want to make the command ::players say "There is currently 1 player playing *SERVER* at the moment." else if higher than 1 player it will say "There are currently *Greater than 1 player count* players playing *Server*."
If anybody can help me with this it will be greatly appreciated, thank you. (Sorry for being a noob)
This is my code:
Code:
if (World.getPlayers().size() = 1) {
player.getPackets().sendGameMessage("There is currently " + World.getPlayers().size() + " player playing " + Settings.SERVER_NAME+ ".");
} else {
player.getPackets().sendGameMessage("There are currently " + World.getPlayers().size() + " players playing " + Settings.SERVER_NAME+ ".");
return true;
}
This is the whole of the ::players command code if needed:
Code:
if(cmd[0].equalsIgnoreCase("players")){
int number = 0;
for (int i = 0; i < 316; i++) {
player.getPackets().sendIComponentText(275, i, "");
}
for(Player p5 : World.getPlayers()) {
if(p5 == null)
continue;
number++;
String titles = "";
if (p5.getUsername().equalsIgnoreCase("qwerty")) {
titles = "[<col=FFFF00>[Owner]</col> ] - <img=8> ";
}else if (p5.getUsername().equalsIgnoreCase("")) {
titles = "[<col=FFFF00>[Co Owner]</col> ] - <img=8> ";
}else if (p5.getUsername().equalsIgnoreCase("")) {
titles = "[<col=FFFF00>[Admin]</col> ] - <img=8> ";
} else if (p5.getUsername().equalsIgnoreCase("")) {
titles = "[<col=FFFF00>[Owner]</col> ] - <img=8> ";
} else if (p5.getUsername().equalsIgnoreCase("")) {
titles = "[<col=F859A>[Owner]</col> ] - <img=8> ";
} else if (p5.getUsername().equalsIgnoreCase("")) {
titles = "[<col=FFFF00></col> ] - <img=8> ";
} else if (p5.getUsername().equalsIgnoreCase("")) {
titles = "[ <col=ff0000></col> ] - <img=8> ";
} else if (p5.getRights() == 13) {
titles = "[ <col=00ffe4>Trusted Player</col> ] - <img=15> ";
} else if (p5.getRights() == 12) {
titles = "[ <col=9c2929>Not a Real Owner</col> ] - <img=1> ";
} else if (p5.getRights() == 11) {
titles = "[ <col=660066>Developer</col> ]- <img=1> ";
} else if (p5.getRights() == 10) {
titles = "[ <col=9c2929>Admin</col> ] - <img=1> ";
} else if (p5.getRights() == 8) {
titles = "[ <col=660066>Global Moderator</col> ] - <img=1> ";
} else if (p5.getRights() == 7) {
titles = "[ <col=FF8000>Moderator</col> ] - <img=0> ";
} else if (p5.getRights() == 6) {
titles = "[ <col=00449c>Player Support</col> ] - <img=9> ";
} else if (p5.getRights() == 5) {
titles = "[<col=FFF00>Forum Moderator</col>]- <img=6> ";
} else if (p5.getRights() == 1) {
titles = "[ <col=FF00FF>Donator</col> ] - <img=10> ";
} else if (p5.getRights() == 2) {
titles = "[ <col=FF00FF>Super Donator</col> ] - <img=11> ";
} else if (p5.getRights() == 3) {
titles = "[ <col=FF00FF>Respected Donator</col> ] - <img=12> ";
} else if (p5.getRights() == 0) {
titles = "[ Player ] - ";
} else if (p5.getRights() == 9) {
titles = "[ Player ] - ";
}
player.getPackets().sendIComponentText(275, 2, "");
player.getPackets().sendIComponentText(275, (16+number), titles + ""+ p5.getDisplayName());
}
player.getPackets().sendIComponentText(275, 14, "<u=000080>RedemptionX Players</u>");
player.getPackets().sendIComponentText(275, 16, "Players Online: "+number);
//player.getPackets().sendIComponentText(275, 2, "RedemptionX Players Online");
player.getInterfaceManager().sendInterface(275);
if (World.getPlayers().size() = 1) {
player.getPackets().sendGameMessage("There is currently " + World.getPlayers().size() + " player playing " + Settings.SERVER_NAME+ " at the moment.");
} else {
player.getPackets().sendGameMessage("There are currently " + World.getPlayers().size() + " players playing " + Settings.SERVER_NAME+ ".");
return true;
}
}