Advertisement
Guest User

Untitled

a guest
May 9th, 2013
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.01 KB | None | 0 0
  1.  
  2. public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] arges){
  3. Player player = (Player) sender;
  4. if(commandLabel.equalsIgnoreCase("telep")){
  5. if(arges.length==0){
  6. if((sender instanceof Player)){
  7. player.sendMessage(ChatColor.AQUA + "Teleporter V.Beta 1.0");
  8. player.sendMessage(ChatColor.AQUA + "Plugin made by: Zach Farley");
  9. }else if(!(sender instanceof Player)){
  10. player.sendMessage(ChatColor.DARK_RED + "You must be a player to use this command!");
  11. }
  12. }else if(arges.length == 1){
  13. if(!(sender instanceof Player)){
  14. player.sendMessage(ChatColor.DARK_RED + "You must be a player to use this command!");
  15. }else if((sender instanceof Player)){
  16. Player tp = player.getServer().getPlayer(arges[0]);
  17. Location tploc = tp.getLocation();
  18. player.sendMessage("You have teleported " + ChatColor.GREEN + player.getDisplayName() + ChatColor.WHITE + " to " + ChatColor.GOLD + arges[0] + ChatColor.WHITE);
  19. // Location sloc = player.getLocation();
  20. player.teleport(tploc);
  21. }
  22. }else if(arges.length>1){
  23. player.sendMessage(ChatColor.DARK_RED + "Too many arges!");
  24. }else if(commandLabel.equalsIgnoreCase("send")){
  25. if(arges.length==0){
  26. if(!(sender instanceof Player)){
  27. player.sendMessage(ChatColor.DARK_RED + "You must be a player to use this command!");
  28. }else if((sender instanceof Player)){
  29. Player tp = player.getServer().getPlayer(arges[0]);
  30. if(tp.isOnline()){
  31. player.sendMessage("You have teleported " + ChatColor.GOLD + arges[0] + ChatColor.WHITE + " to " + ChatColor.GREEN + player.getDisplayName());
  32. // Player targetPlayer = player.getServer().getPlayer(arges[0]);
  33. // Location tploc = tp.getLocation();
  34. Location sloc = player.getLocation();
  35. tp.teleport(sloc);
  36. }else{
  37. player.sendMessage(ChatColor.RED + "Could not find player: " + arges[0]);
  38. }
  39. }
  40. }
  41.  
  42. }
  43.  
  44. }
  45. return false;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement