katalin Posted September 15, 2010 Share Posted September 15, 2010 Can anyone tell me how can I add success rate for each crime? Is there a variable or how can I create one if there isn't any? Quote Link to comment Share on other sites More sharing options...
Equinox Posted September 15, 2010 Share Posted September 15, 2010 There should be one when you create a crime via the staff panel? Quote Link to comment Share on other sites More sharing options...
katalin Posted September 15, 2010 Author Share Posted September 15, 2010 There should be one when you create a crime via the staff panel?When you create the crime you have the formula, but I need to add that formula in the criminal.php file so players see their success rate when committing a crime. Can anyone help me with this? Quote Link to comment Share on other sites More sharing options...
Dominion Posted September 15, 2010 Share Posted September 15, 2010 not looked at crimes in a long time but i think the success formula is in docrime.php if thats what you are after? Quote Link to comment Share on other sites More sharing options...
katalin Posted September 15, 2010 Author Share Posted September 15, 2010 Ya, but how do I show it in criminal.php? Quote Link to comment Share on other sites More sharing options...
Dominion Posted September 15, 2010 Share Posted September 15, 2010 i must be missing what you are asking here, do you want something that says "your have % chance of doing this crime" <?php ///do NOT use this it is a bad example $formula = 100 * 2 / 5; //change to your crime formula... echo "you have $formula% chance of doing this crime"; ?> and if your formula is in criminal.php pass it on to docrime or just have it in 2 files (as long as there the same) edit - you could always post your page and explain a little more? Quote Link to comment Share on other sites More sharing options...
katalin Posted September 20, 2010 Author Share Posted September 20, 2010 Yes, but crimes have different formulas, I want the exact success formula for each crime. Can anyone help me on this? Quote Link to comment Share on other sites More sharing options...
Dominion Posted September 20, 2010 Share Posted September 20, 2010 in criminal.php the formula is already under $v (as its taking the whole table) e.g. $v['crimePERCFORM'] so if you want to show it all you have to do it add to the table in the foreach loop, however i am not sure why you would want the formula to show O_o Quote Link to comment Share on other sites More sharing options...
katalin Posted September 21, 2010 Author Share Posted September 21, 2010 I don't want to show the formula, I want to show the success rate for each crime. Quote Link to comment Share on other sites More sharing options...
katalin Posted September 22, 2010 Author Share Posted September 22, 2010 Anyone? Quote Link to comment Share on other sites More sharing options...
Curt Posted October 19, 2010 Share Posted October 19, 2010 hello, The success rate is determined by your will if you are using the default crime success rate. I had something the same as this but removed it from my game...your welcome to change it to your likings; $crimeforumula = (($ir['will']*0.8)/2.5)+($ir['level']/4); if ($crimeforumula < 10) { $chancerank = "<span style='color:red'> VERY SLIM CHANCE </span>"; } else if ($crimeforumula >= 10 AND $crimeforumula <= 25) {$chancerank = "<span style='color:red'> SLIM CHANCE </span>"; } else if ($crimeforumula >= 25 AND $crimeforumula <= 50) {$chancerank = "<span style='color:green'>GOOD CHANCE</span>"; } else if ($crimeforumula >= 50 AND $crimeforumula <= 75) {$chancerank = "<span style='color:green'>VERY GOOD CHANCE</span>"; } else if ($crimeforumula >= 75 AND $crimeforumula <= 95) {$chancerank = "<span style='color:green'>GREAT CHANCE</span>"; } else if ($crimeforumula > 95) { $chancerank = "<span style='color:orange'> EASY JOB </span>"; } Then add a field in your crime table and add this variable to it : $chancerank Hope that helps you some :) Cheers 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.