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

Solved teleport player different position .

Comments in 'Plugin Development' started by Ritch, Feb 14, 2016.

  1. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
    Please ignore me :'(
  2. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
  3. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    What is $r? rand() expects zero or two parameters.
    PHP:
    new Position(rand($r),$r2,rand($r), ...)
    This code looks unreasonable.
    PocketKiller and AndrewBit like this.
  4. AndrewBit
    Offline

    AndrewBit Notable Member

    Joined:
    Jun 18, 2015
    Posts:
    435
    Minecraft User:
    AndrewBit4
    Learn PHP, I was thinking that you're only a newbie, but no, you're a lamer.
    Before start trying to code plugins, learn PHP at least in Codecademy and php.net, next, come back here.
    And no, I'm not trying to flame you, this is a suggestion, if you really want improve in code, do it.
  5. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
    Stop your suggestion i Already learn PHP I have not problem with PHP I Make à 1vs 1
  6. AndrewBit
    Offline

    AndrewBit Notable Member

    Joined:
    Jun 18, 2015
    Posts:
    435
    Minecraft User:
    AndrewBit4
    If you don't know how to make this as well, I'm sorry, but no, you didn't learn PHP, at least as well.
  7. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
    My problem its teleport $player1 & $player2 position
    Capitcher ?
  8. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
    i have Already learn PHP stop your suggestions !
  9. AndrewBit
    Offline

    AndrewBit Notable Member

    Joined:
    Jun 18, 2015
    Posts:
    435
    Minecraft User:
    AndrewBit4
    What's the problem?
    PHP:
    $player->teleport(new Position($x,$y,$z,$map));
    Do it with both, and... Done?
    Omar2s2, PocketKiller and PEMapModder like this.
  10. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
    PHP:
    if(count($this->players) >= 1)){
      
    $x $this->cfg->get("player_join_x");
    $y $this->cfg->get("player_join_y");
      
    $z $this->cfg->get("player_join_z");
      
    $player->teleport(new Position ($x$y$z $this->getServer()->getLevelByName("T'est")));
    }
    elseif(
    ect....
  11. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Nobody, not even people in the PHP team, can guarantee that they learnt PHP completely. PHP is a very powerful programming language that consists of a lot of syntaxes, functions and other tweaks.

    Maybe I'm exaggerating.
    But first of all, if you think that you learnt PHP so well, explain the difference between an abstract class and an interface.
    Vaivez66, AndrewBit and PocketKiller like this.
  12. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
  13. MineBuilderFR
    Offline

    MineBuilderFR Active Member

    Joined:
    Mar 14, 2015
    Posts:
    56
    Minecraft User:
    MineBuilderFR
    @PEMapModder I know : He will teleport players in different position, I think to do 2 positions like: rand (30,40) to exclude some players block if he desired it (Sorry For my bad English x') #googleTranslate )
    ==
    Now if you want rand teleport interact like lifeboat you can use @Ritch

    PHP:
    //$this->players = []; //for array
    //$this->players=new Config($this->getDataFolder()."pcount.yml",Config::YAML); //config

    if($this->players == 1){
    $p->teleport(new Position($x,$y,$z,$yourmap));

    //$this->players->set($this->players->get("count")-1); //For config
    //$this->players->save(); //For config

    }
    elseif(
    $this->players == 2){
    $p->teleport(new Position($x,$y,$z,$yourmap));

    //$this->players->set($this->players->get("count")-1); //For config
    //$this->players->save(); //For config
    }
    //..
    Last edited: Feb 14, 2016
    Ritch likes this.
  14. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
    Thank mann :)
  15. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
  16. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
    I have bug chunk :(
  17. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    He is such abuser.
    PocketKiller likes this.
  18. TheMaks
    Offline

    TheMaks Active Member

    Joined:
    Jul 19, 2015
    Posts:
    58
    Minecraft User:
    TheMaks
    PHP:
    $pls $this->getServer()->getOnlinePlayers();
    for(
    $i 0$i count($pls); $i++){
    $pls[i].teleport(new Position($x,$y,$z,$level));
    }
  19. PocketKiller
    Offline

    PocketKiller Notable Member

    Joined:
    Jul 20, 2015
    Posts:
    741
    this isn't Java, You mixed Java with PHP.
    PEMapModder likes this.
  20. Vaivez66
    Offline

    Vaivez66 Notable Member Plugin Developer

    Joined:
    Jun 10, 2015
    Posts:
    402
    Plugins:
    2
    Just replace that one '.' with '->', done...

Share This Page

Advertisement