Jump to content
MakeWebGames

Recommended Posts

Posted
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?

Posted

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?

Posted

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

  • 4 weeks later...
Posted

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

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