I am Not Sure where the Problem is....
Off topic → Programming → I am Not Sure where the Problem is....
What doesn’t work tho? For me it works as intended. No description given -> It shall do nothing. It does nothing -> works as intended. xD
Oh and, move this to git maybe?
@LogalCoder Before changing anything, me and @Mr_RedSheep were testing the plugin… Seems like only other players can see it and not the sender… Not sure why.
for(Player staff : Bukkit.getOnlinePlayers()){ p.sendMessage(ChatColor.BLACK + "[" + ChatColor.AQUA + "Staff Chat" + ChatColor.BLACK + "] " + ChatColor.RED + sender.getName() + ":" + ChatColor.YELLOW + str.toString().trim()); staff.sendMessage(ChatColor.BLACK + "[" + ChatColor.AQUA + "Staff Chat" + ChatColor.BLACK + "] " + ChatColor.RED + sender.getName() + ":" + ChatColor.YELLOW + str.toString().trim()); }
This will send the staff message to every player online… Not only that, it will send it to the sender the amount of players online times… (Great sentence)
Nope, it won’t. If you’ll do
for(Player staff : Bukkit.getOnlinePlayers().size){
}
It will. Size get’s the amount of players online at the time of the executemiontion (nice spelling huh?) Example:
if(label.equalsIgnoreCase("list"))
sender.sendMessage("There are " + Bukkit.getOnlinePlayers().size + "/" + Bukkit.getMaxPlayers() + " online.");
for(int i = 1; i < args.length; i++){
str.append(args[i] + " ");
Shouldn’t i be 0? Just wondering…
String message = args.join(" “);
Done.