Solved } { Error

Discussion in 'Plugin Development' started by MetaSurvival, Aug 10, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    MetaSurvival

    Code:
    Code:java
    1.  
    2. if(args.length == 1){
    3. else if(args[0].equalsIgnoreCase("on")){
    4. Player player = (Player) sender;
    5. player.setAllowFlight(true);
    6. player.sendMessage(ChatColor.GREEN + "Fly mode Enabled!");
    7. }
    8.  
    9. else if(args[0].equalsIgnoreCase("off")){
    10. Player player = (Player) sender;
    11. player.setAllowFlight(false);
    12. player.sendMessage(ChatColor.RED + "Fly mode Disabled!");
    13. }
    14. }
    15. else if(args.length == 2){
    16. Player player1 = (Player) sender;
    17. Player target = (Bukkit.getServer().getPlayer(args[1]));
    18. String name = (player1.getName());
    19. String name1 = (Bukkit.getPlayer(args[1]).getName());
    20. if(args[0].equalsIgnoreCase("on")){
    21. target.setAllowFlight(true);
    22. player1.sendMessage(ChatColor.GREEN + ("Fly mode Enabled for" + name1));
    23. target.sendMessage(name + ChatColor.GREEN + "Enabled your fly mode!");
    24. }
    25.  
    26. }
    27.  
    28.  
    29.  
    30.  
    31.  
    32.  
    33.  
    34.  
    35.  
    36.  
    37.  
    38.  
    39.  
    40. }
    41.  
    42.  
    43. }
    44. }
    45.  

    Errors on Line 2 and 40
    Both errors say:
    Code:
    Multiple markers at this line
    - Syntax error, insert "}" to complete 
    Statement
    - Syntax error, insert "}" to complete 
    Statement
     
  2. Offline

    Assist

    MetaSurvival
    "insert "}" to complete Statement."

    Just insert the brackets.
     
Thread Status:
Not open for further replies.

Share This Page