GetOnlinePlayers() does not return an indexed array #2
Etichette
Nessuna etichetta
Nessuna pietra miliare
Nessun progetto
Nessun assegnatario
1 partecipante
Notifiche
Scadenza
Nessuna scadenza impostata.
Dipendenze
Nessuna dipendenza impostata.
Riferimento: Ad5001/PlayerSelectors#2
Caricamento…
Crea riferimento in una nuova segnalazione
Descrizione non fornita.
Elimina ramo "%!s()"
L'eliminazione di un ramo è definitiva. Nonostante il ramo eliminato potrebbe continuare ad esistere per un breve periodo di tempo prima di essere realmente eliminato, l'eliminazione NON PUÒ essere annullata in molti casi. Continuare?
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.