if ($chance == 1) {
$amnt=rand(1,125);
if($ir['money'] > $amnt)
{
print "As you search the streets you see <font color=blue>Nickizzle</font>; he asks you for $$amnt and you tell him to piss off.
Then he proceeds to smack the hell out of you. He takes the $$amnt anyway.
";
$db->query("UPDATE users SET money=money-$amnt where userid=$userid",$c);
$ir['money']-=$amnt;
}
else
{
print "As you walk the streets you see <font color=blue>Nickizzle</font> he asks you for $$amnt
and you tell him to go away! so <font color=blue>Nickizzle</font> smacks you over the head and looks in your wallet.
Finding it almost empty and just walks off with your wallet.
";
if ($ir['money'] < $amnt) {
$db->query("UPDATE users SET money='0' where userid=$userid",$c); } else {
$db->query("UPDATE users SET money=money-$amnt where userid=$userid",$c);}
}
}
this will check if $amnt is grater then money if so it will make money 0 if not it will subtract $amnt
please note this is not tested