GetOnlinePlayers() does not return an indexed array #2
Rótulos
Sem rótulo
Sem etapa
Sem encarregados
1 Participantes
Notificações
Data de vencimento
Sem data de vencimento definida.
Dependências
Não estão definidas dependências.
Referência: Ad5001/PlayerSelectors#2
Carregando…
Criar uma nova questão referindo esta
Nenhuma descrição fornecida.
Eliminar o ramo "%!s(<nil>)"
Eliminar um ramo é algo permanente. Embora o ramo eliminado possa continuar a existir por um breve período de tempo antes de ser realmente removido, a operação NÃO PODERÁ ser desfeita na maioria dos casos. Quer continuar?
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.