Okay, so i want teleport 5 players to a certain positions, 5 to another etc... And i already got the players name as a private variable !
Here: PHP: <?phpnamespace Example;use pocketmine\command\Command;use pocketmine\command\CommandSender;use pocketmine\event\Listener;use pocketmine\plugin\PluginBase;use pocketmine\utils\Config;use pocketmine\utils\TextFormat;use pocketmine\math\Vector3;class Main extends PluginBase implements Listener{ public function onLoad(){ $this->getLogger()->info("Exemple plugin loaded"); } public function onEnable(){ $this->getServer()->getPluginManager()->registerEvents($this, $this);} } public function onCommand(CommandSender $sender, Command $command, $label, array $args){ if(strtolower($command->getName("teleporter"))){ $ExamplePlayer1 = new Vector3(2, 2, 2); $ExamplePlayer2 = new Vector3(2, 2, 2); $ExamplePlayer3 = new Vector3(2, 2, 2); } }}
Tip: If you do teleport players to 2,2,2 the server will probably lag them into the abyss/void lol on 0.10.5 this caused me a bug we i respawn in an empty world....
Loop through the array of players or whatever you have, teleporting each one to a spawn point or whatever.
PHP: $players = $this->getServer()->getOnlinePlayers();for($i = 1; true; $i++){ $v3 = new Vector3($i, $i, $i); for($j = 0; $j < 5; $j++){ if(!isset($players[$index = ($i - 1) * 5 + $j])) break 2; $players[index]->teleport($v3); }}