Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //===========[ CONFIGURAÇÕES ]
- // Coloque aqui aonde fica a pasta com as contas:
- $PlayerDir = "./scriptfiles/";
- // Aqui definas quantos players será exibido (TOP)
- // Por default é 15 (top 15 players).
- $MaxPlayers = 15;
- // Classificação, coloque oque servirá para classificar.
- $Ordenacao = "Level"; // Exibe os players mais ricos do servidor.
- // As linhas são oque vai ler e exibir, no momento suportando 2 linhas,
- $Linhas = Array("Level", "Money");
- //=========[ MAIN ]
- $Diretorio = opendir($PlayerDir);
- $Player = Array();
- while(false != ($Arquivo = readdir($Diretorio))){
- if(strstr($Arquivo, ".ini")){
- $getLinha = parse_ini_file($PlayerDir.$Arquivo);
- $Player[substr($Arquivo, 0, -4)] = $getLinha[$Ordenacao];
- }
- }
- arsort($Player);
- $Players = count($Player);
- $Interador = 0;
- $Exibir .= "<center><img src='Ranking.png' /> <br /><hr width='800'>";
- $Exibir .= "<head><title>Ranking</title></head>";
- $Exibir .= "<table style='font-size : 20px;width:64%;'>";
- $Exibir .= "<tr><td></td><td><b>Nome</b></td><td><b>Nível</b></td><td><b>Dinheiro</b></td></tr>";
- while($Players != $Interador){
- $Saida = ($Interador + 1);
- $getLine = parse_ini_file($PlayerDir.Key($Player).".ini");
- if($Interador % 2){
- $Exibir .= "<tr bgcolor='#CFCFCF'><td>#".$Saida."</td><td>".Key($Player)."</td><td>".$getLine[$Linhas[0]]."</td><td>".$getLine[$Linhas[1]]."</td></tr>";
- }
- else{
- $Exibir .= "<tr><td>#".$Saida."</td><td>".Key($Player)."</td><td>". $getLine[$Linhas[0]]."</td><td>".$getLine[$Linhas[1]]."</td></tr>";
- }
- next($Player);
- $Interador ++;
- }
- while($MaxPlayers != $Interador){
- $Saida = ($Interador + 1);
- if($Interador % 2){
- $Exibir .= "<tr bgcolor='#CFCFCF'><td>#".$Saida."</td><td>N/A</td><td>N/A</td><td>N/A</td></tr>";
- }
- else{
- $Exibir .= "<tr><td>#".$Saida."</td><td>N/A</td><td>N/A</td><td>N/A</td></tr>";
- }
- $Interador++;
- }
- $Exibir .= "</table><hr width='800'>";
- echo $Exibir;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement