...

View Full Version : rank error



cheat
03-14-2007, 05:33 PM
hey ive got a game but the ranks arent working. heres the scripts.

<?php session_start(); include_once"includes/db_connect.php"; include_once"includes/functions.php"; logincheck();
$username=$_SESSION['username'];
$query=mysql_query("SELECT * FROM users WHERE username='$username'");
$fetch=mysql_fetch_object($query);
echo mysql_error();

$query1=mysql_query("SELECT * FROM user_info WHERE username='$username'");
$info=mysql_fetch_object($query1);
echo mysql_error();




$currank=$fetch->rank;
$rankp = $fetch->rankpoints;

if ($currank == "Scum"){
$max = "500";
$old="0";
}elseif ($currank == "Package Boy"){
$max = '1000';
$old="500";
}elseif ($currank == "Pee Wee"){
$max = '1500';
$old="1000";
}elseif ($currank == "Thug"){
$max = '2000';
$old="1500";
}elseif ($currank == "Crook"){
$max = '2500';
$old="1500";
}elseif ($currank == "Thief"){
$max = '3000';
$old="2000";
}elseif ($currank == "Local Boss"){
$max = '3500';
$old="2500";
}elseif ($currank == "Boss"){
$max = '4000';
$old="3000";
}elseif ($currank == "Respectable Boss"){
$max = '4500';
$old="3500";
}elseif ($currank == "Don"){
$max = '5000';
$old="4000";

}elseif ($currank == "Respected Don"){
$max = '4500';
$old="4500";
}elseif ($currank == "Legendary Don"){
$max = '6000';
$old="4500";

}elseif ($currank == "Godfather"){
$max = '6500';
$old="5000";
}elseif ($currank == "Godmother"){
$max = '8000';
$old="5500";
}
$percent = round((($rankp-$old)/($max-$old))*100);
echo mysql_error();
?>









<?php echo "$style"; ?>
<center><b>Your Status</center></b>
<br>
<td height="34" valign="top"> <table width="70%" align="center" border="1" cellpadding="2" cellspacing="0" class=thinline bordercolor="black">
<tr>
<td background="includes/grad.jpg">
<center>Your Current Rank:</center></td>
</tr>
<tr>
<td>
<center> <?php echo "$fetch->rank"; ?></center>
</td>
</tr>
</table>

<br>
<br>



<table width="100%" border="1" cellpadding="2" cellspacing="0" bordercolor="#000000" bgcolor="#666666">
<tr>
<td>
<p align="center" background="includes/grad.jpg"><strong>Rank Bar:</strong></p>
</td>
</tr>
<tr>
<td height="76">
<table width="<? echo $percent; ?>%" height="70" border="1" cellpadding="0" cellspacing="0" bordercolor="black" bgcolor="green">
<tr>
<td width="<? echo $percent; ?>%" height="53">&nbsp;<font color="black" size="5"><strong><? echo "$percent";print "%"; ?>
</strong></font> </td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>


$percent = round((($rankp-$old)/($max-$old))*100);

that is the error.
it appears to be doing it only with admins and mods. as they only have the rank "mod" and "administrator"

Fumigator
03-14-2007, 05:55 PM
ok....

<ponder>

So what's your question?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum