header ("Content-type: text/html"); define('IN_PHPBB', 1); $phpbb_root_path = '../'; include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'common.'.$phpEx); include($phpbb_root_path . 'includes/functions_post.'.$phpEx); $userdata = session_pagestart($user_ip, PAGE_INDEX); init_userprefs($userdata); $user_id = $userdata['user_id']; $page_title = "Gambling Rooms"; include($phpbb_root_path . 'includes/page_header.'.$phpEx); $sql = "SELECT * FROM phpbb_users WHERE user_id = $user_id"; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Error in info entry', '', __LINE__, __FILE__, $sql); } $betinfo = mysql_fetch_array($result); $spoons = $betinfo['user_spoons']; $Bet = floatval($Bet); $amount = floatval($amount); ?>
| :: Gamble Center :: | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Rooms Open | ||||||||||
|
The following rooms are open for use: Betting Room (Info) [Play] Pokies Room (Info) [Play] |
}
//STAR info (BET)
if ($mode == "betinfo")
{
?>
||||||||||
| Betting Information | ||||||||||
|
There are 10 numbers. You can choose one of these and choose the ammount you want to bet. Three numbers are choosen at random. One of them pays out 4x what you put in, another 2x and finally 1x. If you do not get one of the lucky numbers, then you loose your bet. Happy betting! |
}
//STAR info (pokies)
if ($mode == "pokiesinfo")
{
?>
||||||||||
| Pokies Information | ||||||||||
|
This is just like the pokies. All you need to do is place your bet and pul the leaver. If you get three in a row you get out 6x what you put in. If you get any two the same, then you get out 1x. If you do not get any of the above then you lose 1x. Happy betting! |
}
//START betting
if ($mode == "bet")
{
?>
||||||||||
| Place your bet! | ||||||||||
|
|
}
if ($mode == betresults)
{
$luckynum1 = rand (1, 10);
// Make it harder to win
if($luckynum1 == $number && rand(0,2) == 2) $luckynum1 = rand(1, 10);
$luckynum2 = rand (1, 10);
// Make it harder to win
if($luckynum2 == $number && rand(0,2) == 2) $luckynum2 = rand(1, 10);
while ($luckynum1 == $luckynum2)
{
$luckynum2 = rand (1, 10);
}
$luckynum3 = rand (1, 10);
// Make it harder to win
if($luckynum3 == $number && rand(0,2) == 2) $luckynum3 = rand(1, 10);
while ($luckynum1 == $luckynum3 || $luckynum2 == $luckynum3 )
{
$luckynum3 = rand (1, 10);
}
if ($Bet > $spoons)
{
message_die(GENERAL_MESSAGE, "You do not have that many $poons!");
}
else if ($Bet < 1)
{
message_die(GENERAL_MESSAGE, "You must bet at least 1 $poon");
}
else
{
if ($number <= 0)
{
message_die(GENERAL_MESSAGE, "You did not choose a number or you chose an un-used number!");
}
else if ($number > 10)
{
message_die(GENERAL_MESSAGE, "You chose an un-used number!");
}
else
{
?>
||||||||||
| Results | ||||||||||
|
if ($number == $luckynum1) { $newspoons = $Bet * 4; $allspoons = $newspoons + $spoons; print " You now have $allspoons $poons You now have $allspoons $poons You now have $allspoons $poons! The lucky number was either $luckynum1, $luckynum2 or $luckynum3 & your number was $number You lost $Bet $poons! The numbers were: $luckynum1 for $sres1 $poons $luckynum2 for $sres2 $poons $luckynum3 for $sres3 $poons |
}
}
}
//END betting
//START POKIES
if ($mode == pokies) {
?>
||||||||||
| Pokie Machine | ||||||||||
|
|
}
if ($mode == pokieresults) {
$row1 = rand (1,6);
$row2 = rand (1,6);
$row3 = rand (1,6);
// Make it harder to win
if($row1 == $row2 && rand(0,2) == 2) $row1 = rand(1,6);
if($row2 == $row3 && rand(0,2) == 2) $row3 = rand(1,6);
if ($amount > $spoons)
{
message_die(GENERAL_MESSAGE, "You do not have that many $poons");
}
else if ($amount < 1)
{
message_die(GENERAL_MESSAGE, "You must bet at least 1 $poon");
}
else
{
//ALL in row!
if (($row1 == $row2) && ($row2 == $row3))
{
$newspoons = $amount * 6;
$allspoons = $newspoons + $spoons;
?>
||||||||||
| Pokie Machine Results | ||||||||||
|
$sql = "UPDATE phpbb_users
SET user_spoons = user_spoons + $newspoons, g_pokies_played = g_pokies_played + 1, g_pokies_won = g_pokies_won + $newspoons
WHERE (user_id = '$user_id')";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error in NNET entry', '', __LINE__, __FILE__, $sql);
}
}
//TWO the same
else if ($row1 == $row2 || $row1 == $row3 || $row2 == $row3)
{
$newspoons = $amount * 1;
$allspoons = $newspoons + $spoons;
?> ||||||||||
| Pokie Machine Results | ||||||||||
|
$sql = "UPDATE phpbb_users
SET user_spoons = user_spoons + $newspoons, g_pokies_played = g_pokies_played + 1, g_pokies_won = g_pokies_won + $newspoons
WHERE (user_id = '$user_id')";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error in info entry', '', __LINE__, __FILE__, $sql);
}
}
//None the same!
else
{
$lostspoons = ($amount * 1);
?> ||||||||||
| Pokie Machine Results | ||||||||||
|
$sql = "UPDATE phpbb_users
SET user_spoons = user_spoons - $lostspoons, g_pokies_played = g_pokies_played + 1, g_pokies_lost = g_pokies_lost + $lostspoons
WHERE (user_id = '$user_id')";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error in info entry', '', __LINE__, __FILE__, $sql);
}
}
}
}
//END Pokies
?>
||||||||||