Advertisement
Guest User

setrankpasswordCommand.java

a guest
Sep 4th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. package titanium.TitanDevanium.plugin.commands;
  2.  
  3. import org.bukkit.ChatColor;
  4. import org.bukkit.command.Command;
  5. import org.bukkit.command.CommandExecutor;
  6. import org.bukkit.command.CommandSender;
  7. import org.bukkit.entity.Player;
  8.  
  9. public class srpswCommand implements CommandExecutor {
  10.  
  11. public static String password = "";
  12.  
  13. String Prefix = ChatColor.GOLD + "[" + ChatColor.GREEN + "RankPlugin" + ChatColor.GOLD + "] ";
  14. String Enabled = Prefix + ChatColor.GOLD + "StaffChat has been " + ChatColor.GREEN + "Enabled";
  15. String Disabled = Prefix + ChatColor.GOLD + "StaffChat has been " + ChatColor.RED + "Disabled";
  16. String NoPerm = Prefix + ChatColor.RED + "You don't have permission to execute this command!";
  17.  
  18. @Override
  19. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
  20. Player p = (Player) sender;
  21. if(!(p.hasPermission("sr"))){
  22. sender.sendMessage(ChatColor.RED + "You do not have permission to execute this command!");
  23. return true;
  24. }
  25. if(setrankCommand.isInGame == false) {
  26. sender.sendMessage(Prefix + ChatColor.RED + "You must be in-game to use this command!");
  27. return true;
  28. } else {
  29. sender.sendMessage(Prefix + ChatColor.WHITE + "You've set the password to: " + ChatColor.GREEN + args);
  30. password = args[0];
  31. }
  32. return false;
  33. }
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement