1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Solved Greater than less than

Discussion in 'Development' started by xXNiceAssassinlo YT, May 3, 2018.

  1. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    499
    GitHub:
    xXNiceYT
    can I get a example of xyz from

    When your inside
    x: 123 y: 124 z: 125 to x: 234 y: 245 z: 256

    Send message Hello

    When your outside
    Don’t send message


    Please do it I want see I am confuse on it
     
  2. LewBr

    LewBr Zombie

    Messages:
    385
    GitHub:
    lewbr
    https://forums.pmmp.io/threads/best-way-to-get-a-player-in-a-defined-region.433/
    or a simple way you can get by using PlayerMoveEvent like this:
    PHP:
                    public function onMove(\pocketmine\event\player\PlayerMoveEvent $event){
                     
                        
    $player $event->getPlayer();
                     
                        
    $playerX $player->getX();
                        
    $playerY $player->getY();
                        
    $playerZ $player->getZ();

                            if(
    $playerX 123 and $playerX 234 and $playerY 124 and $playerY 245 and $playerZ 125 and $playerZ 256){

                            
    $player->sendMessage("Hello world.");

                            }
                    }
     
    Primus and xXNiceAssassinlo YT like this.
  3. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    499
    GitHub:
    xXNiceYT
    Your the best like me lol
     
  4. LewBr

    LewBr Zombie

    Messages:
    385
    GitHub:
    lewbr
    Yeah but it has a little problem, when you do that the message sends every time to the player when they walks into the area, if you want to send only one time you may use arrays for that.
     
  5. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    499
    GitHub:
    xXNiceYT
    Nah I wanted like that <333 I love u no homo
     
    LewBr likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.