Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Rank Up System | Help! :D
Old 06-12-2007, 04:06 PM Rank Up System | Help! :D
Skilled Talker

Posts: 78
Name: Ash Kwil
Trades: 0
Ok this is for a little game i want to make for a few friends.

I want this "CRIME" script to commit a crime in the game. this should gain the player exp points. depending on their rank is how exp points are turned into % (complesion of their rank). This is how the % is worked out.

PHP Code:
if ($stat["level"] == "Tramp") {
$percent=$stat[exp]/10;
}
if (
$stat["level"] == "Chav") {
$percent=$stat[exp]/20;
}
if (
$stat["level"] == "Dealer") {
$percent=$stat[exp]/50;
}
if (
$stat["level"] == "Convict") {
$percent=$stat[exp]/60;
}
if (
$stat["level"] == "Rookie") {
$percent=$stat[exp]/80;
}
if (
$stat["level"] == "Thug") {
$percent=$stat[exp]/110;
}
if (
$stat["level"] == "Gangsta") {
$percent=$stat[exp]/150;
}
if (
$stat["level"] == "Bodyguard") {
$percent=$stat[exp]/180;
}
if (
$stat["level"] == "Agent") {
$percent=$stat[exp]/200;
}
if (
$stat["level"] == "Associate") {
$percent=$stat[exp]/230;
}
if (
$stat["level"] == "Capo") {
$percent=$stat[exp]/270;
}
if (
$stat["level"] == "Underboss") {
$percent=$stat[exp]/280;
}
if (
$stat["level"] == "Global Threat") {
$percent=$stat[exp]/310;
}
if (
$stat["level"] == "Untouchable") {
$percent=$stat[exp]/350;
}
if (
$stat["level"] == "Legendary Assassin") {
$percent=$stat[exp]/390;
}
if (
$stat["level"] == "National Legend") {
$percent=$stat[exp]/420;
}
if (
$stat["level"] == "Worldwide SL Legend") {
$percent=$stat[exp]/450;

This is the scipt i am having prolems with.

My rank is "Chav" i want to rank up to the next rank. by doigna crime i should gain exp therefore gain % but i dont. It is just ranking me to the top rank.

Any idea why?

This is the Script.

PHP Code:
<?php include "header.php"?>
 
<center>
    <table  border="0" cellpadding="0" cellspacing="0" align="center">
      <tr>
        <td colspan="5"><div align="center" class="gradient"><strong>Commit a Crime </strong>
          </div>
        <div align="left"></div></td>
      </tr>
      <tr bordercolor="#000000" bgcolor="#000000">
        <td width="101" height="153" valign="top" cellpadding="2"><div align="left">
            <p align="center">
              <img src="Images/sellweapons.jpg" width="100" height="100" hspace="0" vspace="0" align="top">
              <a href="crime.php?view=crime4">Burgle a Mansion</a>
            </p>
        </div></td>
        <td width="100" valign="top" cellpadding="2"><div align="center">
          <p><img src="Images/robbank.jpg" width="100" height="100" hspace="0" vspace="0" align="top">
 <a href="crime.php?view=crime3">Burgle a House</a>
          </p>
        </div></td>
        <td width="100" valign="top" cellpadding="2"><div align="center">
          <p><img src="Images/hijack.jpg" width="100" height="100" hspace="0" vspace="0" align="top">
            <a href="crime.php?view=crime2">Burgle a Bungalow</a></p>
</div></td>
        <td width="100" height="153" valign="top" cellpadding="2"><div align="center">
          <p><img src="Images/streetfight.jpg" width="100" height="100" hspace="0" vspace="0" align="top">
            <a href="crime.php?view=crime1">Burgle a Flat</a></p>
        </div></td>
      </tr>
    </table>
</center>
 
<?php
if ($_GET["view"] == "crime1") {
  
$chance1 rand(1,2);
  if (
$chance1 == 1) {
    
$mgainrand(1,1500);
$mmgain=$mgain+$stat[money];
$xpgain rand(1,20);
$expgain $xpgain+$stat[exp];
    print 
"You sucessfully burgled a house! You got away with $<B>".$mgain."</B>!";
    
mysql_query("update `players` set `money`='".$mmgain."' where `id`=".$stat[id]." ");
    
mysql_query("update `players` set `exp`='".$expgain."' where `id`=".$stat[id]." ");
 
 
if (
$percent 99.9 || $stat[level] = "Tramp") {
mysql_query(" update `players` set `level`='Chav' where `id`='$stat[id]' ");
mysql_query(" update `players` set `exp`='0' where `id`='$stat[id]' ");
}
if (
$percent 99.9 || $stat[level] = "Chav") {
mysql_query(" update `players` set `level`='Dealer' where `id`='$stat[id]' ");
mysql_query(" update `players` set `exp`='0' where `id`='$stat[id]' ");
}
if (
$percent 99.9 || $stat[level] = "Dealer") {
mysql_query(" update `players` set `level`='Convict' where `id`='$stat[id]' ");
mysql_query(" update `players` set `exp`='0' where `id`='$stat[id]' ");
}
if (
$percent 99.9 || $stat[level] = "Convict") {
mysql_query(" update `players` set `level`='Rookie' where `id`='$stat[id]' ");
mysql_query(" update `players` set `exp`='0' where `id`='$stat[id]' ");
}
if (
$percent 99.9 || $stat[level] = "Rookie") {
mysql_query(" update `players` set `level`='Thug' where `id`='$stat[id]' ");
mysql_query(" update `players` set `exp`='0' where `id`='$stat[id]' ");
}
if (
$percent 99.9 || $stat[level] = "Thug") {
mysql_query(" update `players` set `level`='Gangster' where `id`='$stat[id]' ");
mysql_query(" update `players` set `exp`='0' where `id`='$stat[id]' ");
}
if (
$percent 99.9 || $stat[level] = "Gangster") {
mysql_query(" update `players` set `level`='Bodyguard' where `id`='$stat[id]' ");
mysql_query(" update `players` set `exp`='0' where `id`='$stat[id]' ");
}
if (
$percent 99.9 || $stat[level] = "Bodyguard") {
mysql_query(" update `players` set `level`='Agent' where `id`='$stat[id]' ");
mysql_query(" update `players` set `exp`='0' where `id`='$stat[id]' ");
}
if (
$percent 99.9 || $stat[level] = "Agent") {
mysql_query(" update `players` set `level`='Associate' where `id`='$stat[id]' ");
mysql_query(" update `players` set `exp`='0' where `id`='$stat[id]' ");
}
if (
$percent 99.9 || $stat[level] = "Associate") {
mysql_query(" update `players` set `level`='Capo' where `id`='$stat[id]' ");
mysql_query(" update `players` set `exp`='0' where `id`='$stat[id]' ");
}
if (
$percent 99.9 || $stat[level] = "Capo") {
mysql_query(" update `players` set `level`='Underboss' where `id`='$stat[id]' ");
mysql_query(" update `players` set `exp`='0' where `id`='$stat[id]' ");
}
if (
$percent 99.9 || $stat[level] = "Global Threat") {
mysql_query(" update `players` set `level`='Untouchable' where `id`='$stat[id]' ");
mysql_query(" update `players` set `exp`='0' where `id`='$stat[id]' ");
}
if (
$percent 99.9 || $stat[level] = "Untouchable") {
mysql_query(" update `players` set `level`='Legendary Assassin' where `id`='$stat[id]' ");
mysql_query(" update `players` set `exp`='0' where `id`='$stat[id]' ");
}
if (
$percent 99.9 || $stat[level] = "Legendary Assassin") {
mysql_query(" update `players` set `level`='National Legend' where `id`='$stat[id]' ");
mysql_query(" update `players` set `exp`='0' where `id`='$stat[id]' ");
}
if (
$percent 99.9 || $stat[level] = "National Legend") {
mysql_query(" update `players` set `level`='Worldwide SL legend' where `id`='$stat[id]' ");
mysql_query(" update `players` set `exp`='0' where `id`='$stat[id]' ");
}
 
  } else
    print 
"You failed and walked home empty handed!";
    
mysql_query("update `players` set `exp`='".$expgain."' where `id`=".$stat[id]." ");
 
 
if (
$percent 99.9 || $stat[level] = "Tramp") {
mysql_query(" update `players` set `level`='Chav' where `id`='$stat[id]' ");
mysql_query(" update `players` set `exp`='0' where `id`='$stat[id]' ");
}
if (
$percent 99.9 || $stat[level] = "Chav") {
mysql_query(" update `players` set `level`='Dealer' where `id`='$stat[id]' ");
mysql_query(" update `players` set `exp`='0' where `id`='$stat[id]' ");
}
if (
$percent 99.9 || $stat[level] = "Dealer") {
mysql_query(" update `players` set `level`='Convict' where `id`='$stat[id]' ");
mysql_query(" update `players` set `exp`='0' where `id`='$stat[id]' ");
}
if (
$percent 99.9 || $stat[level] = "Convict") {
mysql_query(" update `players` set `level`='Rookie' where `id`='$stat[id]' ");
mysql_query(" update `players` set `exp`='0' where `id`='$stat[id]' ");
}
if (
$percent 99.9 || $stat[level] = "Rookie") {
mysql_query(" update `players` set `level`='Thug' where `id`='$stat[id]' ");
mysql_query(" update `players` set `exp`='0' where `id`='$stat[id]' ");
}
if (
$percent 99.9 || $stat[level] = "Thug") {
mysql_query(" update `players` set `level`='Gangster' where `id`='$stat[id]' ");
mysql_query(" update `players` set `exp`='0' where `id`='$stat[id]' ");
}
if (
$percent 99.9 || $stat[level] = "Gangster") {
mysql_query(" update `players` set `level`='Bodyguard' where `id`='$stat[id]' ");
mysql_query(" update `players` set `exp`='0' where `id`='$stat[id]' ");
}
if (
$percent 99.9 || $stat[level] = "Bodyguard") {
mysql_query(" update `players` set `level`='Agent' where `id`='$stat[id]' ");
mysql_query(" update `players` set `exp`='0' where `id`='$stat[id]' ");
}
if (
$percent 99.9 || $stat[level] = "Agent") {
mysql_query(" update `players` set `level`='Associate' where `id`='$stat[id]' ");
mysql_query(" update `players` set `exp`='0' where `id`='$stat[id]' ");
}
if (
$percent 99.9 || $stat[level] = "Associate") {
mysql_query(" update `players` set `level`='Capo' where `id`='$stat[id]' ");
mysql_query(" update `players` set `exp`='0' where `id`='$stat[id]' ");
}
if (
$percent 99.9 || $stat[level] = "Capo") {
mysql_query(" update `players` set `level`='Underboss' where `id`='$stat[id]' ");
mysql_query(" update `players` set `exp`='0' where `id`='$stat[id]' ");
}
if (
$percent 99.9 || $stat[level] = "Global Threat") {
mysql_query(" update `players` set `level`='Untouchable' where `id`='$stat[id]' ");
mysql_query(" update `players` set `exp`='0' where `id`='$stat[id]' ");
}
if (
$percent 99.9 || $stat[level] = "Untouchable") {
mysql_query(" update `players` set `level`='Legendary Assassin' where `id`='$stat[id]' ");
mysql_query(" update `players` set `exp`='0' where `id`='$stat[id]' ");
}
if (
$percent 99.9 || $stat[level] = "Legendary Assassin") {
mysql_query(" update `players` set `level`='National Legend' where `id`='$stat[id]' ");
mysql_query(" update `players` set `exp`='0' where `id`='$stat[id]' ");
}
if (
$percent 99.9 || $stat[level] = "National Legend") {
mysql_query(" update `players` set `level`='Worldwide SL legend' where `id`='$stat[id]' ");
mysql_query(" update `players` set `exp`='0' where `id`='$stat[id]' ");
}
 

}
?>
<?php 
include "footer.php"?>

Please help as i am very confused!

LoL

Thanks in advance!

Ash~
Ashkwil is offline
Reply With Quote
View Public Profile Visit Ashkwil's homepage!
 
 
Register now for full access!
Old 06-12-2007, 04:35 PM Re: Rank Up System | Help! :D
Skilled Talker

Posts: 78
Name: Ash Kwil
Trades: 0
Bump
Ashkwil is offline
Reply With Quote
View Public Profile Visit Ashkwil's homepage!
 
Old 06-12-2007, 06:42 PM Re: Rank Up System | Help! :D
Novice Talker

Posts: 11
Trades: 0
its cause you have if experience > 99.9% OR level=chav

it should be and

change ¦¦ to &&
lewisphillips is offline
Reply With Quote
View Public Profile
 
Old 06-13-2007, 11:53 AM Re: Rank Up System | Help! :D
Skilled Talker

Posts: 78
Name: Ash Kwil
Trades: 0
Thanks! Works Now
Ashkwil is offline
Reply With Quote
View Public Profile Visit Ashkwil's homepage!
 
Old 06-13-2007, 01:52 PM Re: Rank Up System | Help! :D
Novice Talker

Posts: 11
Trades: 0
Another satisfied customer
lewisphillips is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Rank Up System | Help! :D
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.23889 seconds with 12 queries