I don't understand whats wrong with my code (old API)! PHP: $pList = $this->api->player->getAll();$rNumPlayer = rand(0, count($pList) - 1);$rPlayer = $pList[$rNumPlayer];$rPlayerName = $rPlayer->username; When broadcasting a message using that $rPlayerName nothing appears!
You are not using Java. $pList is ordered by client IDs ($ip . ":" . $port), not with increasing integers. Therefore, your randomly generated integer is not an existent offset in $pList. Use array_rand().