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

Detect if player don't move

Comments in 'Plugin Development' started by Guillaume351, Mar 3, 2014.

  1. Guillaume351
    Offline

    Guillaume351 Active Member Plugin Developer

    Joined:
    Oct 11, 2013
    Posts:
    150
    Plugins:
    1
    Minecraft User:
    Guillaume351
    Hello,
    I need code to detect if a player don't move during 20 seconds.
    Thank you.
  2. Topic
    Offline

    Topic New Member Plugin Developer

    Joined:
    Aug 29, 2013
    Posts:
    47
    Plugins:
    3
    Minecraft User:
    topic
    So, you can make function it will repeat every 20 seconds, and check if player stay on one coordinates 20 seconds you detect it and for example sand massage, but it stupid :D
  3. Guillaume351
    Offline

    Guillaume351 Active Member Plugin Developer

    Joined:
    Oct 11, 2013
    Posts:
    150
    Plugins:
    1
    Minecraft User:
    Guillaume351
    Yes but how get player coordinates ? It's for an auto afk, I don't want to send message to players x)
  4. Topic
    Offline

    Topic New Member Plugin Developer

    Joined:
    Aug 29, 2013
    Posts:
    47
    Plugins:
    3
    Minecraft User:
    topic
    So, may be with $this->api->player->getAll() function and detect all of players coordinates and check it. But I don't know :)
  5. Topic
    Offline

    Topic New Member Plugin Developer

    Joined:
    Aug 29, 2013
    Posts:
    47
    Plugins:
    3
    Minecraft User:
    topic
    Or with event player.move
  6. Guillaume351
    Offline

    Guillaume351 Active Member Plugin Developer

    Joined:
    Oct 11, 2013
    Posts:
    150
    Plugins:
    1
    Minecraft User:
    Guillaume351
    I will try tomorroy, thank you.
  7. Men'o'Gang!
    Offline

    Men'o'Gang! Ban Evader Banned

    Joined:
    Mar 3, 2014
    Posts:
    18
    yea use player.move il give ya some code and make the plugin mine and yours or give me some credit ok, just wait
  8. Men'o'Gang!
    Offline

    Men'o'Gang! Ban Evader Banned

    Joined:
    Mar 3, 2014
    Posts:
    18
    OK this is all what i got i cant get anything more:
    PHP:
        public function eventHandler($data$event){
            switch(
    $event){
                case 
    "player.move":
                
    $x $issuer->entity->x;
                
    $y $issuer->entity->y;
                
    $z $issuer->entity->z;
                
    $this->api->player->get($z);
                
    $this->api->player->get($y);
                
    $this->api->player->get($x)
                if(
    $this->api->player->get($y$z$x) =
                }
                }
  9. Guillaume351
    Offline

    Guillaume351 Active Member Plugin Developer

    Joined:
    Oct 11, 2013
    Posts:
    150
    Plugins:
    1
    Minecraft User:
    Guillaume351
    I won't upload the plugin, but thank you. I 'll try just after I finish an other plugin.

Share This Page

Advertisement