(In advance I know Pemapmodder will say to use array which I will do once this issue is resolved lol, as he has said before ) PHP: private $SpleefOnePlayerOne;private $SpleefOnePlayerTwo; PHP: if (!isset($SpleefOnePlayerOne or $this->getServer()->getPlayer($this->SpleefOnePlayerOne)->isOnline() == false)) { $this->SpleefOnePlayerOne = $event->getPlayer()->getName();//This specific line of code sets the player as a Spleef player. $event->getPlayer()->teleport(new Vector3(-1206, 26, 280));//This line of code teleports the player to the game spawn point. $player->sendMessage("[Spleef] Please Wait. (Player One)");//Sends the player a message to wait. $item = Item::get(256,0,1);//$item is set to a iron shovel. $player->getInventory()->addItem($item);//This adds $item to the players inventory. } // THIS ALLOCATES THE PLAYER TO PLAYER TWO FOR SPLEEF LOBBY ONE ALSO KNOWN AS $SpleefOnePlayer[1] elseif (!isset($SpleefOnePlayerTwo) or $this->getServer()->getPlayer($this->SpleefOnePlayerTwo)->isOnline() == false){ $this->SpleefOnePlayerTwo = $event->getPlayer()->getName();//This specific lineof code sets the player as a Spleef player. $event->getPlayer()->teleport(new Vector3(-1221, 26, 273));//This line of code teleports the player to the game spawn point. $player->sendMessage("[Spleef] Please Wait. (Player Two)");//Sends the player a message to wait. $item = Item::get(256,0,1);//$item is set to a iron shovel. $player->getInventory()->addItem($item);//This adds $item to the players inventory. } Why is it that all players are set to $SpleefOnePlayerOne im just stuck help would be much appreciated
PHP: if (!isset($SpleefOnePlayerOne or $this->getServer()->getPlayer($this->SpleefOnePlayerOne)->isOnline() == false)) { Should be: PHP: if (!isset($SpleefOnePlayerOne) or $this->getServer()->getPlayer($this->SpleefOnePlayerOne)->isOnline() == false) {
um lol sorry that was a typo because while i was making this thread i accidently deleted that part so i wrote my self in the wrong bracket lol ugh PHP: if (!isset($SpleefOnePlayerOne)) { $this->SpleefOnePlayerOne = $event->getPlayer()->getName();//This specific line of code sets the player as a Spleef player. $event->getPlayer()->teleport(new Vector3(-1206, 26, 280));//This line of code teleports the player to the game spawn point. $player->sendMessage("[Spleef] Please Wait. (Player One)");//Sends the player a message to wait. $item = Item::get(256,0,1);//$item is set to a iron shovel. $player->getInventory()->addItem($item);//This adds $item to the players inventory. } // THIS ALLOCATES THE PLAYER TO PLAYER TWO FOR SPLEEF LOBBY ONE ALSO KNOWN AS $SpleefOnePlayer[1] elseif (!isset($SpleefOnePlayerTwo) or $this->getServer()->getPlayer($this->SpleefOnePlayerTwo)->isOnline() == false){ $this->SpleefOnePlayerTwo = $event->getPlayer()->getName();//This specific lineof code sets the player as a Spleef player. $event->getPlayer()->teleport(new Vector3(-1221, 26, 273));//This line of code teleports the player to the game spawn point. $player->sendMessage("[Spleef] Please Wait. (Player Two)");//Sends the player a message to wait. $item = Item::get(256,0,1);//$item is set to a iron shovel. $player->getInventory()->addItem($item);//This adds $item to the players inventory. }
I took out the online check because I was testing with one device by logging with different users, still all players are set to $SpleefOnePlayerOne
Or maybe you should use arrays, you won't even have this issue if you use arrays. P.S. Not relevant, just to show off: http://pemapmodder.zapto.org/pg/style/wallpaper.PNG (Or maybe you can't even read it because it is sometimes down for no reason)