Help with a litle stuff

Discussion in 'Plugin Development' started by FurmigaHumana, Jan 11, 2012.

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

    FurmigaHumana

    When de player use one command, he will be teleported to some where, but, if in this place he will probably die, when he use the command, will show a warning, to he put the itens in a chest before, if they inventory is empty, will skip the warning and he will be teleported.
    And if in that place he not gonna die, will just skip the warning and just teleport.

    If he will die or not will be defined in the config file with true/false.

    in this code ''dangerous'' is the boolean.

    Code:
                        if (!areInvContentsEmpty(player.getInventory().getContents(),
                    player.getInventory().getArmorContents())) {
                            if (dangerous = true) {
                player.sendMessage(player, "Put your itens in a chest and try again");
            return false;
                      }
            }
    here ya ho. The part to detect if the player have itens in the inventory works, but the parte to show or not dont work at all, i change some stuff, nothing happens, i change other stuff, even if is defined for false the player can't teleporte to the place...

    so if someone understand my very good english, help please.
     
  2. Offline

    kevhog

    = is to assign a variable, == to check values. You shouldn't be using either, as dangerous is a boolean: if(dangerous) is what you should be using
     
Thread Status:
Not open for further replies.

Share This Page