Jump to content
MakeWebGames

Recommended Posts

Posted

Ok this formual thing really gets confusing, so i want to make it simple when making a crime instead creating some long formula, then playing around with it i want it like a percentage format, out of 100 you enter the percentage of success for that crime.

instead of this ((WILL*0.8)/2.5)+(LEVEL/4) i want it in simple form like in figures (10%, 20%,30%) etc..

the edit would be needed in the docrime.php in this section but i dont know what to do can someone help?

$ec="\$sucrate=".str_replace(array("LEVEL","CRIMEXP","EXP","WILL","IQ"), array($ir['level'], $ir['crimexp'], $ir['exp'], $ir['will'], $ir['IQ']),$r['crimePERCFORM']).";";
eval($ec);
$ir['brave']-=$r['crimeBRAVE'];
mysql_query("UPDATE users SET brave={$ir['brave']} WHERE userid=$userid",$c);
 $db->query("UPDATE users SET crimes=crimes+1 WHERE userid={$ir['userid']}");
if(rand(1,100) <= $sucrate)
{
echo"
                  <font style=color:white;>{$r['crimeSTEXT']}</font>"; echo'
                  <font style=color:white;><b><u>Cash gained: </u></b></font><font style=color:limegreen;>$'.number_format($r['crimeSUCCESSMUNY']).'</font>';
                  echo"
                  <br />
                  <center>
                  <img src='images/crime/success.png' alt='SUCCESS'>
                  <br />
                  <a href='docrime.php?c={$_GET['c']}'><input type=submit value=Redo></a> 
                  <a href='crime.php'><input type=submit value=Back></a>
                  </center>";


$ir['money']+=$r['crimeSUCCESSMUNY'];
$ir['crystals']+=$r['crimeSUCCESSCRYS'];
$ir['exp']+=(int) ($r['crimeSUCCESSMUNY']/8);
mysql_query("UPDATE users SET money={$ir['money']}, crystals={$ir['crystals']}, exp={$ir['exp']},crimexp=crimexp+{$r['crimeXP']} WHERE userid=$userid",$c);
$db->query("UPDATE users SET crimespassed=crimespassed+1 WHERE userid={$ir['userid']}");


if($r['crimeSUCCESSITEM'])
{
 item_add($userid, $r['crimeSUCCESSITEM'], 1);
}


}

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