PHP: $pc = count($this->getServer()->getOnlinePlayers());$arr = $this->getServer()->getOnlinePlayers();//while loop $pc--; $play = $arr[$pc]; $name = $arr[$pc]->getName(); Problem: Undefined offset (Numofplayers - 1), call to member function getName() I've done a var dump and $arr does contain $pc online and does contain player object
Notice: Undefined offset: 0 in C:\Users\Jamie\Desktop\PocketMine-MP\plugins\MPFacPLUG\src\MPFac\MPFac.php on line 505 [11:31:42] [Server thread/CRITICAL]: Could not execute task MPFac\Timer: Call to a member function getName() on null [11:31:42] [Server thread/CRITICAL]: Error: "Call to a member function getName() on null" (EXCEPTION) in "/MPFacPLUG/src/MPFac/MPFac" at line 506