Jump to content
MakeWebGames

Recommended Posts

Posted

How can i change it so hall of fame for money isn't based JUST on the money "ON HAND"

I would like it to add up money on hand and money in the bank...

Here is the code in halloffame.php (Version 1)

function hof_money()

{

global $ir,$c,$userid;

print "Showing the 20 users with the highest amount of money

<table width=75%><tr style='background:gray'> <th>Pos</th> <th>User</th> <th>Money</th> </tr>";

$q=mysql_query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 ORDER BY money DESC,userid ASC LIMIT 20", $c);

$p=0;

while($r=mysql_fetch_array($q))

{

$p++;

if($r['userid'] == $userid) { $t="";$et=""; } else { $t="";$et=""; }

print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> <td>$t\$".money_formatter($r['money'],'')."$et</td> </tr>";

}

print "</table>";

}

Posted

Re: Hall Of Fame Money Help (v1)

 

function hof_money()
{
global $ir,$c,$userid;
print "Showing the 20 users with the highest amount of money

<table width=75%><tr style='background:gray'> <th>Pos</th> <th>User</th> <th>Money</th> </tr>";
$q=mysql_query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 ORDER BY money+bankmoney DESC,userid ASC LIMIT 20", $c);
$p=0;
while($r=mysql_fetch_array($q))
{
$moneytotal=$r['money']+$r['bankmoney'];
$p++;
if($r['userid'] == $userid) { $t="[b]";$et="[/b]"; } else { $t="";$et=""; }
print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> <td>$t\$".money_formatter($moneytotal,'')."$et</td> </tr>";
}
print "</table>";
}

 

Try that

Posted

Re: Hall Of Fame Money Help (v1)

So i thought i would add the cyber bank and it won't up my rank in the HOF for money...

 

function hof_money()

{

global $ir,$c,$userid;

print "Showing the 20 users with the highest amount of money

<table width=75%><tr style='background:gray'> <th>Pos</th> <th>User</th> <th>Money</th> </tr>";

$q=mysql_query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 ORDER BY money+bankmoney DESC,userid ASC LIMIT 20", $c);

$p=0;

while($r=mysql_fetch_array($q))

{

$moneytotal=$r['money']+$r['bankmoney']+$r['cybermoney'];

$p++;

It says I have money (9 million) should be ranked 3rd but it still shows me in 6th, Any ideas why?

Posted

Re: Hall Of Fame Money Help (v1)

 

$q=mysql_query("SELECT * FROM users WHERE u.user_level != 0 ORDER BY money+bankmoney+cybermoney DESC,userid ASC LIMIT 20", $c);

 

*Removed the select from gang table as its not needed from what I can tell. No need to query info that isn't being used.

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...