[Share] Ranking Script

Joined
Aug 29, 2005
Messages
84
Reaction score
0
Ranking Script V3
Made By Rad
​

Status:
- ranks all characters by level

- ranks up to 10 (change the limit to any number you like)
- Blocks GMS from being on the list

- fixed the ranking number to skip gms

I have made a ranking script enjoy.

rank.php
<center>
<table border=1 bordercolor=black width=300 cellpadding='0' cellspacing='0'><tr>
<td align=center><font size=5>Character Ranking</font></td>
</tr></table>

<table border=1 bordercolor=black width=300 cellpadding='0' cellspacing='0'><tr>
<td>Rank</td><td>Name</td><td>Level</td><td>Class</td><td>Gender</td></tr><tr>
<?php
$db = mysql_connect( 'localhost', 'root', 'MYSQL PASSWORD' ) or die( "Couldn't establish connection to MySQL: " . mysql_error() );
$dbname = 'flyff';
mysql_select_db( $dbname ) or die( "Couldn't select MySQL database: " . mysql_error() );

$log_query = mysql_db_query("$dbname","SELECT `charname`,`level`,`sex`,`accountname`,`exp`,`class` FROM characters WHERE `level` > 0 ORDER BY level DESC");
$num=mysql_numrows($log_query);
$i=1;
$rank=0;
while ($i < $num) {
$log_row = mysql_fetch_row($log_query);

if ($i > 11) { exit; }

$account = $log_row[3];
$char = mysql_query('SELECT username,accesslevel FROM accounts WHERE username = "'.$account.'"');
$row = mysql_fetch_row($char);
if ($row[1] > 1) {
$i++;
}
$rank++;
$char = $log_row[0];
$level = $log_row[1];
$sex = $log_row[2];
if ($sex == 0) { $sex2 = M; }
if ($sex == 1) { $sex2 = F; }
$accountname = $log_row[3];
$exp = $log_row[4];
$job = $log_row[5];
if ($job == 0) { $job2 = Vagrant; }
if ($job == 1) { $job2 = Mercenary; }
if ($job == 2) { $job2 = Acrobat; }
if ($job == 3) { $job2 = Assist; }
if ($job == 4) { $job2 = Magician; }
if ($job == 5) { $job2 = Puppeteer; }
if ($job == 6) { $job2 = Knight; }
if ($job == 7) { $job2 = Blade; }
if ($job == 8) { $job2 = Jester; }
if ($job == 9) { $job2 = Ranger; }
if ($job == 10) { $job2 = Ringmaster; }
if ($job == 11) { $job2 = Billposter; }
if ($job == 12) { $job2 = Psykeeper; }
if ($job == 13) { $job2 = Elementor; }
if ($job == 14) { $job2 = GateKeeper; }
if ($job == 15) { $job2 = Doppler; }
if ($job == 16) { $job2 = Knight; }
if ($job == 17) { $job2 = Blade; }
if ($job == 18) { $job2 = Jester; }
if ($job == 19) { $job2 = Ranger; }
if ($job == 20) { $job2 = Ringmaster; }
if ($job == 21) { $job2 = Billposter; }
if ($job == 22) { $job2 = Psykeeper; }
if ($job == 23) { $job2 = Elementor; }
if ($job == 24) { $job2 = Knight; }
if ($job == 25) { $job2 = Blade; }
if ($job == 26) { $job2 = Jester; }
if ($job == 27) { $job2 = Ranger; }
if ($job == 28) { $job2 = Ringmaster; }
if ($job == 29) { $job2 = Billposter; }
if ($job == 30) { $job2 = Psykeeper; }
if ($job == 31) { $job2 = Elementor; }
echo "<td> $rank </td><td> $char </td><td> $level </td><td> $job2 </td><td> $sex2 </td></tr><tr>";
$i++;
}
?>
</tr></table>

Make a file called rank.php and stick this inside then add a link on the site to rank.php :)

Change
`clas s` to `class`

Thanks,

Rad
 
Last edited:
Re: [Release]Ranking Script

Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in C:\Program\Abyss Web Server\htdocs\rank.php on line 15
 
Re: [Release]Ranking Script

for error juste check line 15 for "clas s" <=="class"



edit=> sorry i forgot something, ths :)
edit=>sorry again everything s working.
 
Last edited:
Re: [Share]Ranking Script

hmm this script is good , but can you write a script ...
So you can make all the character names in "[GM] have ignored and the list does not appear?
 
Re: [Share]Ranking Script

hmm this script is good , but can you write a script ...
So you can make all the character names in "[GM] have ignored and the list does not appear?

You need to make an INNERJOIN with the account table and just take who have accesslevel of 100 or 0, or take 0 out.
0 = banned people.
 
Re: [Share]Ranking Script

Fix!

$num=mysql_num_rows($log_query);

Replace mysql_db_query with mysql_query.

-
This is a two second script. Still failed at it lol.
 
Re: [Share]Ranking Script

i hate 1 erro =(
Notice: Use of undefined constant F - assumed 'F' in c:\arquivos de programas\easyphp1-8\www\rank.php on line 31

Notice: Use of undefined constant Ringmaster - assumed 'Ringmaster' in c:\arquivos de programas\easyphp1-8\www\rank.php on line 63

can any help me pl0x?
 
Back