Blackjack help needed

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   
aUsTiN
CZ Active Member
aUsTiN has been a member for over 20 year's 20 Year Member
usa.gif georgia.gif
Age: 41
Gender: Male
Website:
Status: Offline
Joined: Sep 09, 2003
0.02 posts per day
Posts: 142
Points: 57
  MSN Messenger 
open blackjack.php, find $user = $userdata['username'];, if you dont find it, add it somewhere under the include for the header.



Back to top Reply with quote
#2   re: Blackjack help needed
bowen
CZ Super Newbie
 Codezwiz Site Donator
bowen has been a member for over 20 year's 20 Year Member
Occupation: Network Admin
Gender: Male
Website:
Status: Offline
Joined: Mar 08, 2004
0.01 posts per day
Posts: 89
Points: 9,121
   
ok this is what I have done to get this to show up the points Im sorry aUsTiN but I dont know what else I can do I looked at the code in the Blackjack.php and the line $user = $userdata['username'];, is there its a great game I just hope that it can be changed somehow to work here is the blackjack.php that i am running it show the points up that the user has but as I have said b4 it does not subtract them or add them when they win or lose
<?php
////////////////////////////////////////////////////////////////////////////
///                           ___                 
///                          /  /\                ___     
///    ###       ###        /  /::\              /  /\   
///  ##    ####     ##     /  /:/\:\            /  /:/   
/// ##    ##   ##    ##   /  /:/~/::\          /__/::\   
/// ##    ##         ##  /__/:/ /:/\:\         \__\/\:\__
/// ##    ##   ##    ##  \  \:\/:/__\/  /¯¯¯/     \  \:\/\
///  ##    ####     ##    \  \::/                  \__\::/
///    ###       ###       \  \:\                  /__/:/
///                         \  \:\                 \__\/ 
///                          \__\/               
////////////////////////////////////////////////////////////////////////////

/***************************************************************************
*                              BlackJack.php
*                            ----------------
*      Version         : 1.0.0
*      Email         : [ Register or login to view links on this board. ]
*      Site         : austin-inc.com/
*      Copyright      : © aUsTiN-Inc 2003/4
*
***************************************************************************/
//
// -> NOTE, EDIT LINES 87-100 TO SET UP HOW YOU WANT YOUR GAME TO GO.
//

/* Started April 28th, 2004 */
/* Finished With Beta On April 30th, 2004 */

if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
    die ("You can't access this file directly...");
}

require("modules/Forums/nukebb.php");
define('IN_PHPBB', true);
$phpbb_root_path = 'modules/Forums/';   
include($phpbb_root_path .'extension.inc');
include($phpbb_root_path .'common.'.$phpEx);
include('includes/functions_blackjack.php');

/* Start session management */
$userdata = session_pagestart($user_ip, PAGE_INDEX, $nukeuser);
init_userprefs($userdata);

if ( !$userdata['session_logged_in'] )
{
   $redirect = "BlackJack.$phpEx";
   $redirect .= ( isset($user_id) ) ? '&user_id=' . $user_id : '';
   header('Location: ' . append_sid("login.$phpEx?redirect=$redirect", true));
}
/* End session management */
include('includes/page_header.php');
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_blackjack.'.$phpEx);


//Start Install
global $db, $dbi, $prefix, $table_prefix, $table;
$nuke = $prefix;
$phpBB = $table_prefix;
if($nuke) {
$table = $prefix ."_";
} elseif($phpBB) {
$table = $table_prefix;
}
$table = $table;
// Install if not installed
$sql = "SELECT * FROM ". $table ."blackjack_info";
if(!$db->sql_query($sql))  {
$sql1 = "CREATE TABLE ". $table ."blackjack_cards (number int(2) NOT NULL default '0', value text NOT NULL)";
$result1 = $db->sql_query($sql1);
$sql2 = "INSERT INTO ". $table ."blackjack_cards VALUES (1, 'Two Of Clubs'),(2, 'Three Of Clubs'),(3, 'Four Of Clubs'),(4, 'Five Of Clubs'),(5, 'Six Of Clubs'),(6, 'Seven Of Clubs'),(7, 'Eight Of Clubs'),(8, 'Nine Of Clubs'),(9, 'Ten Of Clubs'),(10, 'Jack Of Clubs'),(11, 'Queen Of Clubs'),(12, 'King Of Clubs'),(13, 'Ace Of Clubs'),(14, 'Two Of Diamonds'),(15, 'Three Of Diamonds'),(16, 'Four Of Diamonds'),(17, 'Five Of Diamonds'),(18, 'Six Of Diamonds'),(19, 'Seven Of Diamonds'),(20, 'Eight Of Diamonds'),(21, 'Nine Of Diamonds'),(22, 'Ten Of Diamonds'),(23, 'Jack Of Diamonds'),(24, 'Queen Of Diamonds'),(25, 'King Of Diamonds'),(26, 'Ace Of Diamonds'),(27, 'Two Of Hearts'),(28, 'Three Of Hearts'),(29, 'Four Of Hearts'),(30, 'Five Of Hearts'),(31, 'Six Of Hearts'),(32, 'Seven Of Hearts'),(33, 'Eight Of Hearts'),(34, 'Nine Of Hearts'),(35, 'Ten Of Hearts'),(36, 'Jack Of Hearts'),(37, 'Queen Of Hearts'),(38, 'King Of Hearts'),(39, 'Ace Of Hearts'),(40, 'Two Of Spades'),(41, 'Three Of Spades'),(42, 'Four Of Spades'),(43, 'Five Of Spades'),(44, 'Six Of Spades'),(45, 'Seven Of Spades'),(46, 'Eight Of Spades'),(47, 'Nine Of Spades'),(48, 'Ten Of Spades'),(49, 'Jack Of Spades'),(50, 'Queen Of Spades'),(51, 'King Of Spades'),(52, 'Ace Of Spades')";
$result2 = $db->sql_query($sql2);
$sql3 = "CREATE TABLE ". $table ."blackjack_info (given int(20) NOT NULL default '0', taken int(20) NOT NULL default '0', wins int(20) NOT NULL default '0', losses int(20) NOT NULL default '0', ties int(20) NOT NULL default '0', re_dealt int(20) NOT NULL default '0')";
$result3 = $db->sql_query($sql3);
$sql4 = "INSERT INTO ". $table ."blackjack_info VALUES (0, 0, 0, 0, 0, 0)";
$result4 = $db->sql_query($sql4);
}


/* Get Game Info */
      $q = "SELECT *
           FROM ". $table ."blackjack_info";
      $r          = $db -> sql_query($q);
      while($row    = $db -> sql_fetchrow($r))
         {   
      $given1       = $row['given'];
      $taken1       = $row['taken'];
      $wins1          = $row['wins'];
      $losses1       = $row['losses'];
      $ties1          = $row['ties'];
      $re_dealt1       = $row['re_dealt'];   
         }
         
/* Dealers Show Card */      
      $q = "SELECT *
           FROM ". $table ."blackjack_cards
           ORDER BY RAND()
           LIMIT 1";
      $r          = $db -> sql_query($q);
      while($row    = $db -> sql_fetchrow($r))
         {   
      $d2_number    = $row['number'];
      $d2_card    = $row['value'];
         }         

/* Players Show Card */
      $q = "SELECT *
           FROM ". $table ."blackjack_cards
           WHERE number <> '$d2_number'                                
           ORDER BY RAND()
           LIMIT 1";
      $r          = $db -> sql_query($q);
      while($row    = $db -> sql_fetchrow($r))
         {   
      $p2_number    = $row['number'];
      $p2_card    = $row['value'];
         }

   
/* Strings n Stuff */

   /* Change THe Following Strings To Suit Your Board */
      /* Nuke Or phpBB? Put A 1 (one) In Yours. */   
   $nuke         = "1";
   $phpBB         = "0";
      /* Delete the 1 if you want to play free, Add a 1 if you want to use points. */
   $use_reward      = "1";
      /* Highest Bet Allowed */
   $max_bet       = "50";
      /* Cost To Re-Deal The Cards */
   $re_deal_cost   = "25";
      /* Reward Times This Number For Their Prize. Leave It At One, They Win What They Bet */
   $reward_timez   = "2";
      /* Edit This ONLY IF YOURS IS DIFFERENT */
   $points_name    = $board_config['points'];
      /* Edit This ONLY IF YOURS IS DIFFERENT */
   $points       = $userdata['points'];      
   /* Finished With What You Edit */
   
   
   $d1_total       = DealersCardValue($d2_number);
   $p1_total       = PlayersCardValue($p2_number);
   $p_has          = $userdata['username'] ." ". $lang['BlackJack_player_has_1'] ." $p1_total ". $lang['BlackJack_player_has_2'];
   $d_has          = $lang['BlackJack_dealer_has_1'] ." $d1_total ". $lang['BlackJack_dealer_has_2'];   
   $img_path       = "modules/Forums/images/BlackJack_Cards/";
   $cardEx       = ".gif";
   $fd            = $img_path . "fd.jpg";
   $dealer_path    = $img_path . "dealer" . $cardEx;
   $d2_folder      = DealersSecondCard($d2_number);
   $p2_folder      = PlayersSecondCard($p2_number);
   $link         = "BlackJack";
   $page_title      = "BlackJack";         
   $d1_img_path    = $img_path . $d1_folder . "/" . $d1_number . $cardEx;
   $d2_img_path    = $img_path . $d2_folder . "/" . $d2_number . $cardEx;   
   $p1_img_path   = $img_path . $p1_folder . "/" . $p1_number . $cardEx;
   $p2_img_path   = $img_path . $p2_folder . "/" . $p2_number . $cardEx;
   $bet         = $_POST['wager'];
   $mode         = $_GET['mode'];   
   $dealers_2       = $_POST['dealer_card_2'];   
   $player_2       = $_POST['player_card_2'];
   $top_link      = "<a href='index.php'>". $board_config['sitename'] ."</a> :: <a href='modules.php?name=Forums&file=$link'>BlackJack</a>";
            
   if(!$points_name)    $points_name    = "Points";
   if(!$points)       $points       = "0";
   $user             = $userdata['username'];               
/* Output The Page */

   echo "<br><br>";
   echo "<table width='100%' align='center'>";
   echo "   <tr>";
   echo "      <td align='left' width='100%'>";   
   echo "         <span class='genmed'>";
   echo "            $top_link";
   echo "         </span>";
   echo "      </td>";   
   echo "   </tr>";
   echo "</table>";
   echo "<br>";
   
if($mode == "re-deal")
   {

   if($use_reward)
      {   
   if($points < $re_deal_cost)
      {
   message_die(GENERAL_ERROR, $lang['BlackJack_redeal_fee_error'] . $re_deal_cost ." ". $points_name, $lang['BlackJack_msg_error']);
      }
   }
      if($use_reward) TakePoints($user, $re_deal_cost);
            
   $r = $re_dealt1 + 1;
      
      $q    = "UPDATE ". $table ."blackjack_info
           SET re_dealt = '$r'";
      $r   = $db -> sql_query($q);   
   }
   
if($mode == "bet")
   {
   
   $bet = round($bet);
   
   if (!is_numeric($bet))
      {
   message_die(GENERAL_ERROR, $lang['BlackJack_inv_bet'], $lang['BlackJack_msg_error']);      
      }
   
   if($use_reward)
      {
   if($bet)
      {
   $stand = "$bet $points_name.";
      }
   else
      {
   message_die(GENERAL_ERROR, $lang['BlackJack_must_bet'], $lang['BlackJack_msg_error']);
      }
   
   if($bet > $max_bet)
      {
   message_die(GENERAL_ERROR, $lang['BlackJack_no_bet_more_1'] .  $max_bet . $points_name . $lang['BlackJack_no_bet_more_2'], $lang['BlackJack_msg_error']);      
      }
      
   if($bet > $points)
      {
   message_die(GENERAL_ERROR, $lang['BlackJack_cant_bet_more_onhand_1'] . $points_name . $lang['BlackJack_cant_bet_more_onhand_2'], $lang['BlackJack_msg_error']);      
      }
   }


/* Select Dealers Second Card, Do It Here To Avoid Users Manipulating. */
      $q = "SELECT *
           FROM ". $table ."blackjack_cards
           WHERE number <> '$dealers_2' AND
           number <> '$player_2'
           ORDER BY RAND()
           LIMIT 1";
      $r          = $db -> sql_query($q);
      while($row    = $db -> sql_fetchrow($r))
         {   
      $d1_number    = $row['number'];
      $d1_card    = $row['value'];
         }
         
/* Select Players Second Card, Do It Here To Avoid Users Manipulating. */
      $q = "SELECT *
           FROM ". $table ."blackjack_cards
           WHERE number <> '$dealers_2' AND
           number <> '$player_2' AND
           number <> '$d1_number'                     
           ORDER BY RAND()
           LIMIT 1";
      $r          = $db -> sql_query($q);
      while($row    = $db -> sql_fetchrow($r))
         {   
      $p1_number    = $row['number'];
      $p1_card    = $row['value'];
         }

/* Get The Card From The First Part For The Dealer */
      $q = "SELECT *
           FROM ". $table ."blackjack_cards
           WHERE number = '$dealers_2'";
      $r          = $db -> sql_query($q);
      while($row    = $db -> sql_fetchrow($r))
         {   
      $d2_number    = $row['number'];         
      $d2_card    = $row['value'];
         }

/* Get The Card From The First Part For The Player */
      $q = "SELECT *
           FROM ". $table ."blackjack_cards
           WHERE number = '$player_2'";

      $r          = $db -> sql_query($q);
      while($row    = $db -> sql_fetchrow($r))
         {   
      $p2_number    = $row['number'];         
      $p2_card    = $row['value'];
         }   
                                 
   $dealer_value_2    = DealersCardValue($d2_number);
   $player_value_2    = PlayersCardValue($p2_number);   
   $dealer_value_1    = DealersCardValue($d1_number);   
   $player_value_1    = PlayersCardValue($p1_number);   
   $dealer          = $dealer_value_1 + $dealer_value_2;
   $player          = $player_value_1 + $player_value_2;   
   $stand             = "$bet $points_name.";                           
                                 
   /* Check For A BlackJack */
      /* Dealer Check */
   if(($dealer_value_1 == "10") && ($dealer_value_2 == "1")) $dealer = "21";
   if(($dealer_value_1 == "1") && ($dealer_value_2 == "10")) $dealer = "21";
      /* Player Check */
   if(($player_value_1 == "10") && ($player_value_2 == "1")) $player = "21";
   if(($player_value_1 == "1") && ($player_value_2 == "10")) $player = "21";
   
   /* Change Output For Total On BlackJack */      
      /* Dealers Change */
   if($dealer == "21")
      {
   $dealer_has = $lang['BlackJack_dealer_blackjack'];
      }
   else
      {
   $dealer_has = $lang['BlackJack_dealer_has_1'] . $dealer . $lang['BlackJack_dealer_has_2'];
      }
      /* Players Change */
   if($player == "21")
      {
   $player_has = $userdata['username'] . $lang['BlackJack_player_blackjack'];
      }
   else
      {
   $player_has = $userdata['username'] . $lang['BlackJack_player_has_1'] . $player . $lang['BlackJack_player_has_2'];
      }
      
/* Update The Stats */   
global $table;      
   $g = $given1 + $bet * $reward_timez;
   $t = ($taken1 + $bet) + ($re_dealt1 * $re_deal_cost);
   $w = $wins1 + 1;
   $k = $losses1 + 1;
   $i = $ties1 + 1;
                  
/* Winner & Loser Standings */
   if(($dealer == "21") && ($player == "21"))
      {
   $d_status = $lang['BlackJack_dealer_wins'] . $stand;
   $p_status = $lang['BlackJack_player_loses']. $stand;
      
      $q    = "UPDATE ". $table ."blackjack_info
            SET losses = '$k'";
      $r   = $db -> sql_query($q);
      
      $q    = "UPDATE ". $table ."blackjack_info
            SET taken = '$t'";
      $r   = $db -> sql_query($q);
      
      if($use_reward) TakePoints($user, $bet);                  
      }
   elseif($dealer > $player)
      {
   $d_status = $lang['BlackJack_dealer_wins'] . $stand;
   $p_status = $lang['BlackJack_player_loses']. $stand;
      
      $q    = "UPDATE ". $table ."blackjack_info
            SET losses = '$k'";
      $r   = $db -> sql_query($q);
      
      $q    = "UPDATE ". $table ."blackjack_info
            SET taken = '$t'";
      $r   = $db -> sql_query($q);
      
      if($use_reward) TakePoints($user, $bet);
      }
   elseif($dealer < $player)
      {
   $d_status = $lang['BlackJack_dealer_loses'] . $stand;
   $p_status = $lang['BlackJack_player_wins'] . $stand;
   
      $q    = "UPDATE ". $table ."blackjack_info
            SET wins = '$w'";
      $r   = $db -> sql_query($q);
   
      $q    = "UPDATE ". $table ."blackjack_info
            SET given = '$g'";
      $r   = $db -> sql_query($q);
      
      if($use_reward) GivePoints($user, $bet, $reward_timez);                           
      }
   else
      {
   $d_status = $lang['BlackJack_hand_tie'];
   $p_status = $lang['BlackJack_hand_tie'];
      
      $q    = "UPDATE ". $table ."blackjack_info
            SET ties = '$i'";
      $r   = $db -> sql_query($q);               
         }

   $d1_folder      = DealersSecondCard($d1_number);
   $d2_folder      = DealersSecondCard($d2_number);   
   $p1_folder      = PlayersSecondCard($p1_number);
   $p2_folder      = PlayersSecondCard($p2_number);         
   $d1_img_path    = $img_path . $d1_folder . "/" . $d1_number . $cardEx;
   $d2_img_path    = $img_path . $d2_folder . "/" . $d2_number . $cardEx;   
   $p1_img_path   = $img_path . $p1_folder . "/" . $p1_number . $cardEx;
   $p2_img_path   = $img_path . $p2_folder . "/" . $p2_number . $cardEx;

   echo "<br>";               
   echo "<table width='100%' border='0' cellspacing='2' align='center' valign='top' class='forumline'>";
   echo "   <tr>";
   echo "      <td align='center' valign='top' class='row2' width='33%'>";   
   echo "         <span class='genmed'>";
   echo "            $dealer_has";
   echo "         </span>";
   echo "      </td>";   
   echo "      <td align='center' valign='top' class='row2' width='33%'>";   
   echo "         <span class='genmed'>";
   echo "            ".$lang['BlackJack_dealer'];
   echo "         </span>";
   echo "      </td>";
   echo "      <td align='center' valign='top' class='row2' width='33%'>";   
   echo "         <span class='genmed'>";
   echo "            $player_has";
   echo "         </span>";
   echo "      </td>";   
   echo "   </tr>";
   echo "</table>";      
   echo "<table width='100%' border='0' cellspacing='2' align='center' valign='top' class='forumline'>";
   echo "   <tr>";
   echo "      <td align='center' valign='top' class='row2' width='33%'>";   
   echo "<table width='100%' border='0' cellspacing='2' align='center' valign='top' class='forumline'>";
   echo "   <tr>";
   echo "      <td align='center' valign='top' class='row2' width='45%'>";   
   echo "         <span class='genmed'>";
   echo "            ".$lang['BlackJack_values'];
   echo "         </span>";
   echo "      </td>";   
   echo "      <td align='center' valign='top' class='row2' width='55%'>";   
   echo "         <span class='genmed'>";
   echo "            ".$lang['BlackJack_cards'];
   echo "         </span>";
   echo "      </td>";
   echo "   </tr>";   
   echo "   <tr>";
   echo "      <td align='center' valign='top' class='row2' width='45%'>";   
   echo "         <span class='genmed'>";
   echo "            $d1_card<br>$d2_card";
   echo "         </span>";
   echo "      </td>";   
   echo "      <td align='center' valign='top' class='row2' width='55%'>";   
   echo "         <img src='$d1_img_path' border='0'><br><img src='$d2_img_path' border='0'>";
   echo "      </td>";
   echo "   </tr>";
   echo "</table>";   
   echo "<table width='100%' border='0' cellspacing='2' align='center' valign='top' class='forumline'>";
   echo "   <tr>";
   echo "      <td align='center' valign='top' class='row2' width='100%'>";   
   echo "         <span class='genmed'>";
   echo "            $d_status";
   echo "         </span>";
   echo "      </td>";   
   echo "   </tr>";
   echo "</table>";      
   echo "      </td>";
   echo "      <td align='center' valign='top' class='row2' width='33%'>";      
   echo "<table width='100%' border='0' cellspacing='2' align='center' valign='top' class='forumline'>";
   echo "   <tr>";
   echo "      <td align='center' valign='top' class='row2' width='30%'>";   
   echo "         <span class='genmed'>";
   echo "            <img src='$dealer_path' border='0'>";
   echo "         </span>";
   echo "      </td>";   
   echo "   </tr>";
   echo "</table>";   
   $deal    = append_sid("$link?mode=deal");   
   echo "<form method='post' name='deal' action='$deal'>";   
   echo "<table width='100%' border='0' cellspacing='2' align='center' valign='middle' class='forumline'>";   
   echo "   <tr>";
   echo "      <td align='center' valign='middle' class='row2' width='50%'>";               
   echo "         <span class='genmed'>";
   echo "            ".$lang['BlackJack_deal_again'];
   echo "         </span>";
   echo "      </td>";      
   echo "      <td align='center' valign='middle' class='row2' width='50%'>";               
   echo "         <br>";                           
   echo "         <input class='mainoption' type='submit' value=' Deal Em ' onchange='document.deal.submit()'>";   
   echo "      </td>";
   echo "   </tr>";
   echo "</table>";
   echo "</form>";   
   echo "      </td>";
   echo "      <td align='center' valign='top' class='row2' width='33%'>";   
   echo "<table width='100%' border='0' cellspacing='2' align='center' valign='top' class='forumline'>";
   echo "   <tr>";
   echo "      <td align='center' valign='top' class='row2' width='55%'>";   
   echo "         <span class='genmed'>";
   echo "            ".$lang['BlackJack_cards'];
   echo "         </span>";
   echo "      </td>";   
   echo "      <td align='center' valign='top' class='row2' width='45%'>";   
   echo "         <span class='genmed'>";
   echo "            ".$lang['BlackJack_values'];
   echo "         </span>";
   echo "      </td>";
   echo "   </tr>";   
   echo "   <tr>";   
   echo "      <td align='center' valign='top' class='row2' width='55%'>";   
   echo "         <img src='$p1_img_path' border='0'><br><img src='$p2_img_path' border='0'>";
   echo "      </td>";
   echo "      <td align='center' valign='top' class='row2' width='45%'>";   
   echo "         <span class='genmed'>";
   echo "            $p1_card<br>$p2_card";
   echo "         </span>";
   echo "      </td>";   
   echo "   </tr>";
   echo "</table>";   
   echo "<table width='100%' border='0' cellspacing='2' align='center' valign='top' class='forumline'>";
   echo "   <tr>";
   echo "      <td align='center' valign='top' class='row2' width='100%'>";   
   echo "         <span class='genmed'>";
   echo "            $p_status";
   echo "         </span>";
   echo "      </td>";   
   echo "   </tr>";   
   echo "</table>";   
   echo "      </td>";
   echo "   </tr>";
   echo "</table>";
            
      }   
   else      
      {
      
   echo "<br>";         
   echo "<table width='100%' border='0' cellspacing='2' align='center' valign='top' class='forumline'>";
   echo "   <tr>";
   echo "      <td align='center' valign='top' class='row2' width='33%'>";   
   echo "         <span class='genmed'>";
   echo "            $d_has";
   echo "         </span>";
   echo "      </td>";   
   echo "      <td align='center' valign='top' class='row2' width='33%'>";   
   echo "         <span class='genmed'>";
   echo "            ".$lang['BlackJack_dealer'];
   echo "         </span>";
   echo "      </td>";
   echo "      <td align='center' valign='top' class='row2' width='33%'>";   
   echo "         <span class='genmed'>";
   echo "            $p_has";
   echo "         </span>";
   echo "      </td>";   
   echo "   </tr>";
   echo "</table>";      
   echo "<table width='100%' border='0' cellspacing='2' align='center' valign='top' class='forumline'>";
   echo "   <tr>";
   echo "      <td align='center' valign='top' class='row2' width='33%'>";
   
   echo "<table width='100%' border='0' cellspacing='2' align='center' valign='top' class='forumline'>";
   echo "   <tr>";
   echo "      <td align='center' valign='top' class='row2' width='45%'>";   
   echo "         <span class='genmed'>";
   echo "            ".$lang['BlackJack_values'];
   echo "         </span>";
   echo "      </td>";   
   echo "      <td align='center' valign='top' class='row2' width='55%'>";   
   echo "         <span class='genmed'>";
   echo "            ".$lang['BlackJack_cards'];
   echo "         </span>";
   echo "      </td>";
   echo "   </tr>";   
   echo "   <tr>";
   echo "      <td align='center' valign='top' class='row2' width='45%'>";   
   echo "         <span class='genmed'>";
   echo "            <br>$d2_card";
   echo "         </span>";
   echo "      </td>";   
   echo "      <td align='center' valign='top' class='row2' width='55%'>";   
   echo "         <img src='$fd' border='0' height='100' width='75'><br><img src='$d2_img_path' border='0'>";
   echo "      </td>";
   echo "   </tr>";
   echo "</table>";   
   echo "<table width='100%' border='0' cellspacing='2' align='center' valign='top' class='forumline'>";
   echo "   <tr>";
   echo "      <td align='center' valign='top' class='row2' width='100%'>";   
   echo "         <span class='genmed'>";
   echo "            $d_status";
   echo "         </span>";
   echo "      </td>";   
   echo "   </tr>";
   echo "</table>";   
   
   echo "      </td>";
   echo "      <td align='center' valign='top' class='row2' width='33%'>";
      
   echo "<table width='100%' border='0' cellspacing='2' align='center' valign='top' class='forumline'>";
   echo "   <tr>";
   echo "      <td align='center' valign='top' class='row2' width='30%'>";   
   echo "         <span class='genmed'>";
   echo "            <img src='$dealer_path' border='0'>";
   echo "         </span>";
   echo "      </td>";   
   echo "   </tr>";
   echo "</table>";   
   $deal    = append_sid("$link?mode=re-deal");   
   echo "<form method='post' name='deal' action='$deal'>";   
   echo "<table width='100%' border='0' cellspacing='2' align='center' valign='middle' class='forumline'>";   
   echo "   <tr>";
   echo "      <td align='center' valign='middle' class='row2' width='50%'>";               
   echo "         <span class='genmed'>";
   echo "            ".$lang['BlackJack_no_chance'];
   echo "         </span>";
   echo "      </td>";      
   echo "      <td align='center' valign='middle' class='row2' width='50%'>";               
   echo "         <br>";                           
   echo "         <input class='mainoption' type='submit' value=' Re-Deal ' onchange='document.deal.submit()'>";   
   echo "      </td>";
   echo "   </tr>";
   echo "</table>";
   echo "</form>";
   $bet    = append_sid("$link?mode=bet");         
   echo "<form method='post' name='bet' action='$bet'>";
   echo "<table width='100%' border='0' cellspacing='2' align='center' valign='middle' class='forumline'>";                     
   echo "      <td align='center' valign='middle' class='row2' width='50%'>";               
   echo "         <br>";            
   echo "         <input class='mainoption' type='submit' value=' Bet ' onchange='document.bet.submit()'>";      
   echo "      </td>";   
   echo "      <td align='center' valign='middle' class='row2' width='50%'>";
   echo "         <span class='genmed'>";   
   echo "            ".$lang['BlackJack_place_bet'];               
   echo "               <br>";                                 
   echo "            <input class='post' type='hidden' value='$d2_number' name='dealer_card_2'>";      
   echo "            <input class='post' type='hidden' value='$p2_number' name='player_card_2'>";            
   echo "            <input class='post' type='text' value='$max_bet' name='wager' size='10'>";   
   echo "         </span>";      
   echo "      </td>";                  
   echo "   </tr>";            
   echo "</table>";
   echo "</form>";   

   echo "      </td>";
   echo "      <td align='center' valign='top' class='row2' width='33%'>";
   
   echo "<table width='100%' border='0' cellspacing='2' align='center' valign='top' class='forumline'>";
   echo "   <tr>";
   echo "      <td align='center' valign='top' class='row2' width='55%'>";   
   echo "         <span class='genmed'>";
   echo "            ".$lang['BlackJack_cards'];
   echo "         </span>";
   echo "      </td>";   
   echo "      <td align='center' valign='top' class='row2' width='45%'>";   
   echo "         <span class='genmed'>";
   echo "            ".$lang['BlackJack_values'];
   echo "         </span>";
   echo "      </td>";
   echo "   </tr>";   
   echo "   <tr>";   
   echo "      <td align='center' valign='top' class='row2' width='55%'>";   
   echo "         <img src='$fd' border='0' height='100' width='75'><br><img src='$p2_img_path' border='0'>";
   echo "      </td>";
   echo "      <td align='center' valign='top' class='row2' width='45%'>";   
   echo "         <span class='genmed'>";
   echo "            <br>$p2_card";
   echo "         </span>";
   echo "      </td>";   
   echo "   </tr>";
   echo "</table>";   
   echo "<table width='100%' border='0' cellspacing='2' align='center' valign='top' class='forumline'>";
   echo "   <tr>";
   echo "      <td align='center' valign='top' class='row2' width='100%'>";   
   echo "         <span class='genmed'>";
   echo "            $p_status";
   echo "         </span>";
   echo "      </td>";   
   echo "   </tr>";   
   echo "</table>";
   
   echo "      </td>";
   echo "   </tr>";
   echo "</table>";
   }   

      $total         = $wins1 + $losses1 + $ties1 + $re_dealt1;
      $totals         = number_format($total);
      $given          = number_format($given1);
      $taken         = number_format($taken1);
      $wins          = number_format($wins1);
      $losses         = number_format($losses1);
      $ties         = number_format($ties1);
      $re_dealt       = number_format($re_dealt1);      
         
   echo "<table width='100%' border='0' cellspacing='2' align='center' valign='top' class='forumline'>";
   echo "   <tr>";
   echo "      <td align='left' valign='top' class='row2' width='50%'>";   
   echo "         <span class='genmed'>";
   echo "            ".$lang['BlackJack_amount_1'] .$points_name . $lang['BlackJack_amount_2'];
   echo "         </span>";
   echo "      </td>";
   echo "      <td align='left' valign='top' class='row2' width='50%'>";   
   echo "         <span class='genmed'>";
   echo "            $points";
   echo "         </span>";
   echo "      </td>";      
   echo "   </tr>";
   echo "   <tr>";
   echo "      <td align='left' valign='top' class='row2' width='50%'>";   
   echo "         <span class='genmed'>";
   echo "            ".$lang['BlackJack_amount_1'] . $points_name . $lang['BlackJack_amount_won'];
   echo "         </span>";
   echo "      </td>";
   echo "      <td align='left' valign='top' class='row2' width='50%'>";   
   echo "         <span class='genmed'>";
   echo "            $given";
   echo "         </span>";
   echo "      </td>";      
   echo "   </tr>";
   echo "   <tr>";
   echo "      <td align='left' valign='top' class='row2' width='50%'>";   
   echo "         <span class='genmed'>";
   echo "            ".$lang['BlackJack_amount_1'] . $points_name . $lang['BlackJack_amount_lost'];
   echo "         </span>";
   echo "      </td>";
   echo "      <td align='left' valign='top' class='row2' width='50%'>";   
   echo "         <span class='genmed'>";
   echo "            $taken";
   echo "         </span>";
   echo "      </td>";      
   echo "   </tr>";
   echo "   <tr>";
   echo "      <td align='left' valign='top' class='row2' width='50%'>";   
   echo "         <span class='genmed'>";
   echo "            ".$lang['BlackJack_amount_games'];
   echo "         </span>";
   echo "      </td>";
   echo "      <td align='left' valign='top' class='row2' width='50%'>";   
   echo "         <span class='genmed'>";
   echo "            $totals";
   echo "         </span>";
   echo "      </td>";      
   echo "   </tr>";
   echo "   <tr>";
   echo "      <td align='left' valign='top' class='row2' width='50%'>";   
   echo "         <span class='genmed'>";
   echo "            ".$lang['BlackJack_amount_1'] . $points_name. $lang['BlackJack_amount_to_redeal'];
   echo "         </span>";
   echo "      </td>";
   echo "      <td align='left' valign='top' class='row2' width='50%'>";   
   echo "         <span class='genmed'>";
   echo "            $re_deal_cost";
   echo "         </span>";
   echo "      </td>";      
   echo "   </tr>";   
   echo "</table>";
   echo "<table width='100%' border='0' cellspacing='2' align='center' valign='top' class='forumline'>";   
   echo "   <tr>";
   echo "      <td align='center' valign='top' class='row2' width='25%'>";   
   echo "         <span class='genmed'>";
   echo "            ".$lang['BlackJack_games_won'];
   echo "         </span>";
   echo "      </td>";
   echo "      <td align='center' valign='top' class='row2' width='25%'>";   
   echo "         <span class='genmed'>";
   echo "            ".$lang['BlackJack_games_lost'];
   echo "         </span>";
   echo "      </td>";
   echo "      <td align='center' valign='top' class='row2' width='25%'>";   
   echo "         <span class='genmed'>";
   echo "            ".$lang['BlackJack_games_tied'];
   echo "         </span>";
   echo "      </td>";
   echo "      <td align='center' valign='top' class='row2' width='25%'>";   
   echo "         <span class='genmed'>";
   echo "            ".$lang['BlackJack_games_redealt'];
   echo "         </span>";
   echo "      </td>";               
   echo "   </tr>";
   echo "   <tr>";
   echo "      <td align='center' valign='top' class='row2' width='25%'>";   
   echo "         <span class='genmed'>";
   echo "            $wins";
   echo "         </span>";
   echo "      </td>";
   echo "      <td align='center' valign='top' class='row2' width='25%'>";   
   echo "         <span class='genmed'>";
   echo "            $losses";
   echo "         </span>";
   echo "      </td>";
   echo "      <td align='center' valign='top' class='row2' width='25%'>";   
   echo "         <span class='genmed'>";
   echo "            $ties";
   echo "         </span>";
   echo "      </td>";
   echo "      <td align='center' valign='top' class='row2' width='25%'>";   
   echo "         <span class='genmed'>";
   echo "            $re_dealt";
   echo "         </span>";
   echo "      </td>";               
   echo "   </tr>";                  
   echo "</table>";
                           
/* Remove this and dont bother asking for assistance with anything
  Give credit where credit is due. Thanks. */
 
   echo "<br><br>";     
   echo "<table width='100%' cellspacing='2' align='center' valign='bottom'>";   
   echo "   <tr>"; 
   echo "      <td align='center' valign='middle' class='row2'>";
   echo "         <span class='gensmall'>";
   echo "             Single Shot Chance BlackJack &copy; <a href='http://austin-inc.com/'>aUsTiN-Inc</a> 2003/4<br>Ported for PHPNuke by <a href='http://codezwiz.com/'>Telli</a> ";
   echo "         </span>";   
   echo "      </td>";
   echo "   </tr>";                     
   echo "</table>";
         
include('includes/page_tail.php');

?>


help please icon_smile.gif


Back to top Reply with quote
#3   
aUsTiN
CZ Active Member
aUsTiN has been a member for over 20 year's 20 Year Member
usa.gif georgia.gif
Age: 41
Gender: Male
Website:
Status: Offline
Joined: Sep 09, 2003
0.02 posts per day
Posts: 142
Points: 57
  MSN Messenger 
Try opening the functions & changing the SQL to what yours is. Where it might be strings. Such as update ". $table ." users, change to update nuke_users etc.. to be directly what yours is named. Same with the users points fields. I am really not the one who should be helpin as i dont even use Nuke... But until telli can help ya i will try..



Back to top Reply with quote
#4   re: Blackjack help needed
bowen
CZ Super Newbie
 Codezwiz Site Donator
bowen has been a member for over 20 year's 20 Year Member
Occupation: Network Admin
Gender: Male
Website:
Status: Offline
Joined: Mar 08, 2004
0.01 posts per day
Posts: 89
Points: 9,121
   
icon_smile.gif thanks austin your help is great icon_smile.gif



Back to top Reply with quote
#5   
aUsTiN
CZ Active Member
aUsTiN has been a member for over 20 year's 20 Year Member
usa.gif georgia.gif
Age: 41
Gender: Male
Website:
Status: Offline
Joined: Sep 09, 2003
0.02 posts per day
Posts: 142
Points: 57
  MSN Messenger 
Let us know if its fixed..



Back to top Reply with quote
#6   re: Blackjack help needed
bowen
CZ Super Newbie
 Codezwiz Site Donator
bowen has been a member for over 20 year's 20 Year Member
Occupation: Network Admin
Gender: Male
Website:
Status: Offline
Joined: Mar 08, 2004
0.01 posts per day
Posts: 89
Points: 9,121
   
No its still not fixed I am playing around with the code to see if I can get it to work.....with not to much sucess icon_sad.gif



Back to top Reply with quote
#7   re: Blackjack help needed
a66fm
CZ Newbie
a66fm has been a member for over 20 year's 20 Year Member
greece.gif
Age: 53
Gender: Male
Status: Offline
Joined: May 21, 2004
0.00 posts per day
Posts: 1
Points: 547
   
if you haven't figured it out yet do this
on the functions file change the code at the bottom of the file to this
function GivePoints($user, $bet, $reward_timez)
   {
      global $db, $prefix;
      
   $new = $bet * $reward_timez;
   
      $q = "UPDATE ". $prefix ."_users
           SET points = points + '$new'
           WHERE username = '$user'";
      $r = $db -> sql_query($q);
   return;   
   }

function TakePoints($user, $bet)
   {
      global $db, $prefix;

      $q = "UPDATE ". $prefix ."_users
           SET points = points - '$bet'
           WHERE username = '$user'";
      $r = $db -> sql_query($q);
   return;   
   }


at the blackjack.php change the config lines to this

   /* Edit This ONLY IF YOURS IS DIFFERENT */
   $points_name    = $board_config['points'];
      /* Edit This ONLY IF YOURS IS DIFFERENT */
   $points       = $userdata['points'];
   /* Finished With What You Edit */



Back to top Reply with quote
#8   re: Blackjack help needed
ledzeppelin
CZ Newbie
ledzeppelin has been a member for over 19 year's 19 Year Member
usa.gif indiana.gif
Age: 42
Gender: Male
Fav. Sports Team: UMMMMMMMM
Status: Offline
Joined: Sep 16, 2004
0.00 posts per day
Posts: 23
Points: 3,373
   
I don't like the fact that you can't say "hit me" you just win or lose on the first deal.



Back to top Reply with quote
#9   re: Blackjack help needed
ledzeppelin
CZ Newbie
ledzeppelin has been a member for over 19 year's 19 Year Member
usa.gif indiana.gif
Age: 42
Gender: Male
Fav. Sports Team: UMMMMMMMM
Status: Offline
Joined: Sep 16, 2004
0.00 posts per day
Posts: 23
Points: 3,373
   
If a user click refresh after they have won a game the points just keep racking up and up and up. Is there a way to fix that?



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum