SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Tools and Files

Reply
 
Thread Tools Display Modes
Old 12/07/2012, 11:35 PM   #1
ipsBruno
Godfather
 
ipsBruno's Avatar
 
Join Date: Apr 2010
Location: Brazil, Caxias RS
Posts: 6,088
Reputation: 545
Default (PHP) Simple ranking INI [engine]

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 Code:
/* 
 *  Copyright (c) 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:
http://forum.sa-mp.com/showthread.php?t=352910
__________________
Baixar Músicas Grátis
ipsBruno is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tool/Web/Other] (PHP) Engine para Ranking em Arquivos INI ipsBruno Lançamentos/Releases 53 13/10/2012 03:38 PM
simple engine command. Jordiee Scripting Help 17 12/05/2012 02:37 PM
Ranking[PHP] Zhoom Scripting Help 5 04/03/2012 09:17 AM
[HELP]I just edited my /engine system and when i do /engine it says "unknown Lilcuete Help Archive 2 25/04/2010 01:31 PM


All times are GMT. The time now is 08:59 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.