Dazza Posted November 17, 2008 Posted November 17, 2008 Hello, Could someone please explain how to work out the crime formula and/or copy me a list of their crime/formulas? I have this in a help file: Example 1a. ((WILL*0.7)/17) User's will: 100 You start by running the functions in the parentheses. So it would end up being: ((70)/17) After that you just run the formula 70/17 Which Equals: 4.1176470588235294117647058823529 So using that formula on a user with 100 will would give them a 4.1176470588235294117647058823529% chance of the user succeeding. Confusing me as math isnt my strong point! Quote
The Ace Posted November 17, 2008 Posted November 17, 2008 Re: Mccodes V2 crime formula help There are some good topics on CE that explain this, but I'll explain here anyway. ;) OK, here is one formula: ((WILL*3.5)/3)+(LEVEL/3) Now, this formula produces a HIGH chance of success. At will 100 and level 1, this comes out with: 117. This is a 117% chance of succeeding. Now, to make it harder, decrease the number the will is multiplied (3.5), increase the division number (3,3). A low success formula would be: ((WILL*1.2)/10)+(LEVEL/8) This produces 12.125% chance of succeeding. (Level and will the same as before). To make the crime easier, apply the same change, but vice versa. Therefore the multiplication is increase and division numbers decreased. Easy crime: ((WILL*15)/2)+(LEVEL/2) This produces a 750.5% chance of success. Hope this helps ya. :) Mail me if you need any further help. :D Quote
Alpha Posted April 29, 2009 Posted April 29, 2009 Re: Mccodes V2 crime formula help can some one make a crime formula calculator or explain how to calculate it on a regular calculator Quote
AlabamaHit Posted April 29, 2009 Posted April 29, 2009 Re: Mccodes V2 crime formula help you can use a calculator on this................................................................. Quote
Strats Posted April 30, 2009 Posted April 30, 2009 Re: Mccodes V2 crime formula help Lol Glad this topic popped up I had some problems understanding it too Quote
TMan Posted May 1, 2009 Posted May 1, 2009 Re: Mccodes V2 crime formula help In docrime.php you have an array that tells you which attributes you can use for crimes.(you can edit these to the userstats... that you want to be used for crimes) lines 18-21 else { $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); This says you can use LEVEL CRIMEXP EXP WILL and IQ for crimes. If you want to add strength agility and guard just add them lol. Example:(including STR, AGI, GRD) (array("LEVEL","CRIMEXP","EXP","WILL","IQ","STR","AGI","GRD"), array($ir['level'], $ir['crimexp'], $ir['exp'], $ir['will'], $ir['IQ'], $ir['strength'], $ir['agility'], $ir['guard']),$r['crimePERCFORM']) Quote
das Posted May 24, 2009 Posted May 24, 2009 Re: Mccodes V2 crime formula help Thanks a lot, it'll really help me, +1 :-D Quote
gideon prewett Posted May 29, 2009 Posted May 29, 2009 Re: Mccodes V2 crime formula help i get this error Parse error: syntax error, unexpected T_STRING in /home/benan/public_html/docrime.php(22) : eval()'d code on line 1 this is my docrime.php after the edit <?php $macropage="docrime.php?c={$_GET['c']}"; include "globals.php"; if($ir['jail'] or $ir['hospital']) { die("This page cannot be accessed while in jail or hospital."); } $_GET['c']=abs((int) $_GET['c']); if(!$_GET['c']) { print "Invalid crime"; } else { $q=$db->query("SELECT * FROM crimes WHERE crimeID={$_GET['c']}",$c); $r=$db->fetch_row($q); if($ir['brave'] < $r['crimeBRAVE']) { print "You do not have enough Brave to perform this crime."; } else { $ec="\$sucrate=".str_replace(array("LEVEL","CRIMEXP","EXP","WILL","IQ","STR","AGI","GRD"), array($ir['level'], $ir['crimexp'], $ir['exp'], $ir['will'], $ir['IQ'], $ir['strength'], $ir['agility'], $ir['guard']),$r['crimePERCFORM']) .";"; eval($ec); print $r['crimeITEXT']; $ir['brave']-=$r['crimeBRAVE']; $db->query("UPDATE users SET brave={$ir['brave']} WHERE userid=$userid",$c); if(rand(1,100) <= $sucrate) { print str_replace("{money}",$r['crimeSUCCESSMUNY'],$r['crimeSTEXT']); $ir['money']+=$r['crimeSUCCESSMUNY']; $ir['crystals']+=$r['crimeSUCCESSCRYS']; $ir['exp']+=(int) ($r['crimeSUCCESSMUNY']/8); $db->query("UPDATE users SET money={$ir['money']}, crystals={$ir['crystals']}, exp=exp+{$r['crimeXP']},crimexp=crimexp+{$r['crimeXP']} WHERE userid=$userid",$c); $db->query("UPDATE users SET crimesdone=crimesdone+1 WHERE userid=$userid",$c); if($r['crimeSUCCESSITEM']) { item_add($userid, $r['crimeSUCCESSITEM'], 1); } } else { if(rand(1, 2) == 1) { print $r['crimeFTEXT']; } else { print $r['crimeJTEXT']; $db->query("UPDATE `users` SET `jail` = '$r[crimeJAILTIME]', `jail_reason` = '$r[crimeJREASON]' WHERE `userid` = '$userid'"); } } print " [url='docrime.php?c={$_GET[']Try Again[/url] [url='criminal.php']Crimes[/url]"; } } $h->endpage(); ?> any ideas why im getting this error? Quote
Lithium Posted May 29, 2009 Posted May 29, 2009 Re: Mccodes V2 crime formula help yup your str_replace() statement is one string shorter than it should be array("LEVEL","CRIMEXP","EXP","WILL","IQ","STR","AGI","GRD") -8 array($ir['level'], $ir['crimexp'], $ir['exp'], $ir['will'], $ir['IQ'], $ir['strength'], $ir['agility'], $ir['guard']),$r['crimePERCFORM']) - 9 Quote
girardz Posted May 29, 2009 Posted May 29, 2009 Re: Mccodes V2 crime formula help Having trouble with my crimes, no one can do them I adjusted my lvl to 200 with the max will in my game = 220000 I set the lowest crime formula to: ((WILL*50)/2)+(LEVEL/1) = about a 5,500,200 % success rate (I started with ((WILL*0.8)/1)+(LEVEL/1) and adjusted to make it easier) Results: Failed Is there anything else that would change the outcome ? My crimes.php <?php include "globals.php"; print "<center><font face='Arial' size='4'>Criminal Centre</font><hr width='80%'>"; if($ir['jail'] or $ir['hospital']) { die("You cannot access this page while in Hospital or Jail."); } $_POST['ID'] = abs((int) $_POST['ID']); if(!$_POST['ID']) { $sql = sprintf("SELECT * FROM crimegroups ORDER BY cgID ASC"); $q = $db->query($sql); print "<form action='crimes.php' method='post'> <table width='40%' cellspacing='1'> <tr bgcolor='gray'> <th width='90%'>Crime</th> <th width='10%'>Do</th></tr>"; while($r = $db->fetch_row($q)) { print "<tr><td>{$r['cgNAME']}</td><td align='center'><input type='radio' name='ID' value='{$r['cgID']}' /></td></tr>"; } print "<tr bgcolor='gray'> <td colspan='2' align='center'><input type='submit' value='Next Step'></td> </tr></table></form><hr width='80%'>> [url='index.php']Back[/url]<hr width=80%>"; } else { $sql = sprintf("SELECT * FROM crimes WHERE (crimeGROUP = %u)", $_POST['ID']); $q = $db->query($sql); if (!$db->num_rows($q)) { print "This crime group does not exist."; } else { print "<form action='docrime.php' method='get'> <table width='80%' cellspacing='1'> <tr bgcolor='gray'> <th>Crime</th> <th>Brave Cost</th> <th>Do</th></tr>"; while($r=$db->fetch_row($q)) { print "<tr><td>{$r['crimeNAME']}</td><td><font color='red'>-{$r['crimeBRAVE']} Brave</font></td><td align='center'><input type='radio' name='c' value='{$r['crimeID']}' /></td></tr>"; } print "<tr bgcolor='gray'> <td colspan='3' align='center'><input type='submit' value='Do Crime'></td> </tr></table></form><hr width='80%'>> [url='crimes.php']Back[/url]<hr width=80%>"; } } $h->endpage(); ?> and my docrime.php <?php $macropage="docrime.php?c={$_GET['c']}"; include "globals.php"; if($ir['jail'] or $ir['hospital']) { die("This page cannot be accessed while in jail or hospital."); } $_GET['c']=abs((int) $_GET['c']); if(!$_GET['c']) { print "Invalid crime"; } else { $q=mysql_query("SELECT * FROM crimes WHERE crimeID={$_GET['c']}",$c); $r=mysql_fetch_array($q); if($ir['brave'] < $r['crimeBRAVE']) { print "You do not have enough Brave to perform this crime."; } else { $ec="\$sucrate=".str_replace(array("LEVEL","CRIMEXP","EXP","WILL","IQ"), array($ir['level'], $ir['crimexp'], $ir['exp'], $ir['will'], $ir['IQ']),$r['crimePERCFORM']).";"; print $r['crimeITEXT']; $ir['brave']-=$r['crimeBRAVE']; mysql_query("UPDATE users SET brave={$ir['brave']} WHERE userid=$userid",$c); if(rand(1,100) <= $sucrate) { print str_replace("{money}",$r['crimeSUCCESSMUNY'],$r['crimeSTEXT']); $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); if($r['crimeSUCCESSITEM']) { item_add($userid, $r['crimeSUCCESSITEM'], 1); } } else { if(rand(1, 2) == 1) { print $r['crimeFTEXT']; } else { print $r['crimeJTEXT']; $db->query("UPDATE `users` SET `jail` = '$r[crimeJAILTIME]', `jail_reason` = '$r[crimeJREASON]' WHERE `userid` = '$userid'"); } } print " [url='docrime.php?c={$_GET[']Try Again[/url] [url='criminal.php']Crimes[/url]"; } } $h->endpage(); ?> Quote
gideon prewett Posted May 29, 2009 Posted May 29, 2009 Re: Mccodes V2 crime formula help thanks Lithium :-D can someone plz add it in to my docrime.php and repost it im not on my pc and i have a really bad connection and it keeps kicking me i tryed for ages to get conected to my cpanel and when i added it in i got a error Quote
Lithium Posted May 29, 2009 Posted May 29, 2009 Re: Mccodes V2 crime formula help @ gideon, i haven't fixed it, just pointed you out where the error is ;) Quote
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.