GetOnlinePlayers() does not return an indexed array #2
Chargement…
Référencer dans un nouveau ticket
Sans contenu.
Supprimer la branche "%!s()"
La suppression d’une branche est permanente. Bien qu’une branche supprimée puisse temporairement subsister, elle NE PEUT PAS être facilement restaurée. Continuer ?
Original issue #2 by Awzaw created at 2017-11-10T21:53:15Z
6a5ddcd42d/src/Ad5001/PlayerSelectors/selector/ClosestPlayer.php (L30)
This won't work because the array returned by GetOnlinePlayers() is not an indexed array, but an associative array with the players rawUUID as the key:
https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/Server.php#L2306
Also, your function needs to return an array with the name of the player, not the Player object.