1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Resolved Checking if player is in area

Discussion in 'Client & Site Support' started by faustis1337, May 27, 2018.

  1. faustis1337

    faustis1337 Always Buying/Selling RM Credits!

    Joined:
    Dec 27, 2017
    Messages:
    95
    Likes Received:
    8
    Hey ppl, i need help with checking if player is in area
     
  2. Best Answer:
    Post #2 by CuppaJava, May 27, 2018
  3. CuppaJava

    CuppaJava cuppa.drink(java);

    Joined:
    Mar 13, 2018
    Messages:
    6,111
    Likes Received:
    1,371
    I think what you're asking for is to check if the local player is within a certain area? If so:

    Code (Text):
    1.         Player pl;
    2.         Area a = new Area.Rectangular(new Coordinate(0,0,1), new Coordinate(5,5,1));
    3.         if((pl=Players.getLocal())!=null && a.contains(pl)) {
    4.             //player is in area a
    5.         }
    Where Area a is outlined by bottom left coord (0,0,1) and top right coord (5,5,1).

    More info: Area and Area.Rectangular


    Edit: Just for the record, this thread should be in the section Developer Support
     
    Wet Rag likes this.
  4. faustis1337

    faustis1337 Always Buying/Selling RM Credits!

    Joined:
    Dec 27, 2017
    Messages:
    95
    Likes Received:
    8

Share This Page

Loading...