Here is a code I found, when I was looking at my old Mobs Life codes. I don't know who made it, as It was part of the codes in the game when I bought it. I have been trying to make it work, and need a little help. Then after that, it will be a nice free mod for those who want to use it. And I know it was not MCC as I have been converting it to Mcc today. What is happening is when I go to race, it says I dont have enough cash. So I got stumpped there for a sec. That, and a 3 yr old trying to type for me. lol
<?php
require_once('globals.php');
Doing('Drag Racing');
include "travellingglobals.php";
if($ir['jail'] or $ir['hospital'] ) { die("This page cannot be accessed while in the hospital or jail."); }
if($ir['pagetutorials'] == ON)
{
echo "
<table width=75% border=3 bordercolor=#BDBDBD cellspacing=0 bgcolor=white frame=border rules=none>
<tr><td width=75><img src=images/flashing_amykhar.gif>
<font color=red>[i][[url="preferences.php>]<font"][i]Turn Off[/i]</font>[/url]][/i]</font></center></td><td><font color= blue size=3>[b]Drag Racing:[/b]</font><font color=#000000 size=2>
Here you can try your luck betting who will win in a drag race!
</font></td></tr></table>
";
}
echo"[img=images/drag.jpg]
<h3>The Docks</h3>";
if (isset($_POST['submit2'],$_POST['race'],$_POST['color']) && $_POST['race'] >= 0) {
if(!empty($color) ) {
$race = $_POST['race'];
if($race <= $data->money) {
$db->query("update users set `money`=`money`-$race where userid='".mysql_real_escape_string($userid)."'",$c);
$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($race*3);
$db->query("update users set `money`=`money`+$won WHERE login = '{$data->login}'");
echo "<table align=center width=100%>
<tr><td class=subTitle>[b]Drag Strip Race[/b]</td></tr>
<tr><td class=mainTxt>
Congratualations! You choosed the right car. You won 3x your money back!";
echo " </td></tr>
</table>
";
}
elseif($color == 1 && $random_color == 2) {
echo "<table align=center width=100%>
<tr><td class=subTitle>[b]Drag Strip Race[/b]</td></tr>
<tr><td class=mainTxt>You choosed the Ford Mustang.
But it was the GTO...
";
echo " </td></tr>
</table>
";
}
elseif($color == 1 && $random_color == 3) {
echo "<table align=center width=100%>
<tr><td class=subTitle>[b]Drag Strip Race[/b]</td></tr>
<tr><td class=mainTxt>You choosed the Ford Mustang.
But it was the 1970 Chevelle SS 396...
";
echo " </td></tr>
</table>
";
}
elseif($color == 2 && $random_color == 1) {
echo "<table align=center width=100%>
<tr><td class=subTitle>[b]Drag Strip Race[/b]</td></tr>
<tr><td class=mainTxt>You choosed the GTO.
But it was the Ford Mustang...
";
echo " </td></tr>
</table>
";
}
elseif($color == 2 && $random_color == 3) {
echo "<table align=center width=100%>
<tr><td class=subTitle>[b]Drag Strip Race[/b]</td></tr>
<tr><td class=mainTxt>You choosed the GTO.
But it was the 1970 Chevelle SS 396...
";
echo " </td></tr>
</table>
";
}
elseif($color == 3 && $random_color == 1) {
echo "<table align=center width=100%>
<tr><td class=subTitle>[b]Drag Strip Race[/b]</td></tr>
<tr><td class=mainTxt>You choosed the 1970 Chevelle SS 396.
But it was the Ford Mustang...
";
echo " </td></tr>
</table>
";
}
elseif($color == 3 && $random_color == 2) {
echo "<table align=center width=100%>
<tr><td class=subTitle>[b]Drag Strip Race[/b]</td></tr>
<tr><td class=mainTxt>You choosed the 1970 Chevelle SS 396.
But it was the GTO...
";
echo " </td></tr>
</table>
";
}
} else
echo "<table align=center width=100%>
<tr><td class=subTitle>[b]Drag Strip Race[/b]</td></tr>
<tr><td class=mainTxt>* Invalid amount of money!</td></tr>
</table>
";
}
else
echo "<table align=center width=100%>
<tr><td class=subTitle>[b]Drag Strip Race[/b]</td></tr>
<tr><td class=mainTxt>You haven't got enough money...</td></tr>
</table>
";
}
else {
echo "<table align=center width=100%>
<tr><td class=subTitle>[b]Drag Strip Race[/b]</td></tr>
<tr><td class=mainTxt>Welcome to the Bloody Harbor Docks.
-Here is where we have set up some drag races for you to bet on.
-You can choose between a Ford Mustang, a GTO or a 1970 Chevelle SS 396.
-Then you place your bet.
-You have a 33.33% change to win.
-If you win the race you will get 3x the amount you bet!
";
?>
<big><FORM METHOD=post ACTION="">
</big>Car:<big>
<select name="color">
<option value="1">Ford Mustang</option>
<option value="2">GTO</option>
<option value="3">1970 Chevelle SS 396</option>
</select> </big>
Amount:
<select name="race">
<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>
<INPUT name="submit2" type="submit" VALUE="Start!">
</FORM>
</td></tr>
</table>
<?PHP
}
?>