Quick Problem, probably easy fix.

Discussion in 'Plugin Development' started by BetaNyan, Oct 29, 2014.

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

    BetaNyan

    Code:
    if (!in.contains(p.getName())) {
                            p.sendMessage(PovertyCraft.prefix + "Now entering " + PovertyCraft.chat.getPlayerPrefix(Bukkit.getPlayer(s)) + s + " protected area.");
                            in.add(p.getName());
                        } else {
                            return;
                        }
    This is in a PlayerMoveEvent, it is spamming the msg so I'm guessing it didn't add it successfully? I feel really stupid for this but what the hell did I do wrong xD
     
  2. Offline

    ChipDev

    You should check if getFrom() is outside of the locations, and if not, and the getTo() is inside, the player moved in.
     
  3. Offline

    BetaNyan

    But then everytime I move inside the getTo() will always be inside and it will once again spam it.

    Can anyone halp?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 14, 2016
  4. Offline

    SyTeck

    I think he means like this:
    if getFrom() is outside the area && getTo() is inside the area, you should then send the message.
     
  5. Offline

    BetaNyan

    Okay
     
  6. Offline

    Garris0n

    1. Don't use the player's name as a unique identifier, use the UUID.
    2. Post the full class.
     
  7. Offline

    BetaNyan

    Fixed it
     
Thread Status:
Not open for further replies.

Share This Page