I'm using SW_svile. It have an code (can use as API) that count player's game that they win. I think SW by GamakCZ will have the same thing like that.
I don't think a finished product of this exists yet, and I may work on it, but here's the API, if anyone needs it.
I found this: PHP: $this->pg->getServer()->loadLevel($this->world); //CLOSE SPECTATORS foreach ($this->spectators as $playerName) { if (($s = $this->pg->getServer()->getPlayer($playerName)) instanceof Player) $this->closePlayer($s); } //CLOSE PLAYERS foreach ($this->players as $name => $spawn) { if (($p = $this->pg->getServer()->getPlayer($name)) instanceof Player) { $this->closePlayer($p); if (!$force) { //Broadcast winner foreach ($this->pg->getServer()->getDefaultLevel()->getPlayers() as $pl) { $pl->sendMessage(str_replace('{SWNAME}', $this->SWname, str_replace('{PLAYER}', $p->getName(), $this->pg->lang['server.broadcast.winner']))); } //Economy reward if ($this->pg->configs['reward.winning.players'] && is_numeric($this->pg->configs['reward.value']) && is_int(($this->pg->configs['reward.value'] + 0)) && $this->pg->economy instanceof \svile\sw\utils\SWeconomy && $this->pg->economy->getApiVersion() != 0) { $this->pg->economy->addMoney($p, (int)$this->pg->configs['reward.value']); $p->sendMessage(str_replace('{MONEY}', $this->pg->economy->getMoney($p), str_replace('{VALUE}', $this->pg->configs['reward.value'], $this->pg->lang['winner.reward.msg']))); } //Reward command $command = trim($this->pg->configs['reward.command']); if (strlen($command) > 1 && $command{0} == '/') { $this->pg->getServer()->dispatchCommand(new \pocketmine\command\ConsoleCommandSender(), str_replace('{PLAYER}', $p->getName(), substr($command, 1))); } } } } //Other players foreach ($this->pg->getServer()->getLevelByName($this->world)->getPlayers() as $p) $p->teleport($p->getServer()->getDefaultLevel()->getSpawnLocation()); $this->reload(); return true; } You can use this.
That is not at all useful, because it's for a different plugin entirely. This will not work for OP's plugin. How do you want the leaderboard to be displayed? Command, Floating text, etc.? I assume you want a leaderboard just for wins, and nothing else?