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); } }
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); }