Deop All Ops Code?

Posts 1–3 of 3 · Page 1 of 1
Deop All Ops Code?
I've searched this on google, asked on Y!A and I still can't find this.
I just made a plugin that gives op on command, but I want to know what the code is where you type in a certain command and it deop all people who are currently op. If I can get my question solved, I will post my final plugin on the site for you all to use.
Thanks
I've never used Bukkit's API, but the principle is something like this:

Code:
for(Player p: PlayerList){

if(p.isOp() && p != commandSender)
Server.deop(p);
}

}
That only deops OPs that is online. You need to use
Code:
for (OfflinePlayer p : getServer().getOperators()) {
    p.setOp(false);
}
Posts 1–3 of 3 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Talk with us