Created
August 7, 2013 21:37
-
-
Save Dinner1111/6178988 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (cmd.getName().equalsIgnoreCase("util-mute")) { | |
if (sender.hasPermission("Utils.Util.Mute")) { | |
if (args.length == 0) { | |
if (!muted) { | |
for (Player p : Bukkit.getOnlinePlayers()) { | |
if (p.isOp() == true) { | |
p.sendMessage(ChatColor.DARK_GRAY + "[" + ChatColor.DARK_RED + "ServerUtils" + ChatColor.DARK_GRAY + "]" + ChatColor.AQUA + " " + sender.getName() + ChatColor.GRAY + " has " + ChatColor.GOLD + "muted " + ChatColor.GRAY + "all online players."); | |
} else { | |
p.sendMessage(ChatColor.DARK_GRAY + "[" + ChatColor.DARK_RED + "ServerUtils" + ChatColor.DARK_GRAY + "]" + ChatColor.AQUA + " " + sender.getName() + ChatColor.GRAY + " has muted you."); | |
} | |
} | |
muted = !muted; | |
listen.setCanTalk(false); | |
} else { | |
muted = !muted; | |
for (Player p : Bukkit.getOnlinePlayers()) { | |
if (p.isOp() == true) { | |
p.sendMessage(ChatColor.DARK_GRAY + "[" + ChatColor.DARK_RED + "ServerUtils" + ChatColor.DARK_GRAY + "]" + ChatColor.AQUA + " " + sender.getName() + ChatColor.GRAY + " has " + ChatColor.GOLD + "unmuted " + ChatColor.GRAY + "all online players."); | |
} else { | |
p.sendMessage(ChatColor.DARK_GRAY + "[" + ChatColor.DARK_RED + "ServerUtils" + ChatColor.DARK_GRAY + "]" + ChatColor.AQUA + " " + sender.getName() + ChatColor.GRAY + " has unmuted you."); | |
} | |
} | |
} | |
} else { | |
sender.sendMessage(ChatColor.DARK_RED + "Too many arguments."); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment