How to check if player is an operator?

Discussion in 'Plugin Development' started by Moe041991, Oct 1, 2011.

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

    Moe041991

    hey, iam a total newb, i have a quick question.

    I need some if-statement to check if a commandsender is an OP or not. How do i do this?

    Sincerely
     
  2. if(sender instanceof Player && ((Player)sender).isOp())
     
  3. Offline

    Ahniolator

    Edit: nvm @V10lator got it before I did :p
     
  4. Offline

    Moe041991

    thanks :).

    I got another short question.

    I want to sent a message to all people with certain permissions after a certain event. I have set up the event and the permission if-statement, but i dont know how to get all online player in order to check them in the if statement.
    any idea?
     
  5. Offline

    stelar7

    for (Player p : Bukkit.getServer().getOnlinePlayers()) {
    if(p.hasPermission("somethin")) {
    //do stuff here
     
Thread Status:
Not open for further replies.

Share This Page