GregFest Posted December 21, 2011 Share Posted December 21, 2011 If there a way of having the formula using strength, agility, labor and iq instead of lvls and wills Quote Link to comment Share on other sites More sharing options...
GregFest Posted December 23, 2011 Author Share Posted December 23, 2011 (edited) I feel this should work but it dont can anyone help <?php /* Engine: MC V2.5 (Redux) File: docrime.php Author: mccodes.com */ if ( !defined($_CONFIG['define_code']) ) { echo 'This file cannot be accessed directly.'; exit; } if ( $ir['jail'] or $ir['hospital'] ) { echo 'This page cannot be accessed while in jail or hospital.'; die($h->endpage()); } $_GET['c'] = ( isset($_GET['c'])&&is_numeric($_GET['c']) )?abs(intval($_GET['c'])):''; if ( empty($_GET['c']) ) { echo "Invalid crime"; } else { $q = $db->query('SELECT * FROM `crimes` WHERE `crimeID` = '.$_GET['c']); if ( $db->num_rows($q) == 0 ) { echo 'Invalid Crime'; die($h->endpage()); } $r = $db->fetch_row($q); if($ir['brave'] < $r['crimeBRAVE']) { echo "You do not have enough Brave to perform this crime."; } else { $ec="\$sucrate=".str_replace(array("LEVEL","CRIMEXP","EXP","WILL","STRENGTH","AGILITY","LABOUR","GUARD","IQ"), array($ir['level'], $ir['crimexp'], $ir['exp'], $ir['will'], $ir['Strength'], $ir['Agility'], $ir['Labour'], $ir['Guard'], $ir['IQ']),$r['crimePERCFORM']).";"; eval($ec); echo $r['crimeITEXT']; $ir['brave'] -= $r['crimeBRAVE']; $db->query("UPDATE users SET brave={$ir['brave']} WHERE userid=$userid",$c); if ( rand(1,100) <= $sucrate ) { echo str_replace("{main}",$r['crimeSUCCESSMUNY'],$r['crimeSTEXT']); $ir['main']+=$r['crimeSUCCESSMUNY']; $ir['second']+=$r['crimeSUCCESSCRYS']; $ir['exp']+=(int) ($r['crimeSUCCESSMUNY']/8); $db->query("UPDATE `users` SET `main` = {$ir['main']}, `second` = {$ir['second']}, `exp` = {$ir['exp']},`crimexp` = `crimexp` + {$r['crimeXP']} WHERE `userid` = $userid",$c); if($r['crimeSUCCESSITEM']) { item_add($userid, $r['crimeSUCCESSITEM'], 1); } } else { if ( rand(1, 3) == 1 ) { echo $r['crimeFTEXT']; } else { if ( rand(1, 3) == 2 ) { echo $r['crimeJTEXT']; $db->query("UPDATE `users` SET `jail` = '$r[crimeJAILTIME]', `jail_reason` = '$r[crimeJREASON]' WHERE `userid` = '$userid'"); } else { echo $r['crimeHTEXT']; $db->query("UPDATE `users` SET `hospital` = '$r[crimeHOSPTIME]', `hospreason` = '$r[crimeHREASON]' WHERE `userid` = '$userid'"); } } } echo "<br /><a href='".gen_url('docrime',true)."&c={$_GET['c']}'>Try Again</a><br /><a href='".gen_url('criminal',true)."'>Crimes</a>"; } } ?> Edited December 23, 2011 by Dominion added tags Quote Link to comment Share on other sites More sharing options...
Ishraq Posted December 23, 2011 Share Posted December 23, 2011 I feel this should work but it dont can anyone help <?php /* Engine: MC V2.5 (Redux) File: docrime.php Author: mccodes.com */ if ( !defined($_CONFIG['define_code']) ) { echo 'This file cannot be accessed directly.'; exit; } if ( $ir['jail'] or $ir['hospital'] ) { echo 'This page cannot be accessed while in jail or hospital.'; die($h->endpage()); } $_GET['c'] = ( isset($_GET['c'])&&is_numeric($_GET['c']) )?abs(intval($_GET['c'])):''; if ( empty($_GET['c']) ) { echo "Invalid crime"; } else { $q = $db->query('SELECT * FROM `crimes` WHERE `crimeID` = '.$_GET['c']); if ( $db->num_rows($q) == 0 ) { echo 'Invalid Crime'; die($h->endpage()); } $r = $db->fetch_row($q); if($ir['brave'] < $r['crimeBRAVE']) { echo "You do not have enough Brave to perform this crime."; } else { $ec="\$sucrate=".str_replace(array("LEVEL","CRIMEXP","EXP","WILL","STRENGTH","AGILITY","LABOUR","GUARD","IQ"), array($ir['level'], $ir['crimexp'], $ir['exp'], $ir['will'], $ir['Strength'], $ir['Agility'], $ir['Labour'], $ir['Guard'], $ir['IQ']),$r['crimePERCFORM']).";"; eval($ec); echo $r['crimeITEXT']; $ir['brave'] -= $r['crimeBRAVE']; $db->query("UPDATE users SET brave={$ir['brave']} WHERE userid=$userid",$c); if ( rand(1,100) <= $sucrate ) { echo str_replace("{main}",$r['crimeSUCCESSMUNY'],$r['crimeSTEXT']); $ir['main']+=$r['crimeSUCCESSMUNY']; $ir['second']+=$r['crimeSUCCESSCRYS']; $ir['exp']+=(int) ($r['crimeSUCCESSMUNY']/8); $db->query("UPDATE `users` SET `main` = {$ir['main']}, `second` = {$ir['second']}, `exp` = {$ir['exp']},`crimexp` = `crimexp` + {$r['crimeXP']} WHERE `userid` = $userid",$c); if($r['crimeSUCCESSITEM']) { item_add($userid, $r['crimeSUCCESSITEM'], 1); } } else { if ( rand(1, 3) == 1 ) { echo $r['crimeFTEXT']; } else { if ( rand(1, 3) == 2 ) { echo $r['crimeJTEXT']; $db->query("UPDATE `users` SET `jail` = '$r[crimeJAILTIME]', `jail_reason` = '$r[crimeJREASON]' WHERE `userid` = '$userid'"); } else { echo $r['crimeHTEXT']; $db->query("UPDATE `users` SET `hospital` = '$r[crimeHOSPTIME]', `hospreason` = '$r[crimeHREASON]' WHERE `userid` = '$userid'"); } } } echo "<br /><a href='".gen_url('docrime',true)."&c={$_GET['c']}'>Try Again</a><br /><a href='".gen_url('criminal',true)."'>Crimes</a>"; } } ?> It won't work like that. your stats shouldn't be $ir['Strength. etc 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.