Need help from Dev's

Discussion in 'Plugin Development' started by tedwurd, Jul 23, 2014.

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

    tedwurd

    Hi guys,

    I need help for my first plugin.
    I try on a Silend stroke plugin.
    I have programmed the player when join in Silend mode is and if he then the command /show uses that you can see the players again.
    up to this point everything is perfect!

    I wanted the one with the command /hide they invisible again but when I enter the command, nothing happens.
    here is a screenshot:

    [​IMG]


    This is the code:

    Code:java
    1. @Override
    2. public boolean onCommand(CommandSender sender, Command cmd, String label,
    3. String[] args) {
    4.  
    5. Player p = (Player) sender;
    6.  
    7. if (label.equalsIgnoreCase("show")) {
    8. if (args.length == 0) {
    9. sender.sendMessage(ChatColor.DARK_PURPLE + "[Silent-Hub]"
    10. + ChatColor.LIGHT_PURPLE + " - Deaktiviert!");
    11. for (Player player : getServer().getOnlinePlayers()) {
    12. p.showPlayer(player);
    13.  
    14. }
    15.  
    16. {
    17.  
    18. if (cmd.getName().equalsIgnoreCase("hide")) {
    19. for (Player player : getServer().getOnlinePlayers()) {
    20. p.hidePlayer(player);
    21. sender.sendMessage(ChatColor.DARK_PURPLE
    22. + "[Silent-Hub]" + ChatColor.LIGHT_PURPLE
    23. + " - Aktiviert!");
    24.  
    25. }
    26. }
    27. }
    28.  
    29. }
    30. }
    31.  
    32. return false;



    Sorry for my bad english i used a Translator.
    Can you please help me?

    Greez tedwurd
     
  2. Offline

    SkyleTyler1337

    Code:
     player.hidePlayer(player);
    needs to be
    Code:
     p.hidePlayer(player);
    and to format it do SHIFT+CTRL+F
     
  3. Offline

    tedwurd

    does not work :(
     
Thread Status:
Not open for further replies.

Share This Page