I'm trying to make a top 10 kills plugin but it only shows 1 playeplays instead of 10. Can anyone help? PHP: $top = $this->database->query("SELECT * FROM data ORDER BY kills DESC LIMIT 10;"); $i = 0; $sender->sendMessage("§l§7Top 10 Players With Most Kills"); while($result = mysqli_fetch_array($top, MYSQLI_ASSOC)){ $place = $i + 1; $player = $result["name"]; $value = $result["kills"]; $sender->sendMessage("§a" . $place . ". " . $player . " " . $value); $i = $i + 1; return true;
Remove the return from the loop. The return will end execution of the loop (and also the method if it's in a method). It's the basics. http://php.net/manual/en/function.return.php