How can i check if a player is new to the server? Is their a function for this already built into PMMP? Here is my attempt which i haven't tested yet. PHP: /** * Checks if player is new to the sevrer * * @param Player $player * @return bool */ public function isNew(Player $player){ if(file_exists('players/'.$player->getName().'.dat')){ return true; } }
PHP: public function isNew(Player $player){ if(file_exists($this->getDataPatch() . '/players/' . $player->getName() . '.dat'){ return true; } return false;} But there is already function hasPlayedBefore()
Yuup nvm, solved Source: https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/Player.php#L404