Re: Free Jail feature Bribe The guard
Heres a fixed version and much better than the current one.
<?
session_start();
require "globals.php";
if($ir['jail']==0)
{
die("You arent in jail!");
}
//set $cost to what you want it to cost
$cost=rand(10000,50000);
//set $stat to the stat you want it to use..eg. brave, energy, will etc
If ($ir['money']<$cost )
{
die ("Your Dont have enough money to bribe the guard or enough brave to do it.");
}
if(rand(1,100) <= 20)
{
print "You successfully Bribed your way out of the Battle Creek City Jail.";
mysql_query("update users set money=money-$cost where userid=$userid",$c)or die(mysql_error());
mysql_query("UPDATE users SET jail=0 WHERE userid=$userid",$c);
}
else
{
$jailtime=(int) rand(1,30);
print "You were caught attempting to bribe your way out of the Battle Creek City Jail.
The officers beat you for a while and added $jailtime minutes to your sentence.";
mysql_query("UPDATE users SET jail=jail+$jailtime, money=money-$cost WHERE userid=$userid", $c);
mysql_query("UPDATE users SET jailreason='Caught attempting to escape' WHERE userid=$userid", $c);
}
?>
~reload