PlayerCountMessage

Discussion in 'Plugin Development' started by badboysteee98, Jun 3, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    badboysteee98

    Hello Bukkit,

    I have made a PlayerCountMessage using ProtocolLib but I was wondering how to change the PlayerList for when certain Players are online say staff

    So it would show something like this

    Staff Online:
    - badboysteee98

    And when no staff online (checking if they have the Permission and are online)
    Staff Online:
    > None <

    My Code: (Don't think it's right)
    Code:java
    1. public void onPacketSending(
    2. PacketEvent e) {
    3.  
    4. if(e.getPlayer().hasPermission("playercount.staff")) {
    5. if(e.getPlayer().isOnline()) {
    6. e.getPacket().getServerPings().read(0).setPlayers(Main.this.message);
    7. }
    8.  
     
  2. Something like this?

    Code:
     
    for(Player p : Bukkit.getServer().getOnlinePlayers()) {
         if (p.hasPermission("playercount.staff")) {
              // do what ever, maybe add them to a hash map? 
         }
    }
     
Thread Status:
Not open for further replies.

Share This Page