Create File ( robbery.php ) and Put this in :)
It Should Work, Did For ME
<?php $title = "Rob Bank"; include("header.php"); ?>
<?php
if ($action != rob) {
print "You walk into the bank about to withdraw some
money when you get a sudden urge to do a
robbery..<br><br>";
print "Attempt robbery? <a href=robbery.php?
action=rob>Yup</a> - <a
href=city.php>No</a><br><br><br><font
color=#ff0000>REQUIREMENTS</font><br>1. You must
be alive<br>2. You must have atleast 1 energy<br>3.
You must have atleast 100 Credits in your bank.";
print "<br><br><Br><font
color=#ffoooo>Odds</font><br> 1/100<br><br><font
color=#ff0000>Credits gained if successful</font><br>
1000-1,000,000<br><Br><font color=#ff0000>If you get
caught</font><br>1. You lose all armor/weapons<br>2.
100 Credits will be auto deducted from the bank for your
bail";
} else {
if ($stat[energy] < 2.00) {
print "<br>You don't have enough energy.";
}
if ($stat[hp] < 1.0) {
print "<br>You have to be alive to rob the bank
dummie.";
}
if ($stat[bank] < 100.00) {
print "<br>You don't have enough money in bank.";
} else {
$chance = rand(1,100);
mysql_query("update players set energy=energy-1
where id=$stat[id]");
if ($chance == 1) {
$robbed = rand(1000,1000000);
print "Your robbery attempt is successful! You got away
with $$robbed!";
mysql_query("update players set
credits=credits+$robbed where id=$stat[id]");
mysql_query("update players set
ganked=ganked+$robbed where id=$stat[id]");
} else {
print "Oh no!<br>You got caught! <br>Loss 1
energy.<br>The pigs took all your weapons and armor!!
<br>$100 was withdrawn from your bank to bail you
out!";
mysql_query("update players set energy=energy-1
where id=$stat[id]");
mysql_query("delete from equipment where owner=$stat
[id]");
mysql_query("update players set bank=bank-100 where
id=$stat[id]");
}
$energyleft = ($stat[energy] - 1);
print "<br><br>... <a href=robbery.php?
action=rob>attempt</a> again. ($energyleft energy
left.)";
}
}
include("footer.php");
?>
Logged In: YES
user_id=874482
thanks for fixing my code by the way ;)