Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] arges){
- Player player = (Player) sender;
- if(commandLabel.equalsIgnoreCase("telep")){
- if(arges.length==0){
- if((sender instanceof Player)){
- player.sendMessage(ChatColor.AQUA + "Teleporter V.Beta 1.0");
- player.sendMessage(ChatColor.AQUA + "Plugin made by: Zach Farley");
- }else if(!(sender instanceof Player)){
- player.sendMessage(ChatColor.DARK_RED + "You must be a player to use this command!");
- }
- }else if(arges.length == 1){
- if(!(sender instanceof Player)){
- player.sendMessage(ChatColor.DARK_RED + "You must be a player to use this command!");
- }else if((sender instanceof Player)){
- Player tp = player.getServer().getPlayer(arges[0]);
- Location tploc = tp.getLocation();
- player.sendMessage("You have teleported " + ChatColor.GREEN + player.getDisplayName() + ChatColor.WHITE + " to " + ChatColor.GOLD + arges[0] + ChatColor.WHITE);
- // Location sloc = player.getLocation();
- player.teleport(tploc);
- }
- }else if(arges.length>1){
- player.sendMessage(ChatColor.DARK_RED + "Too many arges!");
- }else if(commandLabel.equalsIgnoreCase("send")){
- if(arges.length==0){
- if(!(sender instanceof Player)){
- player.sendMessage(ChatColor.DARK_RED + "You must be a player to use this command!");
- }else if((sender instanceof Player)){
- Player tp = player.getServer().getPlayer(arges[0]);
- if(tp.isOnline()){
- player.sendMessage("You have teleported " + ChatColor.GOLD + arges[0] + ChatColor.WHITE + " to " + ChatColor.GREEN + player.getDisplayName());
- // Player targetPlayer = player.getServer().getPlayer(arges[0]);
- // Location tploc = tp.getLocation();
- Location sloc = player.getLocation();
- tp.teleport(sloc);
- }else{
- player.sendMessage(ChatColor.RED + "Could not find player: " + arges[0]);
- }
- }
- }
- }
- }
- return false;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement