Jump to content
MakeWebGames

[Gangster Legends] Leaderboard - FREE SCRIPT


jamiee

Recommended Posts

::::::::::: Leaderboard :::::::::::::

 

Screenshot:

http://i795.photobucket.com/albums/yy238/devtek_solutions/Leaderboard.jpg

Add the following to the "login" SQL table:

If value does not equal 0 the affected users will not show up.

[mysql]`staff` int(11) NOT NULL DEFAULT '0',[/mysql]

Add the following code to leaderboard.php:

<?php require("top.php"); ?>
<?
require("usercheck.php");
require("prison_check.php");
?>
<form method="post">
<table width="550" border="0" align="center" cellpadding="0" cellspacing="2" class="table">

 <tr>
<td colspan="3" align="left" class="head">Top 10 Ranked Players: </td>
 </tr>
 <tr>
<td width="150" align="left" class="sub">Name:</td>
<td width="150" align="left" class="sub">Rank:</td>
<td width="250" align="left" class="sub">Gang:</td>
</tr>

 <? 

$result = mysql_query("SELECT name,gang,exp,rank FROM login WHERE staff='0' AND sitestate='0' ORDER BY exp + 0 DESC LIMIT 0,10") or die(mysql_error());


// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
// Print out the contents of each row into a table

?>
 <tr>
<td width="150" align="left" class="cell"><?php echo "<a href=\"view_profile.php?name=". $row['name'] ."\" onFocus=\"if(this.blur)this.blur()\">".$row['name']."</a>"; ?></td>
<td width="150" align="left" class="cell"><?php echo $rank_array[$row['rank']]; ?></td>
<td width="250" align="left" class="cell"><?php 
if(empty($row['gang'])){ echo "No Gang."; }else{ echo "<a href=\"view_gang.php?name=". $row['gang'] ."\" onFocus=\"if(this.blur)this.blur()\" >".$row['gang']."</a>"; }?></td>
</tr>
 <?php } // while ?>
</table>


<table width="550" border="0" align="center" cellpadding="0" cellspacing="2" class="table">
 <tr>
<td colspan="3" align="left" class="head">Top 10 wealthiest Players: </td>
 </tr>
 <tr>
<td width="150" align="left" class="sub">Name:</td>
<td width="150" align="left" class="sub">Wealth:</td>
<td width="250" align="left" class="sub">Gang:</td>
 </tr>
 <? 

$result = mysql_query("SELECT money,name,gang FROM login WHERE staff='0' AND sitestate='0' ORDER BY money + 0 DESC LIMIT 0,10") or die(mysql_error());

// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
// Print out the contents of each row into a table

?>
 <tr>
<td width="150" align="left" class="cell"><?php echo "<a href=\"view_profile.php?name=". $row['name'] ."\" onFocus=\"if(this.blur)this.blur()\">".$row['name']."</a>"; ?></td>
<td width="150" align="left" class="cell"><?php

if($row['money'] >= 0 ){ $profile_wealth = $wealth_array[0];}
if($row['money'] >= 25000 ){ $profile_wealth = $wealth_array[1];}
if($row['money'] >= 50000 ){ $profile_wealth = $wealth_array[2];}
if($row['money'] >= 100000 ){ $profile_wealth = $wealth_array[3];}
if($row['money'] >= 250000 ){ $profile_wealth = $wealth_array[4];}
if($row['money'] >= 500000 ){ $profile_wealth = $wealth_array[5];}
if($row['money'] >= 1000000 ){ $profile_wealth = $wealth_array[6];}
if($row['money'] >= 10000000 ){ $profile_wealth = $wealth_array[7];}
if($row['money'] >= 1000000000 ){ $profile_wealth = $wealth_array[8];}
if($row['money'] >= 10000000000 ){ $profile_wealth = $wealth_array[9];}

echo $profile_wealth;

?></td>
<td width="250" align="left" class="cell"><?php 
if(empty($row['gang'])){ echo "No Gang."; }else{ echo "<a href=\"view_gang.php?name=". $row['gang'] ."\" onFocus=\"if(this.blur)this.blur()\" >".$row['gang']."</a>"; }?></td>
 </tr>
 <?php } // while ?>
</table>


</p>
</form>
<?php require("bottom.php"); ?>

 

Add the following to the top.php navigation:

Leaderboard

 

Enjoy the free script. :)

Link to comment
Share on other sites

  • 3 years later...
  • 2 weeks later...
<?php require("top.php"); ?>
<?php
require("usercheck.php");
require("prison_check.php");
?>
   <form method="post">
       <table width="550" border="0" align="center" cellpadding="0" cellspacing="2" class="table">

           <tr>
               <td colspan="3" align="left" class="head">Top 10 Ranked Players:</td>
           </tr>
           <tr>
               <td width="150" align="left" class="sub">Name:</td>
               <td width="150" align="left" class="sub">Rank:</td>
               <td width="250" align="left" class="sub">Gang:</td>
           </tr>
           <?php
           $result = mysql_query("SELECT name,gang,exp,rank FROM login WHERE staff='0' AND sitestate='0' ORDER BY exp + 0 DESC LIMIT 0,10") or die(mysql_error());
           // keeps getting the next row until there are no more to get
           while ($row = mysql_fetch_array($result)) {
// Print out the contents of each row into a table
               ?>
               <tr>
                   <td width="150" align="left"
                       class="cell"><?php echo "<a href=\"view_profile.php?name=" . $row['name'] . "\" onFocus=\"if(this.blur)this.blur()\">" . $row['name'] . "</a>"; ?></td>
                   <td width="150" align="left" class="cell"><?php echo $rank_array[$row['rank']]; ?></td>
                   <td width="250" align="left" class="cell"><?php
                       if (empty($row['gang'])) {
                           echo "No Gang.";
                       } else {
                           echo "<a href=\"view_gang.php?name=" . $row['gang'] . "\" onFocus=\"if(this.blur)this.blur()\" >" . $row['gang'] . "</a>";
                       }?></td>
               </tr>
           <?php } // while ?>
       </table>

       <table width="550" border="0" align="center" cellpadding="0" cellspacing="2" class="table">
           <tr>
               <td colspan="3" align="left" class="head">Top 10 wealthiest Players:</td>
           </tr>
           <tr>
               <td width="150" align="left" class="sub">Name:</td>
               <td width="150" align="left" class="sub">Wealth:</td>
               <td width="250" align="left" class="sub">Gang:</td>
           </tr>
           <?php
           $result = mysql_query("SELECT money,name,gang FROM login WHERE staff='0' AND sitestate='0' ORDER BY money + 0 DESC LIMIT 0,10") or die(mysql_error());
           // keeps getting the next row until there are no more to get
           while ($row = mysql_fetch_array($result)) {
// Print out the contents of each row into a table

               ?>
               <tr>
                   <td width="150" align="left"
                       class="cell"><?php echo "<a href=\"view_profile.php?name=" . $row['name'] . "\" onFocus=\"if(this.blur)this.blur()\">" . $row['name'] . "</a>"; ?></td>
                   <td width="150" align="left" class="cell"><?php

                       if ($row['money'] >= 0) {
                           $profile_wealth = $wealth_array[0];
                       }
                       if ($row['money'] >= 25000) {
                           $profile_wealth = $wealth_array[1];
                       }
                       if ($row['money'] >= 50000) {
                           $profile_wealth = $wealth_array[2];
                       }
                       if ($row['money'] >= 100000) {
                           $profile_wealth = $wealth_array[3];
                       }
                       if ($row['money'] >= 250000) {
                           $profile_wealth = $wealth_array[4];
                       }
                       if ($row['money'] >= 500000) {
                           $profile_wealth = $wealth_array[5];
                       }
                       if ($row['money'] >= 1000000) {
                           $profile_wealth = $wealth_array[6];
                       }
                       if ($row['money'] >= 10000000) {
                           $profile_wealth = $wealth_array[7];
                       }
                       if ($row['money'] >= 1000000000) {
                           $profile_wealth = $wealth_array[8];
                       }
                       if ($row['money'] >= 10000000000) {
                           $profile_wealth = $wealth_array[9];
                       }
                       echo $profile_wealth;?>
                   </td>
                   <td width="250" align="left" class="cell"><?php
                       if (empty($row['gang'])) {
                           echo "No Gang.";
                       } else {
                           echo "<a href=\"view_gang.php?name=" . $row['gang'] . "\" onFocus=\"if(this.blur)this.blur()\" >" . $row['gang'] . "</a>";
                       }?></td>
               </tr>
           <?php } // while ?>
       </table>


       </p>
   </form>
<?php require("bottom.php"); ?>

try now

Link to comment
Share on other sites

  • 9 years later...
1 hour ago, KyleMassacre said:

I'm pretty sure its V1. Jamie used to work on that engine a lot back in the day and the "top.php" gives it away for me.

tbh it could be the early version, as the v1 i used to play with was lot similar to gl v2 is the structure of the modules

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...