it is a lottery script ...
the code :
<?php $title = "Lottery"; include("header.php"); ?>
<?php
if ($action != lotto) {
print "You walk into the bank about to withdraw some
money when you get a sudden urge to play the
lottery..<br><br>";
print "Play the lottery? <a href=lottery.php?
action=lotto>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.5 energy<br>3.
You must have atleast 500 Credits.";
print "<br><br><Br><font
color=#ffoooo>Odds</font><br> 1/75<br><br><font
color=#ff0000>Credits gained if you win</font><br>
1000-100,000<br><Br>";
} else {
if ($stat[energy] < 1.5) {
print "<br>You don't have enough energy.";
}
elseif ($stat[hp] < 1.0) {
print "<br>You have to be alive to play the lottery.";
}
elseif ($stat[bank] < 500) {
print "<br>You don't have enough money.";
} else {
$chance = rand(1,75);
mysql_query("update players set energy=energy-1.5
where id=$stat[id]");
if ($chance == 1) {
$lotto = rand(1000,100000);
print "DING! DING!! DING!!! You won $lotto on your
lottery ticket!";
mysql_query("update players set credits=credits+$lotto
where id=$stat[id]");
} else {
print "Oh no!<br>Im afraid you lost!";
mysql_query("update players set credits=credits-500
where id=$stat[id]");
}
$energyleft = ($stat[energy] - 1.5);
print "<br><br>... <a href=lottery.php?
action=lotto>Play</a> again. ($energyleft energy left.)";
}
}
include("footer.php");
?>
lottery script
Logged In: YES
user_id=894684
worked like a charm :). can you tell me how i would change
the chances as i am not fully fluent in PHP.
Logged In: NO
You change the $chance = rand(1,75); and the $lotto = rand
(1000,100000); by changing the numbers.