Else show message

Discussion in 'Plugin Development' started by Subtelny, Sep 1, 2014.

Thread Status:
Not open for further replies.
  1. Hello! I'm new coder and i have problem (sorry for my english)

    This is my part of code:
    Show Spoiler

    Code:java
    1. private void showUsage(Player player)
    2. {
    3. SimpleIslandV6 isle = plugin.getPlayerIsland(player.getName());
    4. if (isle == null)
    5. isle = plugin.getHelpingIsland(player);
    6.  
    7. if (isle != null)
    8. {
    9. plugin.showMessage(player, "§3§m==========--§r §a§lDG§f§lCraft §3§m--============");
    10. plugin.showMessage(player, "§r");
    11. plugin.showMessage(player, plugin.getLoc("com-command-delete"));
    12. plugin.showMessage(player, plugin.getLoc("com-command-home"));
    13. plugin.showMessage(player, plugin.getLoc("com-command-sethome"));
    14. plugin.showMessage(player, plugin.getLoc("com-command-expell"));
    15. plugin.showMessage(player, plugin.getLoc("com-command-add"));
    16. plugin.showMessage(player, plugin.getLoc("com-command-remove"));
    17. plugin.showMessage(player, plugin.getLoc("com-command-leave"));
    18. plugin.showMessage(player, plugin.getLoc("com-command-visit"));
    19. plugin.showMessage(player, plugin.getLoc("com-command-calc"));
    20. plugin.showMessage(player, plugin.getLoc("com-command-rank"));
    21. plugin.showMessage(player, "§8Wiecej komend znajdziesz w /menu !");
    22. }
    23. else
    24.  
    25. //------ If player doesnt have island shows him this
    26.  
    27. plugin.showMessage(player, plugin.getLoc("error-no-island"));
    28. plugin.showMessage(player, "§3§m============--§r §a§lDG§f§lCraft §3§m--============");
    29. plugin.showMessage(player, "§r");
    30. plugin.showMessage(player, "§a Pierw musisz stworzyc wyspe aby");
    31. plugin.showMessage(player, "§a zobaczyc wszystkie komendy wyspy!");
    32. plugin.showMessage(player, "§r");
    33. plugin.showMessage(player, "§3 Uzyj: §f/wyspa stworz");
    34. plugin.showMessage(player, "§r");
    35. }



    If player doesnt have island shows him last message (its okey)

    And if player create island shows him first message and last (Not okey :c)
    What can i do to repair this?

    Sorry for my english one more time :3
     
  2. Offline

    hintss

    fix your {}
     
  3. Where? Program doesnt show wrong {}
     
  4. Offline

    hintss

    add a { after the else, and another } after the blob of messages it's supposed to send
     
    Subtelny likes this.

  5. O, thank for help, it working :)
     
Thread Status:
Not open for further replies.

Share This Page