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

world....

Comments in 'Plugin Development' started by PaulchenHD, Mar 27, 2016.

  1. PaulchenHD
    Offline

    PaulchenHD Active Member

    Joined:
    Jan 17, 2016
    Posts:
    111
    Minecraft User:
    Paulchen_HD
    countdown is ready but i like to have a code if the countdown 0 :
    if($seconds == 0) {


    and i like to have this:

    all players from the "world1" teleport to "world2" and all players from "world2" teleport to "world3" and all players from "world3" teleport to "world1"


    please help me :)
  2. JackboyPlay
    Offline

    JackboyPlay Active Member

    Joined:
    Apr 25, 2015
    Posts:
    507
    Minecraft User:
    JackboyPlay
    Get the online players in a level and teleport they to an another level!
  3. PaulchenHD
    Offline

    PaulchenHD Active Member

    Joined:
    Jan 17, 2016
    Posts:
    111
    Minecraft User:
    Paulchen_HD
    yeah i have it but i dont know how to set all world1->world2 world2->world3 world3->world1 do you know what i mean ? :D
  4. JackboyPlay
    Offline

    JackboyPlay Active Member

    Joined:
    Apr 25, 2015
    Posts:
    507
    Minecraft User:
    JackboyPlay
    No
  5. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Let's call the players in worlds 1, 2 and 3 A, B and C.
    PHP:
    // Level $world1, $world2, $world3;
    $A $world1->getPlayers();
    // now:
    // world 1: A
    // world 2: B
    // world 3: C
    foreach($world3->getPlayers() as $player){
      
    $player->teleport($world1->getSpawnLocation());
    }
    // now:
    // world 1: A, C
    // world 2: B
    // world 3: (empty)
    foreach($world2->getPlayers() as $player){
      
    $player->teleport($world3->getSpawnLocation());
    }
    // now:
    // world 1: A, C
    // world 2: (empty)
    // world 3: B
    foreach($A as $player){
      
    $player->teleport($world2->getSpawnLocation());
    }

    // now:
    // world 1: C
    // world 2: A
    // world 3: B
    Last edited: Mar 27, 2016
  6. PaulchenHD
    Offline

    PaulchenHD Active Member

    Joined:
    Jan 17, 2016
    Posts:
    111
    Minecraft User:
    Paulchen_HD
    i have this:

    PHP:
      if($seconds == 0) {
      foreach(
    $this->getServer()->getLevelByName("world1")->getPlayers() as $player) {
      
    $player->teleport($this->getOwner()->getServer()->getLevelByName("world2")->getSafeSpawn());
       
      } 
    and how tp the players from world2->world3 and world3->world1
  7. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Cache $world1, $world2 and $world3 if you want to prevent overhead of searching for a Level object with that name every time.
    PaulchenHD likes this.
  8. PaulchenHD
    Offline

    PaulchenHD Active Member

    Joined:
    Jan 17, 2016
    Posts:
    111
    Minecraft User:
    Paulchen_HD
    i test it ! :)
  9. JackboyPlay
    Offline

    JackboyPlay Active Member

    Joined:
    Apr 25, 2015
    Posts:
    507
    Minecraft User:
    JackboyPlay
    Whats forrach?
    PEMapModder likes this.
  10. HotFireyDeath
    Offline

    HotFireyDeath Notable Member Plugin Developer

    Joined:
    Mar 19, 2015
    Posts:
    328
    Plugins:
    1
    Minecraft User:
    HotFireyDeath
    PaulchenHD and PEMapModder like this.
  11. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    HotFireyDeath likes this.
  12. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Next time please quote my post. It's hard to understand that you were responding to my typo ;)
    HotFireyDeath likes this.

Share This Page

Advertisement