Online [Rank] Players

Status
This thread has been locked.

Feignasse

Banned
Feedback score
7
Posts
283
Reactions
114
Resources
0
Looking for a plugin that broadcasts in the chat "Online (Rank) Players: %players%" every X amount of time.
I'd also like a config file where I can edit all of this.


Online Players:
1485792723-b28e771ea25144dabc87bb13008f8b4c.png

If there's no online players, don't broadcast the message.


looking for someone that can do this for free, it looks simple :).
 
Type
Offering
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

DedicatedRam

Premium
Feedback score
4
Posts
271
Reactions
106
Resources
0
Code:
new BukkitRunnable() {
            public void run() {
                List<String> online = new ArrayList<>();
                for (Player p : Bukkit.getOnlinePlayers()) {
                    PermissionUser usr = PermissionsEx.getUser(p);
                    if (usr.inGroup("Master"))
                        online.add(p.getName());
                }
                StringBuilder sb = new StringBuilder();
                for (int i = 0; i < online.size(); ++i) {
                    if (i == online.size() - 1) {
                        sb.append(" §7" + online.get(i));
                    } else {
                        sb.append(" §7" + online.get(i) + "§f,");
                    }
                }
                Bukkit.broadcastMessage("§0Online Masters §8:" + (sb.length() == 0 ? " §7None" : sb.toString()));
            }
        }.runTaskTimer(this, 100L, 6000);
This isn't my code, this is originally Huli's code and this will broadcast every 5 minutes.
 
Last edited:

Scar

Supreme
Feedback score
4
Posts
724
Reactions
384
Resources
0
Code:
new BukkitRunnable() {
            public void run() {
                List<String> online = new ArrayList<>();
                for (Player p : Bukkit.getOnlinePlayers()) {
                    PermissionUser usr = PermissionsEx.getUser(p);
                    if (usr.inGroup("Master"))
                        online.add(p.getName());
                }
                StringBuilder sb = new StringBuilder();
                for (int i = 0; i < online.size(); ++i) {
                    if (i == online.size() - 1) {
                        sb.append(" §7" + online.get(i));
                    } else {
                        sb.append(" §7" + online.get(i) + "§f,");
                    }
                }
                Bukkit.broadcastMessage("§0Online Masters §8:" + (sb.length() == 0 ? " §7None" : sb.toString()));
            }
        }.runTaskTimer(this, 100L, 6000);
This isn't my code, this is originally Huli's code and this will broadcast every 5 minutes.
Probably might want to make groups universal (for multiple permission systems)
 
Status
This thread has been locked.
Top