Solved Problem with sending messages only to Staff!

Discussion in 'Plugin Development' started by OverDodo, Feb 16, 2017.

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

    OverDodo

    Hey,

    I want to send a KickMessage to every Player, who has the Permission.
    I use this method.. But it only works in the Eventhandler. Could you tell me why?


    PHP:
    for(Player teamler Bukkit.getOnlinePlayers()) {
                if(
    teamler.hasPermission"cmd.watch" )) {


    }
     
  2. Online

    timtower Administrator Administrator Moderator

  3. Offline

    johnny boy

    Are there any errors when you try and put it somewhere else??
     
  4. Offline

    OverDodo


    No. That is the Problem..
     
  5. Offline

    johnny boy

    Where do you try and put it? Post where else you put it. (The code)
     
  6. Offline

    MrGeneralQ

    Could you provide the full class?
     
  7. Offline

    MaxFireIce

    @OverDodo Try
    Code:java
    1. Bukkit.getServer().getOnlinePlayers()
    and see if it works.
     
  8. Offline

    ipodtouch0218

    If nothing is working, you can just use "Bukkit.broadcast(String msg, String permission);"
     
Thread Status:
Not open for further replies.

Share This Page