Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. if(!player.hasPermission("ship.send")) {
  2. player.sendMessage("§cYou are not permitted to do this.");
  3. return;
  4. }
  5.  
  6. if(args.length == 0) {
  7. player.sendMessage("§cCurrent usage: /ship send <player>");
  8. return;
  9. }
  10.  
  11. Player target = Bukkit.getServer().getPlayerExact(args[0]);
  12.  
  13. if(target == null) {
  14. player.sendMessage("§cThe player with the name §e" + args[0] + " §cdoesn't exist.");
  15. return;
  16. }
  17.  
  18. if (target == player) {
  19. player.sendMessage("§cYou cant ship yourself.");
  20. return;
  21. }
  22.  
  23. if (ships.get(player) == target) {
  24. player.sendMessage("§cYou have already the player §e" + target.getName() + "§c.");
  25. return;
  26. }
  27.  
  28. ships.put(player, target);
  29. player.sendMessage("§aThe request has been sent.");
  30. target.sendMessage("§aThe player §e" + player.getName() + " §ahas sent a ship request, to accept it do /ship accept " + player.getName());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement