Solved How would I Send all Ops an Error Msg?

Discussion in 'Plugin Development' started by Firefox365, Oct 7, 2012.

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

    Firefox365

    So in my plugin I have a place for an error and it logs the error. But how could I send all online ops or really anyone with the permission "plugin.ErrorAlert" will reacive the broadcast that I set. How can I do this in the simplest way?

    Thanks!
     
  2. Offline

    Littlefryingpan

    This is the easiest way I know of:

    Code:
    for(Player p: this.getServer().getOnlinePlayers()) {
    if (p.hasPermission("plugin.ErrorAlert") || p.isOp()) {
    p.sendMessage("Error message here");
    }
    }
    (Sorry for spoon feeding.)
     
  3. Offline

    Vandrake

    for(Player p : Bukkit.getOnlinePlayers()
    {
    if(p.hasPermission"plugin.ErrorAlert")
    {
    send me a message bro
    }
    }
     
  4. Offline

    Firefox365

    Thanks It works!
    Hmm for some reason this wont work for me...
     
  5. Offline

    jamietech

    V10lator likes this.
  6. Offline

    Firefox365

    No I use GroupManager.
     
  7. Offline

    Vandrake

    By default Ops have all permissions so checking if he is an Op is kinda...unnecessary don't you think?o.o not trying to create a riot here xD Just saying..
     
Thread Status:
Not open for further replies.

Share This Page