⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dragrace.php

📁 还是WEB游戏源码 Darkstep 还是WEB游戏源码 Darkstep
💻 PHP
字号:
<?php /* ------------------------- */

  include("_include-jail.php");

/* ------------------------- */ ?>
<html>


<head>
 
<title>[( Elite Avengers )]</title>
<link rel="stylesheet" type="text/css" href="css-v1.css">

</head>


<table width=100%>


<body>

<?php

if (isset($_POST['submit2'],$_POST['inzet'],$_POST['color']) && $_POST['inzet'] >= 0) {
           if(!empty($color) ) {
           $inzet = $_POST['inzet'];
           if($inzet <= $data->cash) {
mysql_query("UPDATE `[users]` set `cash`=`cash`-$inzet WHERE `login`='{$data->login}'");

$random = rand(1,9);


$randomcolor = array(
1 => 3,
2 => 2,
3 => 1,
4 => 1,
5 => 2,
6 => 3,
7 => 3,
8 => 2,
9 => 1
);

$random_color = $randomcolor[$random];
if($color == $random_color) {
$won = round($inzet*3);
mysql_query("UPDATE `[users]` set `cash`=`cash`+$won WHERE login = '{$data->login}'");
echo "<table align=center width=100%>
  <tr><td class=subTitle><b>Dragrace</b></td></tr>
  <tr><td class=mainTxt>
  Congratualations! You choosed the right car. You won 3x your money back!";
  echo " </td></tr>
</table><br>";

}
elseif($color == 1 && $random_color == 2) {
echo "<table align=center width=100%>
  <tr><td class=subTitle><b>Dragrace</b></td></tr>
  <tr><td class=mainTxt>You choosed the Honda S2000.<br> But it was the Nissan Skyline...

";
echo " </td></tr>
</table><br>";
}
elseif($color == 1 && $random_color == 3) {
echo "<table align=center width=100%>
  <tr><td class=subTitle><b>Dragrace</b></td></tr>
  <tr><td class=mainTxt>You choosed the Honda S2000.<br> But it was the Subaru Impreza...

";
echo " </td></tr>
</table><br>";
}
elseif($color == 2 && $random_color == 1) {
echo "<table align=center width=100%>
  <tr><td class=subTitle><b>Dragrace</b></td></tr>
  <tr><td class=mainTxt>You choosed the Nissan Skyline.<br> But it was the Honda S2000...
";
echo " </td></tr>
</table><br>";
}
elseif($color == 2 && $random_color == 3) {
echo "<table align=center width=100%>
  <tr><td class=subTitle><b>Dragrace</b></td></tr>
  <tr><td class=mainTxt>You choosed the Nissan Skyline.<br> But it was the Subaru Impreza...
";
echo " </td></tr>
</table><br>";
}
elseif($color == 3 && $random_color == 1) {
echo "<table align=center width=100%>
  <tr><td class=subTitle><b>Dragrace</b></td></tr>
  <tr><td class=mainTxt>You choosed the Subaru Impreza.<br> But it was the Honda S2000...
";
echo " </td></tr>
</table><br>";
}
elseif($color == 3 && $random_color == 2) {
echo "<table align=center width=100%>
  <tr><td class=subTitle><b>Dragrace</b></td></tr>
  <tr><td class=mainTxt>You choosed the Subaru Impreza.<br> But it was the Nissan Skyline...
";
echo " </td></tr>
</table><br>";
}
} else
echo "<table align=center width=100%>
  <tr><td class=subTitle><b>Dragrace</b></td></tr>
  <tr><td class=mainTxt>* Invalid amount of money!</td></tr>
</table><br>";
}
else
echo "<table align=center width=100%>
  <tr><td class=subTitle><b>Dragrace</b></td></tr>
  <tr><td class=mainTxt>You haven't got enough money...</td></tr>
</table><br>";
}
else {
echo "<table align=center width=100%>
 <tr><td class=subTitle><b>Dragrace</b></td></tr>
<tr><td class=mainTxt>Dragrace is a game where you need goodluck..<br>
-You can choose between a Honda S2000, a Nissan Skyline or a Subaru Impreza.<br>
-Then you can choose your bet.<br>
-You have got 33.33% change to win.<br>
-If you win the race you'll get 3x your amount!<br>

<br>";
?>






 <big><FORM METHOD=post ACTION="">

</big>Car:<big><br>
<select name="color">
<option value="1">Honda S2000</option>
<option value="2">Nissan Skyline</option>
<option value="3">Subaru Impreza</option>
</select>  </big>
  <br>
 <br>
Amount:<BR>
<select name="inzet">
<option value="0">None</option>
<option value="250">$250,-</option>
<option value="500">$500,-</option>
<option value="750">$750,-</option>
<option value="1000">$1,000,-</option>
<option value="1500">$1,500,-</option>
<option value="2000">$2,000,-</option>
<option value="2500">$2,500,-</option>
<option value="3000">$3,000,-</option>
<option value="5000">$5,000,-</option>
<option value="10000">$10,000,-</option>
<option value="40000">$40,000,-</option>
<option value="50000">$50,000,-</option>

</select>
 <br>
 <br>
<br>
<INPUT name="submit2" type="submit" VALUE="Start!">
</FORM>
</td></tr>
</table><br>

<?PHP
}
?>

</body>

</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -