HUSTLE HARD Posted October 27, 2012 Share Posted October 27, 2012 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); } } Quote Link to comment Share on other sites More sharing options...
HUSTLE HARD Posted October 28, 2012 Author Share Posted October 28, 2012 Anyone will to help me? Quote Link to comment Share on other sites More sharing options...
sniko Posted October 28, 2012 Share Posted October 28, 2012 Anyone will to help me? Have you tried just putting in the figures? Perhaps without the percent sign. Quote Link to comment Share on other sites More sharing options...
Dayo Posted October 28, 2012 Share Posted October 28, 2012 Yea just put 10, 20, 30 etc Quote Link to comment Share on other sites More sharing options...
HUSTLE HARD Posted October 28, 2012 Author Share Posted October 28, 2012 ok i figured out the formula...dont worry thanks anyways Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.