[Tool/Web/Other] (PHP) Simple ranking INI [engine]
#1

I did a year ago. And I dont post in area

What this:
This is a PHP code, used to make ranking via INI files
(useful for those who do not have mysql server)

Code:
PHP код:
/* 
 *  Copyright © 2012 [iPs]TeaM 
 *  Bruno da Silva (brunoemail@r7.com) 
 *  Get INI Files and make ranking by tag. (KILLS) 
  
*/ 
<?php 
    
// ====== [ change here  ] ====================================== 
        
$pasta "C:/Arquivos de Programas/Pawn/scriptfiles/Contas Jogadores"
        
$classificar "Kills";  // key to ranking "Kills=VALUE" file
        
$jogadores= -1
        
$dadosjogador = array(); 
        
$handlepasta opendir($pasta); 
  
    
// list file
        
while(($nickname  readdir($handlepasta)) !== false) { 
                if((
$nickname !=".") && ($nickname  !="..") && ($nickname != "index.htm") && ($nickname !="info")) { // filter files. 
            
$jogadores++; 
                        
$contaaberta    parse_ini_file($pasta ."/"$nickname); 
                        
$nickname      substr($nickname0,strlen($nickname)-4); 
                        
$dadosjogador[$jogadores] =  array($contaaberta[$classificar] ,$nickname ); 
                } 
        } 
    
// ranking
  
        
array_multisort ($dadosjogador$dadosjogador); 
  
    
// print data
        
foreach ($dadosjogador as $jogador_atual) { 
                echo 
"<b>Player</b>:  ".$jogador_atual[1]."    |    <b>Kills</b>:  ".$jogador_atual[0]."  <br>"
        } 
?>
Example:
Player: Bruno1 | Kills: 4
Player: Player | Kills: 2
Player: SAMP | Kills: 1

Pastebin (PT):
http://pastebin.com/3rak6b2Y

You can improve the code .. This is only a sketch - proof conception (?)

Original Post:
https://sampforum.blast.hk/showthread.php?tid=352910
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)