Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: rank error

  1. #1
    New Coder cheat's Avatar
    Join Date
    Nov 2006
    Location
    England, Britain
    Posts
    74
    Thanks
    0
    Thanked 0 Times in 0 Posts

    rank error

    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"

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    ok....

    <ponder>

    So what's your question?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •