modernmafia
Members-
Posts
188 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by modernmafia
-
still having problems any one else knowwhat the hells up with it
-
i have a problem sometimes when i bet, it gives me a card but does not count it towards the actually game. for example, if i have a 5 a 6 and a king, the king wont count so I will have 11 not 21 can any one see below on my codes whats wrong or why it does this <?php session_start(); include "includes/db_connect.php"; include "includes/functions.php"; if ($info->last_script_check < time()){ include_once "probe.php"; } logincheck(); $playersusername = $_SESSION['username']; $username = $_SESSION['username']; $fetch= mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$username'")); $ding_dong1=mysql_fetch_object(mysql_query("SELECT * FROM bj WHERE location='$fetch->location'")); if($ding_dong1->bjowner == "0" || $ding_dong1->bjowner == ""){ ?></p> <link rel=stylesheet href=style.css type=text/css> <form name="form1" method="post" action=""> <table width="40%" border="0" align="center" cellpadding="0" cellspacing="0" class="table"> <tr><td height="30" align="center" class="header">BlackJack Unowned - <a href='?price' class="hover" title="<center>To Purchase This BlackJack It Will Cost You £5,000,000!">Price?</a></td></tr> <tr > <td align="center">The BlackJack Located In <b><?php echo "$fetch->location"; ?></b> Are Not Owned By Anyone!<br /> <br /> <input name="buyrps" id="buyrps" type="submit" class="button" value="Purchase" /> <br /> <br /> <br /> <?php if($_POST['buyrps']){ if($fetch->money < 5000000){ echo "You have not got £5,000,000 to pay for the BlackJack."; }elseif($fetch->money > 5000000 && $ding_dong1->bjowner == "0"){ $moneyless = $sitestats->factoryprice; mysql_query("UPDATE users SET money=money-5000000 WHERE username='$username'"); mysql_query("UPDATE bj SET bjowner='$username' WHERE location='$fetch->location'"); echo "You now own the BlackJack located in $fetch->location."; }} ?> </td> </tr> </table> </form> <?php }else{ ?> <?php $time = time(); echo "$style"; ?> <? if($info->bettingban=='1'){ die("<center><h3><font colour='FFFFFF'>You Have Been Banned From This Page</h3></center>"); } $fetch=mysql_fetch_object(mysql_query("SELECT username,location FROM users WHERE username='$username'")); echo " <link href=style.css rel=stylesheet type=text/css> "; $username = $_SESSION['username']; $self = "blackjack.php"; //***get info $result = mysql_query("SELECT money, location FROM users WHERE username='$username'"); while ($info = mysql_fetch_row($result)) { $pmoney = $info[0]; $currentmoney = $info[0]; $state = $info[1]; $location= $info[1]; $bj = $info[2]; } ///// $ding_dong=mysql_fetch_object(mysql_query("SELECT bjowner FROM bj WHERE location ='$fetch->location'")); $ding_dong1=mysql_fetch_object(mysql_query("SELECT * FROM bj WHERE location ='$fetch->location'")); $fat_****=mysql_fetch_object(mysql_query("SELECT username,status FROM users WHERE username='$ding_dong->bjowner'")); ///// if($fat_****->status == 'Dead' || $fat_****->status == 'Banned'){ mysql_query("UPDATE bj SET bjowner='0' WHERE location='$location'"); print "<font color=white>This table has no owner!"; exit(); } if(!$_SESSION['con']){ $_SESSION['con']=$state; }elseif($_SESSION['con']!=$state){ echo "<center><font color=red><b>You flew and lost your cards!<BR>"; unset($_SESSION['deck'],$_SESSION['card1'],$_SESSION['color1'],$_SESSION['card2'],$_SESSION['card3'],$_SESSION['color3'],$_SESSION['card4'],$_SESSION['color4'],$_SESSION['card5'],$_SESSION['color5'],$_SESSION['card6'],$_SESSION['color6'],$_SESSION['dcard1'],$_SESSION['dcard2'],$_SESSION['dcard3'],$_SESSION['dcard4'],$_SESSION['con']); } $result = mysql_query("SELECT bjmaxbet, bjminbet, bjowner , bjearnings FROM bj WHERE location='$fetch->location'"); while ($info = mysql_fetch_row($result)) { $bjowner = $info[2]; $max = $info[0]; $earn = $info[3]; $bjmaxbet = $info[0]; $bjminbid = $info[1]; $totalearnings = $info[3]; $bjowner = $info[2]; } $result = mysql_query("SELECT id, money FROM users WHERE username='$bjowner'"); while ($info = mysql_fetch_row($result)) { $oid = $info[0]; $omoney = $info[1]; $otmoney = $info[1]; } if($bjowner == "None"){ echo "<font color=white>No owner"; exit(); } $offer = $_POST['offer']; $ownerstuff = mysql_query("SELECT money, id, status FROM users WHERE username='$bjowner'"); while($ownerstats = mysql_fetch_row($ownerstuff)){ $ownerscurrentmoney = $ownerstats[0]; $otmoney = $ownerstats[0]; $ownerid = $ownerstats[1]; $abd = $ownerstats[2]; } if($offer != ""){ if($offer < 0){ echo "<font color=white>You can't go below 0!"; } elseif($offer > 2147483647){ echo "<font color=white>Your offer is to high!"; } elseif(ereg("[^[:digit:]]", $offer)) { echo "<font color=white>Bad amount!"; } elseif($username == $bjowner){ echo "<font color=white>You can't make an offer to yourself!"; } elseif($offer > $currentmoney){ echo "<font color=white>You dont have that much money!"; } else { echo "You have made an offer to take over that blackjack!"; mysql_query("INSERT INTO `offers` ( `id` , `username` , `owner` , `offer` , `casino`, `location` ) VALUES ('', '$username', '$bjowner', '$offer', 'Blackjack', '$location');"); } } if($_POST['adeal']){ $yid = $_POST['yes']; $nid = $_POST['no']; if($yid != ""){ $ow = mysql_query("SELECT * FROM offers WHERE id='$yid'"); while($o = mysql_fetch_row($ow)){ $offerer = $o[1]; $bjowner = $o[2]; $moffer = $o[3]; $location = $o[5]; $casino = $o[4]; } $cost = mysql_query("SELECT money FROM users WHERE username='$offerer'"); while($money = mysql_fetch_row($cost)){ $oumoney = $money[0]; } if($oumoney < $moffer){ echo "<font color=white>That user no longer has enough money!"; } elseif($offerer == $username){ echo "<font color=white>You cant accept your own offer!"; } elseif($bjowner != $username){ echo "<font color=white>Thats not your blackjack!"; } else { mysql_query("UPDATE bj SET bjowner='$offerer' WHERE location='$location'"); $newownmoney = $currentmoney + $moffer; $newusemoney = $oumoney - $moffer; $message = "<font color=white>Your offer was <b>accepted</b> by <b>$bjowner</b> for the $location $casino for the price of $$moffer"; mysql_query("INSERT INTO `inbox` (`id`, `to`, `from`, `date`, `text`) VALUES ('', '$offerer', 'BlackJack Ownership', NOW(), '$message');"); mysql_query("UPDATE users SET money='$newownmoney' WHERE username='$username'"); mysql_query("UPDATE users SET money='$newusemoney' WHERE username='$offerer'"); mysql_query("DELETE FROM offers WHERE location='$location', bjmaxbet='100' AND casino='$casino'"); echo "<font color=white>You have accepted that offer!"; exit(); } } else { $ow = mysql_query("SELECT * FROM offers WHERE id='$nid'"); while($o = mysql_fetch_row($ow)){ $offerer = $o[1]; $bjowner = $o[2]; $moffer = $o[3]; $location = $o[5]; $casino = $o[4]; } $message = "Your offer was <b>declined</b> by <b>$bjowner</b> for $location $casino for the price of $$moffer"; mysql_query("INSERT INTO `inbox` (`id`, `to`, `from`, `date`, `text`) VALUES ('', '$offerer', 'Location Ownership', NOW(), '$message');"); mysql_query("DELETE FROM offers WHERE id='$nid'"); echo "<font color=white>You declined that offer!"; } } //see if person owns table if ($bjowner == $playersusername){ if ($_POST['newmaxbet']){ $newmaxbet = $_POST['newmaxbet']; if ($newmaxbet < 5000000){ echo "<center><font color=red><b>Max must be atleast £5,000,000 or above!"; //in exit(); }elseif ($newmaxbet > 10000000000){ echo "<center><font color=red><b>Max must be less then £10,000,000,000!"; //in exit(); }elseif(ereg("[^[:digit:]]", $newmaxbet)){ echo "<center><font color=white><b>Max bet must only contain numbers!"; //in exit(); }else{ mysql_query("UPDATE bj SET bjmaxbet='$newmaxbet' WHERE bjowner='$username' AND location='$location'"); echo "<center><font color=green><b>Your maxbet has been updated to £$newmaxbet"; } } if ($_POST['newminbid']){ $newminbid = $_POST['newminbid']; if ($newminbid < 100){ echo "<center><font color=red><b>Minimum bet must be atleast £100 or above!"; //in exit(); } if(ereg("[^[:digit:]]", $newminbid)){ echo "<font color=white>Minimum bet must only contain numbers!"; //in exit(); }elseif(!ereg("[^[:digit:]]", $newminbid)){ mysql_query("UPDATE bj SET bjminbet='$newminbid' WHERE bjowner='$username' AND location='$location'"); } echo "<center><font color=green><b>Minimum bet has been updated to £$newminbid!"; } if ($_POST['givetouser']){ $givetouser = $_POST['givetouser']; $checkgiveto = mysql_query("SELECT username FROM users WHERE username='$givetouser'"); $checkifexist = mysql_num_rows($checkgiveto); if($checkifexist <= 0){ echo "<center><font color=white><b>That user does not exist!"; //in exit(); }else{ while($giver = mysql_fetch_row($checkgiveto)){ $givetouser = $giver[0]; } $date = gmdate('Y-m-d h:i:s'); mysql_query("INSERT INTO `propsend` ( `id` , `type` , `location` , `usernamefrom` , `usernameto` , `date` ) VALUES ('', 'Blackjack', '$location', '$username', '$givetouser', '$date')"); mysql_query("UPDATE bj SET bjmaxbet='2500' WHERE bjowner='$username' AND location='$location'"); mysql_query("UPDATE bj SET bjowner='$givetouser' WHERE bjowner='$username' AND location='$location'"); echo "<center><font color=white><b>You gave $givetouser the Blackjack!"; } } if (strip_tags($_POST['drop']) == "Yes"){ mysql_query("UPDATE bj SET bjmaxbet='2500' WHERE bjowner='$username' AND location='$location'"); mysql_query("UPDATE bj SET bjowner='0', bjearnings='0' WHERE bjowner='$username' AND location='$location'"); echo"Dropped!"; exit(); } echo "<form method=post action=$self> <table width=300 align=center border=0 cellpadding=0 cellspacing=0 class=table> <tr class=header> <td colspan=4> Blackjack CP</td> </tr> <tr> <td width=130>Total Earnings: </td> <td width=148 colspan=3>£"; echo number_format($totalearnings); echo "</td> </tr> <tr> <td>Max Bet: </td> <td width=148 colspan=3><input name=newmaxbet type=text id=maxbet class=textbox1></td> </tr> <tr> <td>Current Max: </td> <td colspan=3>£"; echo number_format($bjmaxbet); echo "</td> </tr> <tr> <td>Drop:</td> <td><select name=drop id=drop class=\"textbox1\" style=\"width: 60px;\"> <option value=\"No\">No</option> <option value=\"Yes\">Yes</option> </select></td> </tr> <tr> <td>Give to: </td> <td colspan=3><input name=givetouser type=text id=giveto class=textbox1></td> </tr> <tr> <td> </td> <td colspan=4 align=center><input type=submit name=Submit value=Update class=button></td> </tr> </table><br> </form> "; //in exit(); } $suc = 1; if (isset($_POST['bett'])){ $bettt = strip_tags($_POST['bett']); $now = $bj + 60; if(time() < $now){ echo "<font color=white>You started a blackjack game and never finished you must wait a minuite to start another!"; exit(); }elseif(ereg("[^[:digit:]]", $bettt)) { echo "<font color=white>Bet amount can only contain numbers!"; $suc = 2; unset($_SESSION['bet']); }elseif($bettt > $pmoney){ echo "<font color=white>You dont have enough money!"; $suc = 2; unset($_SESSION['bet']); }elseif($bettt > 1000000000){ echo "<font color=white>Maximum is 1 billion!"; exit(); }elseif($bettt > $max) { echo "<font color=white>The current max is £$max!"; $suc = 2; unset($_SESSION['bet']); }else{ $_SESSION['bet'] = $bettt; $money = $pmoney - $bettt; mysql_query("UPDATE users SET money='$money', bj='$time' WHERE username='$username'"); $_SESSION['show'] = "show me"; unset($_SESSION['deck'],$_SESSION['card1'],$_SESSION['color1'],$_SESSION['card2'],$_SESSION['card3'],$_SESSION['color3'],$_SESSION['card4'],$_SESSION['color4'],$_SESSION['card5'],$_SESSION['color5'],$_SESSION['card6'],$_SESSION['color6'],$_SESSION['dcard1'],$_SESSION['dcard2'],$_SESSION['dcard3'],$_SESSION['dcard4']); } } $bet = $_SESSION['bet']; //****check if they want to hit if ((isset($_POST['hit'])) && (!isset($_POST['stand'])) && (isset($_SESSION['bet']))){ $deckk = $_SESSION['deck']; if (isset($_SESSION['card6'])){ }else{ $ex = "6"; } if (isset($_SESSION['card5'])){ }else{ $ex = "5"; } if (isset($_SESSION['card4'])){ }else{ $ex = "4"; } if (isset($_SESSION['card3'])){ }else{ $ex = "3"; } if ($ex == 3){ $card3 = explode("-", $deckk[2]); $color3 = $card3[1]; $card3 = $card3[0]; if ($color3 == "h"){$color3 = 'heart';} if ($color3 == "d"){$color3 = 'diamond';} if ($color3 == "s"){$color3 = 'spade';} if ($color3 == "c"){$color3 = 'club';} $_SESSION['card3'] = $card3; $_SESSION['color3'] = $color3; } if ($ex == 4){ $card4 = explode("-", $deckk[3]); $color4 = $card4[1]; $card4 = $card4[0]; if ($color4 == "h"){$color4 = 'heart';} if ($color4 == "d"){$color4 = 'diamond';} if ($color4 == "c"){$color4 = 'club';} if ($color4 == "s"){$color4 = 'spade';} $_SESSION['card4'] = $card4; $_SESSION['color4'] = $color4; } if ($ex == 5){ $card5 = explode("-", $deckk[4]); $color5 = $card5[1]; $card5 = $card5[0]; if ($color5 == "h"){$color5 = 'heart';} if ($color5 == "d"){$color5 = 'diamond';} if ($color5 == "c"){$color5 = 'club';} if ($color5 == "s"){$color5 = 'spade';} $_SESSION['card5'] = $card5; $_SESSION['color5'] = $color5; } if ($ex == 6){ $card6 = explode("-", $deckk[5]); $color6 = $card6[1]; $card6 = $card6[0]; if ($color6 == "h"){$color6 = 'heart';} if ($color6 == "d"){$color6 = 'diamond';} if ($color6 == "c"){$color6 = 'club';} if ($color6 == "s"){$color6 = 'spade';} $_SESSION['card6'] = $card6; $_SESSION['color6'] = $color6; } } //*****see if they stand if ((isset($_POST['stand'])) && (!isset($_POST['hit'])) && (isset($_SESSION['bet']))){ $bet = $_SESSION['bet']; $dcardd1 = $_SESSION['dcard1']; $dcardd2 = $_SESSION['dcard2']; if (($dcardd1 == 13) || ($dcardd1 == 12) || ($dcardd1 == 11)){ $dcardd1 = 10; } if ($dcardd1 == 14){ $dcardd1 = 11; } if (($dcardd2 == 13) || ($dcardd2 == 12) || ($dcardd2 == 11)){ $dcardd2 = 10; } if ($dcardd2 == 14){ $dcardd2 = 11; } $dtotal = $dcardd1 + $dcardd2; if (($dtotal > 21) && ($dcardd1 == 11)){ $dcardd1 = 1; $dtotal = $dtotal - 11; $dtotal = $dtotal + $dcardd1; } if (($dtotal > 21) && ($dcardd2 == 11)){ $dcardd2 = 1; $dtotal = $dtotal - 11; $dtotal = $dtotal + $dcardd2; } $dtotal = $dcardd1 + $dcardd2; if ($dtotal <= 16){ $deckk = $_SESSION['deck']; $dcard3 = explode("-", $deckk[49]); $dcolor3 = $dcard3[1]; $dcard3 = $dcard3[0]; if ($dcolor3 == "h"){$dcolor3 = 'heart';} if ($dcolor3 == "d"){$dcolor3 = 'diamond';} if ($dcolor3 == "c"){$dcolor3 = 'club';} if ($dcolor3 == "s"){$dcolor3 = 'spade';} $_SESSION['dcard3'] = $dcard3; $_SESSION['dcolor3'] = $dcolor3; $dcardd3 = $dcard3; if (($dcardd3 == 13) OR ($dcardd3 == 12) OR ($dcardd3 == 11)){ $dcardd3 = 10; } if ($dcardd3 == 14){ $dcardd3 = 11; } $dtotal = $dtotal + $dcardd3; if (($dtotal > 21) && ($dcardd3 == 11)){ $dcardd3 = 1; $dtotal = $dtotal - 11; $dtotal = $dtotal + $dcardd3; } } if (($dtotal <= 16) && (isset($_SESSION['dcard3']))){ $deckk = $_SESSION['deck']; $dcard4 = explode("-", $deckk[48]); $dcolor4 = $dcard4[1]; $dcard4 = $dcard4[0]; if ($dcolor4 == "h"){$dcolor4 = 'heart';} if ($dcolor4 == "d"){$dcolor4 = 'diamond';} if ($dcolor4 == "c"){$dcolor4 = 'club';} if ($dcolor4 == "s"){$dcolor4 = 'spade';} $_SESSION['dcard4'] = $dcard4; $_SESSION['dcolor4'] = $dcolor4; $dcardd4 = $dcard4; if (($dcardd4 == 13) OR ($dcardd4 == 12) OR ($dcardd4 == 11)){ $dcardd4 = 10; } if ($dcardd4 == 14){ $dcardd4 = 11; } $dtotal = $dtotal + $dcardd4; if (($dtotal > 21) && ($cardd4 == 11)){ $dcardd4 = 1; $dtotal = $dtotal - 11; $dtotal = $dtotal + $dcardd4; } } $cardd1 = $_SESSION['card1']; $cardd2 = $_SESSION['card2']; $cardd3 = $_SESSION['card3']; $cardd4 = $_SESSION['card4']; $cardd5 = $_SESSION['card5']; $cardd6 = $_SESSION['card6']; if (($cardd1 == 13) || ($cardd1 == 12) || ($cardd1 == 11)){ $cardd1 = 10; } if ($cardd1 == 14){ $cardd1 = 11; } if (($cardd2 == 13) || ($cardd2 == 12) || ($cardd2 == 11)){ $cardd2 = 10; } if ($cardd2 == 14){ $cardd2 = 11; } if (isset($_SESSION['card3'])){ if (($cardd3 == 13) || ($cardd3 == 12) || ($cardd3 == 11)){ $cardd3 = 10; } if ($cardd3 == 14){ $cardd3 = 11; } } if (isset($_SESSION['card4'])){ if (($cardd4 == 13) || ($cardd4 == 12) || ($cardd4 == 11)){ $cardd4 = 10; } if ($cardd4 == 14){ $cardd4 = 11; } } if (isset($_SESSION['card5'])){ if (($cardd5 == 13) || ($cardd5 == 12) || ($cardd5 == 11)){ $cardd5 = 10; } if ($cardd5 == 14){ $cardd5 = 11; } } if (isset($_SESSION['card6'])){ if (($cardd6 == 13) || ($cardd6 == 12) || ($cardd6 == 11)){ $cardd6 = 10; } if ($cardd6 == 14){ $cardd6 = 11; } } $total = $cardd1 + $cardd2; if (isset($_SESSION['card3'])){ $total = $total + $cardd3; } if (isset($_SESSION['card4'])){ $total = $total + $cardd4; } if (isset($_SESSION['card5'])){ $total = $total + $cardd5; } if (isset($_SESSION['card6'])){ $total = $total + $cardd6; } if (($total > 21) && ($cardd1 == 11)){ $cardd1 = 1; $total = $total - 11; $total = $total + $cardd1; } if (($total > 21) && ($cardd2 == 11)){ $cardd2 = 1; $total = $total - 11; $total = $total + $cardd2; } if (($total > 21) && ($cardd3 == 11)){ $cardd3 = 1; $total = $total - 11; $total = $total + $cardd3; } if (($total > 21) && ($cardd4 == 11)){ $cardd4 = 1; $total = $total - 11; $total = $total + $cardd4; } if (($total > 21) && ($cardd5 == 11)){ $cardd5 = 1; $total = $total - 11; $total = $total + $cardd5; } if (($total > 21) && ($cardd6 == 11)){ $cardd6 = 1; $total = $total - 11; $total = $total + $cardd6; } if (($dtotal > 21) && (isset($_SESSION['bet']))){ $hahahaha1=$bet; echo "<center><font color=green><b>The dealer has bust. You won £$hahahaha1."; $won = $bet; $newmoney = $omoney - $won; $ws = "win"; if($newmoney <= 0){ $bet = $bet; mysql_query("UPDATE bj SET bjowner='$username', bjearnings='0', bjmaxbet='2000' WHERE bjowner='$bjowner' AND location='$location'"); mysql_query("UPDATE users SET money='$otmoney' WHERE username='$bjowner'"); mysql_query("UPDATE bj SET bjowner='$username', bjearnings='0', bjmaxbet='2000' WHERE bjowner='$bjowner' AND location='$location'"); echo "<font color=white>You tookover the table"; die(); }else{ $money = $won + $pmoney; mysql_query("UPDATE users SET money='$money' WHERE username='$username'"); mysql_query("UPDATE users SET bjwins=bjwins+1 WHERE username='$username'"); $total = $earn - $won; mysql_query("INSERT INTO `betlogs` (`id`, `username`, `money`, `end`, `owner`, `type`, `moneyuse`) VALUES ('', '$username', '$currentmoney', '$end', '$bjowner', 'bj', '$bettt');"); mysql_query("UPDATE bj SET bjearnings='$total' WHERE bjowner='$bjowner'"); $newmoney = $omoney - $won; mysql_query("UPDATE users SET money='$newmoney' WHERE username='$bjowner'"); mysql_query("UPDATE users SET bj='0' WHERE username='$username'"); unset($_SESSION['deck'],$_SESSION['bet']); } $_SESSION['show'] = "show them"; } $phow = 21 - $total; $dhow = 21 - $dtotal; if (($phow > $dhow) && (isset($_SESSION['bet']))){ echo "<center><font color=red><b>You had $total and the dealer had $dtotal you lost £$bet!"; $total = $earn + $bet; $ws = "lost"; mysql_query("UPDATE bj SET bjearnings='$total' WHERE bjowner='$bjowner'"); $newmoney = $omoney + $bet; mysql_query("UPDATE users SET money='$newmoney' WHERE username='$bjowner'"); $start = $pmoney; $end = $pmoney-$bet; mysql_query("UPDATE users SET money='$end' WHERE username='$username'"); unset($_SESSION['deck'],$_SESSION['bet']); $_SESSION['show'] = "show them"; } if (($phow < $dhow) && (isset($_SESSION['bet']))){ $eatshit=$bet; echo "<center><font color=green><b>You had $total and the dealer had $dtotal you won £$eatshit!"; $won = $bet; $newmoney = $omoney - $won; $ws = "win"; if($newmoney <= 0){ $bet = $bet; mysql_query("UPDATE bj SET bjowner='$username',bjearnings='0',bjmaxbet='2000' WHERE bjowner='$bjowner' AND location='$location'"); mysql_query("UPDATE users SET money='$otmoney' WHERE username='$bjowner'"); mysql_query("UPDATE users SET money=money+bet WHERE username='$username'"); echo "<center><font color=green><b>The owner has no money left so you tookover the table!"; }else{ $money = ($won) + $pmoney; mysql_query("UPDATE users SET money='$money' WHERE username='$username'"); mysql_query("UPDATE users SET bjwins=bjwins+1 WHERE username='$username'"); $total = $earn - $won; mysql_query("UPDATE bj SET bjearnings='$total' WHERE bjowner='$bjowner'"); $newmoney = $omoney - $won; mysql_query("UPDATE users SET money='$newmoney' WHERE username='$bjowner'"); mysql_query("UPDATE users SET bj='0' WHERE username='$username'"); unset($_SESSION['deck'],$_SESSION['bet']); } $_SESSION['show'] = "show them"; } if (($phow == $dhow) && ($bet)){ $bet = $bet; echo "<center><font color=white><b>It was a push both you and dealer had same amount!"; mysql_query("UPDATE users SET money=money+$bet, bj='0' WHERE username='$username'"); unset($_SESSION['deck'],$_SESSION['bet']); $_SESSION['show'] = "show them"; } } if ((!isset($_SESSION['card1'])) && (isset($_SESSION['bet']))){ $bet = $_SESSION['bet']; //*********get cards //make a deck $cards = array("14-h", "14-c", "14-d", "14-s", "2-h", "2-c", "2-d", "2-s", "3-h", "3-c", "3-d", "3-s", "4-h", "4-c", "4-d", "4-s", "5-h", "5-c", "5-d", "5-s", "6-h", "6-c", "6-d", "6-s", "7-h", "7-c", "7-d", "7-s", "8-h", "8-c", "8-d", "8-s", "9-h", "9-c", "9-d", "9-s", "10-h", "10-c", "10-d", "10-s", "11-h", "11-c", "11-d", "11-s", "12-h", "12-c", "12-d", "12-s", "13-h", "13-c", "13-d", "13-s"); //shuffle for($i = 0; $i < 52; $i++){ $count = count($cards); $random = (rand()%$count); if($cards[$random] == "") { $i--; } else{ $deck[] = $cards[$random]; $cards[$random] = ""; } } $_SESSION['deck'] = $deck; $carrd1 = explode("-", $deck[0]); $card1 = $carrd1[0]; $color1 = $carrd1[1]; $carrd2 = explode("-", $deck[1]); $card2 = $carrd2[0]; $color2 = $carrd2[1]; if ($color1 == "h"){$color1 = 'heart';} if ($color1 == "d"){$color1 = 'diamond';} if ($color1 == "c"){$color1 = 'club';} if ($color1 == "s"){$color1 = 'spade';} $_SESSION['card1'] = $card1; $_SESSION['color1'] = $color1; //second card if ($color2 == "h"){$color2 = 'heart';} if ($color2 == "d"){$color2 = 'diamond';} if ($color2 == "c"){$color2 = 'club';} if ($color2 == "s"){$color2 = 'spade';} $_SESSION['card2'] = $card2; $_SESSION['color2'] = $color2; //get dealer cards $dcarrd1 = explode("-", $deck[50]); $dcard1 = $dcarrd1[0]; $dcolor1 = $dcarrd1[1]; $dcarrd2 = explode("-", $deck[51]); $dcard2 = $dcarrd2[0]; $dcolor2 = $dcarrd2[1]; if ($dcolor1 == "h"){$dcolor1 = 'heart';} if ($dcolor1 == "d"){$dcolor1 = 'diamond';} if ($dcolor1 == "c"){$dcolor1 = 'club';} if ($dcolor1 == "s"){$dcolor1 = 'spade';} $_SESSION['dcard1'] = $dcard1; $_SESSION['dcolor1'] = $dcolor1; //second card if ($dcolor2 == "h"){$dcolor2 = 'heart';} if ($dcolor2 == "d"){$dcolor2 = 'diamond';} if ($dcolor2 == "c"){$dcolor2 = 'club';} if ($dcolor2 == "s"){$dcolor2 = 'spade';} $_SESSION['dcard2'] = $dcard2; $_SESSION['dcolor2'] = $dcolor2; } //calcualte cards total to see if they have Blackjack or have bust if (isset($_SESSION['card1'])){ $cardd1 = $_SESSION['card1']; $cardd2 = $_SESSION['card2']; $cardd3 = $_SESSION['card3']; $cardd4 = $_SESSION['card4']; $cardd5 = $_SESSION['card5']; $cardd6 = $_SESSION['card6']; if (($cardd1 == 13) || ($cardd1 == 12) || ($cardd1 == 11)){ $cardd1 = 10; } if ($cardd1 == 14){ $cardd1 = 11; } if (($cardd2 == 13) OR ($cardd2 == 12) OR ($cardd2 == 11)){ $cardd2 = 10; } if ($cardd2 == 14){ $cardd2 = 11; } if (isset($_SESSION['card3'])){ if (($cardd3 == 13) OR ($cardd3 == 12) OR ($cardd3 == 11)){ $cardd3 = 10; } if ($cardd3 == 14){ $cardd3 = 11; } } if (isset($_SESSION['card4'])){ if (($cardd4 == 13) OR ($cardd4 == 12) OR ($cardd4 == 11)){ $cardd4 = 10; } if ($cardd4 == 14){ $cardd4 = 11; } } if (isset($_SESSION['card5'])){ if (($cardd5 == 13) OR ($cardd5 == 12) OR ($cardd5 == 11)){ $cardd5 = 10; } if ($cardd5 == 14){ $cardd5 = 11; } } if (isset($_SESSION['card6'])){ if (($cardd6 == 13) OR ($cardd6 == 12) OR ($cardd6 == 11)){ $cardd6 = 10; } if ($cardd6 == 14){ $cardd6 = 11; } } $total = $cardd1 + $cardd2; if (isset($_SESSION['card3'])){ $total = $total + $cardd3; } if (isset($_SESSION['card4'])){ $total = $total + $cardd4; } if (isset($_SESSION['card5'])){ $total = $total + $cardd5; } if (isset($_SESSION['card6'])){ $total = $total + $cardd6; } if (($total > 21) && ($cardd1 == 11)){ $cardd1 = 1; $total = $total - 11; $total = $total + $cardd1; } if (($total > 21) && ($cardd2 == 11)){ $cardd2 = 1; $total = $total - 11; $total = $total + $cardd2; } if (($total > 21) && ($cardd3 == 11)){ $cardd3 = 1; $total = $total - 11; $total = $total + $cardd3; } if (($total > 21) && ($cardd4 == 11)){ $cardd4 = 1; $total = $total - 11; $total = $total + $cardd4; } if (($total > 21) && ($cardd5 == 11)){ $cardd5 = 1; $total = $total - 11; $total = $total + $cardd5; } if (($total > 21) && ($cardd6 == 11)){ $cardd6 = 1; $total = $total - 11; $total = $total + $cardd6; } if (($total == "21") && (!isset($_SESSION['card3'])) && (isset($_SESSION['bet']))){ $bj = ($bet)/2; $won=$bet+$bj; $newmoney = $omoney - $won; $ws = "bj"; if($newmoney <= 0){ $bet = $bet; mysql_query("UPDATE bj SET bjowner='$username',bjearnings='0',bjmaxbet='2000' WHERE bjowner='$bjowner' AND location='$location'"); mysql_query("UPDATE users SET money='$otmoney' WHERE username='$bjowner'"); mysql_query("UPDATE users SET money=money+$bet WHERE username='$username'"); echo "<font color=white>You tookover the table"; }else{ echo "<center><font color=green><b>You got 21 and won £$won "; $money = ($won) + $pmoney; mysql_query("UPDATE users SET money='$money' WHERE username='$username'"); mysql_query("UPDATE users SET bjwins=bjwins+1 WHERE username='$username'"); $total = $earn - $won; mysql_query("UPDATE bj SET bjearnings='$total' WHERE bjowner='$bjowner'"); $newmoney = $omoney - $won; mysql_query("UPDATE users SET money='$newmoney' WHERE username='$bjowner'"); mysql_query("UPDATE users SET bj='0' WHERE username='$username'"); $_SESSION['show'] = "show them"; unset($_SESSION['deck'],$_SESSION['bet']); } $_SESSION['show'] = "show them"; } if (($total > "21" ) && (isset($_SESSION['bet']))){ $lost = $bet; $ws = "lost"; echo "<center><font color=red><b>You had $total. You bust and lost £$lost. "; $total = $earn + $lost; mysql_query("UPDATE bj SET bjearnings='$total' WHERE bjowner='$bjowner'"); $newmoney = $omoney + $lost; mysql_query("UPDATE users SET money='$newmoney' WHERE username='$bjowner'"); $start = $pmoney; $end = $pmoney-$bet; mysql_query("UPDATE users SET money='$end' WHERE username='$username'"); $_SESSION['show'] = "show them"; unset($_SESSION['deck'],$_SESSION['bet']); $_SESSION['show'] = "show them"; } } if($ws == "lost"){ $start = $pmoney; $end = $pmoney-$bet; mysql_query("INSERT INTO `betlogs` (`id`, `username`, `money`, `end`, `owner`, `type`) VALUES ('', '$username', '$start', '$end', '$bjowner', 'bj');"); }elseif($ws == "win"){ $start = $pmoney; $end = $pmoney+($bet); mysql_query("INSERT INTO `betlogs` (`id`, `username`, `money`, `end`, `owner`, `type`) VALUES ('', '$username', '$start', '$end', '$bjowner', 'bj');"); }elseif($ws == "bj"){ $start = $pmoney; $end = $pmoney+($bet)+($bet/2); mysql_query("INSERT INTO `betlogs` (`id`, `username`, `money`, `end`, `owner`, `type`) VALUES ('', '$username', '$start', '$end', '$bjowner', 'bj');"); } if (!isset($_SESSION['bet'])){ echo " <center> <form name=form3 method=post action=$self> <br> <table width=270 align=center cellspacing=0 cellpadding=0 class=table> <tr><td class=header colspan=4>Blackjack</td></tr> <tr> <td colspan=3 align=center>Place Your Bet:</td> <td><input type=text name=bett class=textbox1></td> </tr> <tr> <td colspan=3 align=left> </td> <td align=left><input type=submit class=button name=Submit value=Bet></td> </tr> </table></form><br> <table width=25% align=center border=0 cellspacing=0 cellpadding=0 class=table> <tr> <td align=center class='header' colspan=4>Blackjack Stats</td></tr> <tr><td align=center>"; if ($bjowner == "0"){ echo "This Blackjack table is not owned by anyone<br>The max bet is set at £".makecomma($bjmaxbet).""; }else{ echo "This Blackjack table is owned by <a href='profile.php?viewuser=$bjowner'><b>$bjowner</b></a><br>The max bet is set at £".makecomma($bjmaxbet).""; } echo"</td></tr></table>"; include_once"footer_bottom.php"; die(); } else { echo " "; } if ((isset($_SESSION['dcard1'])) && (isset($_SESSION['show']))){ ?> <br> <table width=600 align=center cellspacing=0 cellpadding=0 class=table> <tr><td class=header colspan=11>Blackjack</td></tr> <tr width=600> <td width="50%" valign=top> <center> <b>Dealers Cards</b><br><br> <img src="images/cards/<?php if ((isset($_SESSION['dcard1'])) && (isset($_SESSION['show']))){ echo $_SESSION['dcolor1']; }else{ echo "cardback";} echo "/"; if ((isset($_SESSION['dcard1'])) && (isset($_SESSION['show']))) { echo $_SESSION['dcard1']; }else{ echo "cardback";}?>.gif" width="93" height="120"> <img src=images/cards/<?php if ((isset($_SESSION['dcard2'])) && (isset($_POST['stand'])) && (isset($_SESSION['show']))) { echo $_SESSION['dcolor2']; }else{ echo "cardback"; } echo "/"; if ((isset($_SESSION['dcard2'])) && (isset($_POST['stand'])) && (isset($_SESSION['show']))) { echo $_SESSION['dcard2']; }else{ echo "cardback";} ?>.gif width="93" height="120"> <?php if ((isset($_SESSION['dcard3'])) && (isset($_POST['stand'])) && (isset($_SESSION['show']))) { echo "<img src=images/cards/"; echo $_SESSION['dcolor3']; echo "/"; echo $_SESSION['dcard3']; echo ".gif width=71 height=96>"; echo " "; } if ((isset($_SESSION['dcard4'])) && (isset($_POST['stand'])) && (isset($_SESSION['show']))) { echo "<img src=images/cards/"; echo $_SESSION['dcolor4']; echo "/"; echo $_SESSION['dcard4']; echo ".gif width=71 height=96>"; echo " "; }?></span> </div> </td> <td colspan=10 valign=top> <center> <b>Your Cards <? if ($_SESSION['bet']){ echo "- You have $total"; } ?></b><br> <br> <img src="images/cards/<?php if ((isset($_SESSION['card1'])) && (isset($_SESSION['show']))) { echo $_SESSION['color1']; }else{ echo "cardback";} echo "/"; if ((isset($_SESSION['card1'])) && (isset($_SESSION['show']))) { echo $_SESSION['card1']; }else{ echo "cardback";}?>.gif" width="93" height="120"> <img src="images/cards/<?php if ((isset($_SESSION['card2'])) && (isset($_SESSION['show']))) { echo $_SESSION['color2']; }else{ echo "cardback";} ?>/<?php if ((isset($_SESSION['card2'])) && (isset($_SESSION['show']))){ echo $_SESSION['card2']; }else{ echo "cardback"; }?>.gif" width="93" height="120"> <?php if ((isset($_SESSION['card3'])) && (isset($_SESSION['show']))) { echo "<img src=images/cards/"; echo $_SESSION['color3']; echo "/"; echo $_SESSION['card3']; echo ".gif width=93 height=120>"; echo " "; } if (isset($_SESSION['card4'])) { echo "<img src=images/cards/"; echo $_SESSION['color4']; echo "/"; echo $_SESSION['card4']; echo ".gif width=93 height=120>"; echo " "; } if (isset($_SESSION['card5'])) { echo "<img src=images/cards/"; echo $_SESSION['color5']; echo "/"; echo $_SESSION['card5']; echo ".gif width=93 height=120>"; echo " "; } if (isset($_SESSION['card6'])) { echo "<img src=images/cards/"; echo $_SESSION['color6']; echo "/"; echo $_SESSION['card6']; echo ".gif width=93 height=120></div></td>"; echo " "; }?> </div><br></td> </tr> <tr class=text> <td width=50% align=center> <form name="form2" method="post" action="<?php $_SERVER['PHP_SELF'] ?>"> <div align="right"> <br> <input type="submit" class="button" name="submit" value=" Hit "> <input name="hit" type="hidden" value="you hit"> </div> </form></td><td width=50% colspan=10> <form name="form4" method="post" action="<?php $_SERVER['PHP_SELF'] ?>"> <br><input type="submit" class="button" name="submit2" value="Stand" /> <input name="stand" type="hidden" value="you stand" /> </form> <?php } if (!isset($_SESSION['bet'])){ echo" <SCRIPT LANGUAGE=JavaScript> document.form2.submit.disabled=true; document.form4.submit2.disabled=true; </script>"; }?> </td> </tr> </table> </table> <br> <table width="25%" align="center" border="0" cellpadding="0" cellspacing="0" class="table"> <tr class="thinline"> <td class='header'>Blackjack Stats</td> </tr><tr><td align=center> <?php if ($bjowner == "0"){ echo "This Blackjack table is not owned by anyone<br>The max bet is set at £".makecomma($bjmaxbet).""; }else{ echo "This Blackjack table is owned by <a href='profile.php?viewuser=$bjowner'><b>$bjowner</b></a><br>The max bet is set at £".makecomma($bjmaxbet).""; } ?></td></tr></table> <? include_once"footer_bottom.php"; ?> </body> </html> <? } ?>
-
Do You ???????????????
-
when i buy a keycode( with my credit to test ) i input the code but nothing happen i get no credit gain also the bit at the bottom might be the problem <? session_start(); include_once "includes/db_connect.php"; include_once"includes/functions.php"; logincheck(); $username=$_SESSION['username']; $query=mysql_query("SELECT * FROM users WHERE username='$username'"); $fetch=mysql_fetch_object($query); $query1=mysql_query("SELECT * FROM user_info WHERE username='$username'"); $user=mysql_fetch_object($query1); $creds=strip_tags($_GET['creds']); ?> <html> <head> <title>Game Name ®</title> <script language=JavaScript> <!-- //Disable right click script III- By Renigade ([email protected]) //For full source code, visit http://www.dynamicdrive.com var message=''; /////////////////////////////////// function clickIE() {if (document.all) {(message);return false;}} function clickNS(e) {if (document.layers||(document.getElementById&&!document.all)) { if (e.which==2||e.which==3) {(message);return false;}}} if (document.layers) {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;} else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;} document.oncontextmenu=new Function('return false') // --> </script> <link rel="shortcut icon" href="favicon.png"> <link href="style.css" rel="stylesheet" type="text/css"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <table width="350" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="" class="table"> <tr><td align=center>Please note when you are <b>CLAIMING</b> credits that the URL <b>MUST</b> be <b>url here</b> thank you!<br><br><font color=red>You Buy Credits At Your Own Risk, We Stand On A Non Refundable Policy!</font> </td></tr></table><br> <table width="350" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="" class="table"> <tr><td class="header" colspan="5">Buying Credits - Mobile & Home Phone</td> </tr> <tr class="subhead"><td class="tableborder" align="center" ><u>Cost</u></td> <td class="tableborder" align="center" ><u>Amount</u></td> <td class="tableborder" align="center" ><u>Text</u></td> <td width="20%" align="center" class="tableborder" ><u>Claim</u></td> </tr> <tr><td width="14%" align="center" class="tableborder">£1.50</div></td> <td width="14%" align="center" class="tableborder">120</td> <td width="27%" align="center" class="tableborder">GL pay to 87070</td> <td width="20%" align="center" class="tableborder"><a href="?creds=120">Claim!</a></td> </tr> <tr><td width="14%" align="center" class="tableborder">£3.00</div></td> <td width="14%" align="center" class="tableborder">250</td> <td width="27%" align="center" class="tableborder">GL prem to 87070</td> <td width="20%" align="center" class="tableborder"><a href="?creds=250">Claim!</a></td> </tr> <tr><td width="14%" align="center" class="tableborder">£4.50</div></td> <td width="14%" align="center" class="tableborder">420</td> <td width="27%" align="center" class="tableborder">GL token to 87070</td> <td width="20%" align="center" class="tableborder"><a href="?creds=420">Claim!</a></td> </tr> <tr><td width="14%" align="center" class="tableborder">£6.00</div></td> <td width="14%" align="center" class="tableborder">670</td> <td width="27%" align="center" class="tableborder">GL bonus to 87070</td> <td width="20%" align="center" class="tableborder"><a href="?creds=670">Claim!</a></td> </tr> <tr><td width="14%" align="center" class="tableborder">£7.50</div></td> <td width="14%" align="center" class="tableborder">830</td> <td width="27%" align="center" class="tableborder">GL cool to 87070</td> <td width="20%" align="center" class="tableborder"><a href="?creds=830">Claim!</a></td> </tr> <tr><td width="14%" align="center" class="tableborder">£9.00</div></td> <td width="14%" align="center" class="tableborder">900</td> <td width="27%" align="center" class="tableborder">GL shot to 87070</td> <td width="20%" align="center" class="tableborder"><a href="?creds=900">Claim!</a></td> </tr> </table> <? if ($fetch->pban == "0"){ ?> <br> <br> <table width="25%" border="0" align="center" cellpadding="3" cellspacing="1" bordercolor="#000000" class="table"> <tr> <td colspan=2 class="header">Donate by Paypal </center></td> </tr> <tr> <td align="center" ><form action="https://www.paypal.com/cgi-bin/webscr" method="post" target=_blank> <center> <select name=amount class=textinput> <option value=5.00 >£5.00 - 480 Credits</option> <option value=10.00 >£10.00 - 1,200 Credits</option> <option value=15.00 >£15.00 - 1,920 Credits</option> <option value=20.00 >£20.00 - 2,520 Credits</option> <option value=25.00 >£25.50 - 3,300 Credits</option> <option value=30.00 >£30.00 - 4,200 Credits</option> <option value=100.00 >£100.00 - 16,800 Credits</option> </select> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="currency_code" value="GBP"> <input type="hidden" name="business" value="email here"> <input type="hidden" name="item_name" value="Game Name - Donation"> <input type="submit" class="button" border="0" value="Continue" onClick="confirmbuy()" name="submit" alt="Click To Redeem Your Points"> </center> </form></td> </tr> </table><? } ?><br> <?php if ($creds == "120"){ $id = "12640"; } if ($creds == "250"){ $id = "12641"; } if ($creds == "420"){ $id = "12642"; } if ($creds == "670"){ $id = "12643"; } if ($creds == "830"){ $id = "12644"; } if ($creds == "900"){ $id = "12645"; } if ($creds != ""){ ?> <form name="glform" method="post" action="http://www.glpayment.co.uk/glpay0205/Auth_Standard.php"> <table align="center" class="table" width="20%" cellpadding="3" cellspacing="1" border="0"> <tr><td class="header">Claim Credits - Keycodes</td></tr> <tr><td align="center" class="tableborder" > Keycode: <input type="text" class="textinput" name="number"><br><br> <input type="submit" class="button" value="Submit Keycode"> <input type="hidden" name="ddi_id" value="<? echo "$id"; ?>"> </td></tr> </table> </form> <br><br> <? } if ($_GET[payment] != ""){ if($_GET[payment] == "true" && $_POST[price] && $_POST[Password] == "BLANK" && $_POST[CovNum]) { $query = mysql_query("SELECT keycode FROM payments WHERE keycode='$_POST[CovNum]'"); $rows = mysql_num_rows($query); if($rows == 0) { if($_POST[price] == "1.50"){ $credgain = "120"; } elseif($_POST[price] == "3.00"){ $credgain = "250"; } elseif($_POST[price] == "4.50"){ $credgain = "420"; } elseif($_POST[price] == "6.00"){ $credgain = "670"; } elseif($_POST[price] == "7.50"){ $credgain = "830"; } elseif($_POST[price] == "9.00"){ $credgain = "900"; } mysql_query("UPDATE users SET points=points+$credgain WHERE username='$username'"); mysql_query("UPDATE users SET donate='Yes' WHERE username='$username'"); mysql_query("INSERT INTO payments SET username='$username', keycode='$_POST[CovNum]', date=NOW(''), creds='$credgain'"); echo "<div class=success>Thanks for donating $credgain credits have been added to your account $username<br><br>"; }else{ echo "<center><font color=red><b>The keycode entered has been used before.<br><br>"; } }else{ echo "<center><font color=red><b>This keycode has been used before or is invalid.<br><br>"; }} ?> <br> Does this look right also if($_GET[payment] == "true" && $_POST[price] && $_POST[Password] == "i think my pass here" && $_POST[CovNum]) { $query = mysql_query("SELECT keycode FROM payments WHERE keycode='$_POST[CovNum]'"); $rows = mysql_num_rows($query); where it says my pass here does that have to me my msql password or my glpay one
-
thats sorted that but it then i cant buy a weapon and it doesnt come up wit that error message
-
Hi Every one this is a bodygaurd feature for my game which i created in notepad ++ small problem when i upload it to my server and test it all i get is a error code ( Parse error: syntax error, unexpected '{', expecting '(' in /home/********/public_html/v2/body.php on line 212 ) couple of line im not sure on too is line:211 i think i need to put echo instead of print but im sure one of you will tell me looking for guidence lines 197-217 is the recent work that throws the error <?php include_once "includes/db_connect.php"; include_once "includes/functions.php"; logincheck(); $username = $_SESSION['username']; $query1=mysql_query("SELECT * FROM user_info WHERE username='$username'"); $fetch2=mysql_fetch_object($query1); $fetch=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$username'")); $fetch123=mysql_fetch_object(mysql_query("SELECT * FROM bodygaurd WHERE username='$username'")); $date = gmdate('Y-m-d H:i:S'); $bo=mysql_fetch_object(mysql_query("SELECT * FROM bodygaurd WHERE username='$username'")); $check=mysql_fetch_object(mysql_query("SELECT * FROM bodygaurd WHERE username='$username'")); $page=strip_tags($_GET['page']); if($check == "0"){ echo"<link href=\"style.css\" rel=\"stylesheet\" type=\"text/css\" /><table width=\"384\" align=\"center\" cellspacing=\"0\" cellpadding=\"0\" class=table> <tr><td class=\"header\" colspan=\"2\"><center>Bodyguard</td></tr> <tr><td height=1 colspan=3><center>You do not have a bodyguard buy one here <br><a href=credits.php>credits page</a></td></tr></table><center>"; exit(); } ?> <html> <head> <link rel=stylesheet href=style.css type=text/css> <title>The Bodygaurd Shop</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <table width="384" border="0" align="center" cellpadding="2" cellspacing="0" class="table"> <tr> <td height="22" colspan="7" align="center" class="header"> <div align="center"><strong>Your Bodyguard</strong></div> </td> </tr> <tr> <td> <img src=""> </td> </tr> <tr> <td align="center" colspan="2" class="tableborder">Now, Pick from the options below to edit your bodygaurd! <br><br> <a href='?page=inven'><img src='images/bodygaurd/bng.png' border="0"></a> <a href='?page=rankfire'><img src='images/bodygaurd/ranks.png' border="0"></a> <a href='?page=status'><img src='images/bodygaurd/status.png' border="0"></a> <a href='?page=shop'><img src='images/bodygaurd/shop.png' border="0"> </a><br> <br></td> </tr> </table><br> <?php if($page == "inven"){?> <link href="style.css" rel="stylesheet" type="text/css"> <center> <table width="384" border="0" align="center" cellpadding="2" cellspacing="0" class="table"> <tr> <td height="22" colspan="7" align="center" class="header"> <div align="center"><strong>Your Bodyguards Inventory</strong></div> </td> </tr> <tr> <td align="center" colspan="2" class="tableborder"><div align="center"><u><b>Inventory</b></u><br><br> Your bodyguard currently has an <?php if($bo->weapon != "<b>Unidentified</b>"){ echo"<b>$bo->weapon</b>"; }else{ echo"<b>Unidentified</b>"; }?> weapon<br> Your bodyguard currently has <b><?php echo"".makecomma($bo->bullets).""; ?></b> bullets<br /></td> </tr> </table> <? }elseif($page == "rankfire"){?> <form action="" method="post" id=""> <table width="384" border="0" align="center" cellpadding="2" cellspacing="0" class="table"> <tr> <td height="22" colspan="7" align="center" class="header"> <div align="center"><strong>Rank to Fire at </strong></div> </td> </tr> <tr> <td colspan="2" align="center" class="tableborder"><div align="center"><u><b>Rank to fire at</b></u><br> <br> Here you can choose which rank you want your bodygaurd to fire back at, update it here;<br><br> Fire back at rank: <select name="fireat" class="textbox"> <option value="0" selected="selected" >All Ranks</option> <option value="1" >Dirty Cop +</option> <option value="2" >Scum +</option> <option value="3" >Criminal +</option> <option value="4" >Vandal +</option> <option value="5" >Arsonist +</option> <option value="6" >Thug +</option> <option value="7" >Boss +</option> <option value="8" >Assassin +</option> <option value="9" >Don +</option> <option value="10" >Godfather +</option> <option value="11" >Global Threat +</option> <option value="12" >Global Dominator +</option> <option value="13" >Untouchable Godfather +</option> <option value="14" >Man Of Honour +</option> <option value="15" >Respectable Don +</option> <option value="16" >Legend +</option> <option value="17" >Official MM Legend +</option> <option value="18" >True MM Legend +</option> </select><br><br> <input type="submit" class="button" name="rank2" id="rank2" value="Change Rank" /><br> <?php if ($_POST['rank2']){ $rname=$_POST['rname']; $fireat=strip_tags($_POST['fireat']); mysql_query("UPDATE bodygaurd SET ranktoshoot='$fireat' WHERE username='$username'"); echo "Your have changed the minimum rank that your bodyguard will shoot at."; } ?><br /> </tr> </table> <?php }elseif($page == "status"){ ?> <form action="" method="post" id=""> <table width="384" border="0" align="center" cellpadding="2" cellspacing="0" class="table"> <tr> <td height="22" colspan="7" align="center" class="header"> <div align="center"><strong>Status</strong></div> </td> </tr> <tr> <td colspan="2" align="center" class="tableborder"><div align="center"><u><b>Status</b></u><br> <br> Here you can turn your bodygaurd on or off. <br> Your bodygaurd is currently; <b><?php echo"$bo->status"; ?></b><br> <br> Bodygaurd : <select name="status" class="textbox"> <option value="On" selected="selected" >On</option> <option value="Off" >Off</option> </select><br><br> <input type="submit" class="button" name="stat" id="stat" value="Change!"> <br><?php if ($_POST['stat']){ $status=strip_tags($_POST['status']); mysql_query("UPDATE bodygaurd SET status='$status' WHERE username='$username'"); echo "You have changed your bodyguard status to $status."; } ?> <br /> </tr> </table> <?php }elseif($page == "shop"){ ?> <form action="" method="post" id=""> <table width="384" border="0" align="center" cellpadding="2" cellspacing="0" class="table"> <tr> <td height="22" colspan="7" align="center" class="header"> <div align="center"><strong>The Bodyguard Shop </strong></div> </td> </tr> <tr> <td colspan="2" align="center" class="tableborder"><div align="center"><u><b>The shop </b></u><br> <br> Here you can purchase weapons for your bodygaurd. <br> <br> Purchase a gun: <select name="guntype" class="textbox"> <option value="M16">M16 - £2,500,000</option> <option value="AWP">AWP - £10,000,000</option> </select><br><br><input type="submit" class="button" name="buyg" id="buyg" value="Buy Weapon" /> <?php if ($_POST['buyg']){ $guntype=$_POST['guntype']; if($guntype == "M16") {$guncost = "2500000"; }elseif($guntype == "AWP"){ $guncost = "10000000"; } elseif($info->money < $guncost){ print "You don't have enougth money for this"; } elseif($bo['weapon'] == $guntype){ print "Your bodyguard already has that weapon"; } elseif { mysql_query("UPDATE bodygaurd SET weapon='$guntype' WHERE username='$username'"); mysql_query("UPDATE users SET money=money-$guncost WHERE username='$username'"); echo "<br>The $guntype was delivered to your body gaurd."; } } ?> <br> <br> Here you can swap normal bullets for Bodygaurd bullets. <br> <br><br /> <b>Add bullets from your account: </b> <input name="buyb" type="text" class="textbox" id="buyb" value="<?php echo "$fetch2->FMJ"; ?>" size="20"> <br> <br> <em>Please note when you have added the bullet(s), you can't get them back!</em><br> <br> <input type="submit" class="button" name="buys" id="buys" value="Add Bullets" /> <?php if ($_POST['buys']){ $buyb=$_POST['buyb']; $status=strip_tags($_POST['status']); if($fetch2->FMJ < $buyb){ echo"You have not got that many FMJ."; }elseif($fetch2->FMJ >= $buyb){ mysql_query("UPDATE bodygaurd SET bullets=bullets+$buyb WHERE username='$username'"); mysql_query("UPDATE users SET FMJ=FMJ-$buyb WHERE username='$username'"); echo "<br>You successfully added <b>".makecomma($buyb)."</b> FMJ for your bodyguard!"; }} ?><br> <br /> </tr> </table> <? } ?></p> Thank you in advance for your time and patience and your willing to help
-
so if i had say 10 cars it would be 0,9
-
no i didnt get it all it did was say you stole [no name here ] then it still inserts the no car name into the garage with 0 value but hopefully changing it to $win=rand(0,12); will sort the problem :) thanks as well Djkanna for your time and knowledge
-
oh i see thats where i was going wrong so it was having problems selecting the wining car and inserting it into the database thats why the car name was not showing as the array was wrong
-
oh so the value are the same but its better to use rand 0,12 then 0,13
-
even though there is 13 cars ?
-
well im sure one of you pro`s will be right :)
-
$1 = 'Vauxhall Nova'; $2 = 'Vauxhall Corsa'; $3 = 'Ford Fiesta ST'; $4 = 'Renault Clio'; $5 = 'Peugeot 206'; $6 = 'Ford Focus ST'; $7 = 'Nissan 350Z'; $8 = 'Subaru Impreza WRX'; $9 = 'Toyota Supra'; $10 = 'Lamborghini Gallardo'; $11 = 'Lamborghini Murcielago'; $12 = 'Mercades SLR'; $13 = 'Bugatti Veyron'; this above line 131 $win = mt_rand(1,13);
-
ill give it ago :) ill make a back up of my current one thanks again :)
-
no worries mate i appreciate your help and your time but hopefully some one else will pick the topic up :) thanks again
-
seker also thank you for taking the time to reply to my post
-
so if i put $win=rand(0,13); you think it would slove it cause it would select between 0 and 13 so it will pick from vaxuhall nova to the Bugatti Veyron or does the random need to be set high or lower
-
line 131 : $win=rand(1,13); is it to do with the random car selection
-
out come error You brake the window to the car and jump in[ car name here not shown ] a well done! it normally always shows car name but a odd occasion it come up with the text above and dont show the name but still inserts it into the garage with no name and value at 0 any ideas or where ive missed a bracket <?php session_start(); include 'includes/db_connect.php'; include 'includes/functions.php'; include 'includes/jail_check.php'; if ($info->last_script_check < time()){ include_once "probe.php"; } $username=$_SESSION['username']; $radiobutton=$_POST['radiobutton']; $above = mysql_query("SELECT * FROM users WHERE username='$username'"); $info = mysql_fetch_object($above); $chance = explode("-", $info->gtachance); if (strip_tags($_GET['reset'])){ $reset=strip_tags($_GET['reset']); if($info->points < "4"){ echo "<center><font color=red><b>You dont have enough credits to reset your gta timer!</td>"; }elseif($info->points >= "4"){ mysql_query("UPDATE users SET points=points-5, lastgta='' WHERE username='$username'"); echo "<center><font color=green><b>Your gta timer has now been reset!<br><meta http-equiv='refresh' content='1;url=gta.php'>"; }} if ($info->lastgta > time()){ $left = $info->lastgta - time(); echo "<script type='text/javascript' src='timer.js'></script><link href='style.css' rel='stylesheet' type='text/css'> <br><table width='30%' align='center' cellspacing='0' cellpadding=0 border=0 class='table'> <tr> <td colspan='6' class='header' align=left>Error!</center></td> </tr> <tr> <td align='center'>You have to wait <span id='crime5'></span><script type='text/javascript'>setTimer('crime5','$left', { 0: function () { window.location = 'gta.php' }}); </script> before you can commit another gta!<br><br><a href=?reset=gta>Reset Timer (Costs 5 Credits)!</a></label></td> </tr> </div></table>"; exit(); } if ($_POST['submit']){ $suc = $chance[$radiobutton]; $ran = rand(1,100); if ($ran <= $suc){ if ($radiobutton == "6"){ $success = $chance[0]; $cars = array('Vauxhall Nova','Vauxhall Corsa','Ford Fiesta ST','Renault Clio','Peugeot 206','Ford Focus ST','Nissan 350Z','Subaru Impreza WRX','Toyota Supra','Lamborghini Gallardo','Lamborghini Murcielago','Mercades SLR','Bugatti Veyron'); $quote="You Broke In To The House And Found The Keys To The Car"; ////NEXT RADIO }elseif ($radiobutton == "1"){ $success = $chance[1]; $cars = array('Vauxhall Nova','Vauxhall Corsa','Ford Fiesta ST','Renault Clio','Peugeot 206','Ford Focus ST','Nissan 350Z','Subaru Impreza WRX','Toyota Supra','Lamborghini Gallardo','Lamborghini Murcielago','Mercades SLR','Bugatti Veyron'); $quote="You Found A Car With Keys In It."; ////NEXT RADIO }elseif ($radiobutton == "2"){ $success = $chance[2]; $cars = array('Vauxhall Nova','Vauxhall Corsa','Ford Fiesta ST','Renault Clio','Peugeot 206','Ford Focus ST','Nissan 350Z','Subaru Impreza WRX','Toyota Supra','Lamborghini Gallardo','Lamborghini Murcielago','Mercades SLR','Bugatti Veyron'); $quote="You Managed To Get The Sexy Model To Give You The Keys And You Drove Away."; ////NEXT RADIO }elseif ($radiobutton == "4"){ $success = $chance[4]; $cars = array('Vauxhall Nova','Vauxhall Corsa','Ford Fiesta ST','Renault Clio','Peugeot 206','Ford Focus ST','Nissan 350Z','Subaru Impreza WRX','Toyota Supra','Lamborghini Gallardo','Lamborghini Murcielago','Mercades SLR','Bugatti Veyron'); $quote="You Drove The Car Out Of The Back Door With The Owner On The Bonnet"; ////NEXT RADIO }elseif ($radiobutton == "5"){ $success = $chance[5]; $cars = array('Vauxhall Nova','Vauxhall Corsa','Ford Fiesta ST','Renault Clio','Peugeot 206','Ford Focus ST','Nissan 350Z','Subaru Impreza WRX','Toyota Supra','Lamborghini Gallardo','Lamborghini Murcielago','Mercades SLR','Bugatti Veyron'); $quote="You Got The Car Out Of The Crews Car Lot With Out Being Seen."; } $win=rand(1,13); if ($cars[$win] == "Vauxhall Nova"){ $na = "images/car/nova.jpg"; } elseif ($cars[$win] == "Vauxhall Corsa"){ $na = "images/car/corsa.jpg"; } elseif ($cars[$win] == "Ford Fiesta ST"){ $na = "images/car/fiesta.jpg"; } elseif ($cars[$win] == "Renault Clio"){ $na = "images/car/clio.jpg"; } elseif ($cars[$win] == "Peugeot 206"){ $na = "images/car/206.jpg"; } elseif ($cars[$win] == "Ford Focus ST"){ $na = "images/car/focus.jpg"; } elseif ($cars[$win] == "Nissan 350Z"){ $na = "images/car/350z.jpg"; } elseif ($cars[$win] == "Subaru Impreza WRX"){ $na = "images/car/wrx.jpg"; } elseif ($cars[$win] == "Toyota Supra"){ $na = "images/car/supra.jpg"; } elseif ($cars[$win] == "Lamborghini Gallardo"){ $na = "images/cars/lambog.jpg"; } elseif ($cars[$win] == "Lamborghini Murcielago"){ $na = "images/cars/lambom.jpg"; } elseif ($cars[$win] == "Mercades SLR"){ $na = "images/cars/slr.jpg"; } elseif ($cars[$win] == "Bugatti Veyron"){ $na = "images/cars/veyron.jpg"; } echo "<link href='style.css' rel='stylesheet' type='text/css'><br><center> <table width='30%' align='center' cellspacing='0' cellpadding=0 border=0 class='table'> <tr> <td colspan='6' class='header' align=left>Succesful!</center></td> </tr> <tr> <td align='center'>You brake the window to the car and jump in a $cars[$win] well done!</label></td> </tr> </div></table>"; mysql_query("UPDATE user_info SET gtas=gtas+1 WHERE username='$username'"); mysql_query("UPDATE users SET GP=GP+1 WHERE username='$username'"); $time= time() + (60*5); if($site->doublexp == "ON"){ $newrank = $info->rankpoints + 22; $newrank2 = $info->rankpoints + 8; $newcomprank = $info->compxp + 22; $newcomprank2 = $info->compxp + 8; }else{ $newrank = $info->rankpoints + 12; $newrank2 = $info->rankpoints + 4; $newcomprank = $info->compxp + 12; $newcomprank2 = $info->compxp + 4; } $damage=rand(1,50); if ($cars[$win] == "Vauxhall Nova"){ $max="750"; if ($damage == "0"){ $for=$max; }elseif ($damage == "50"){ $for = "0"; }else{ $for = $max / $damage *2; } } ////////////////////////////////////// if ($cars[$win] == "Vauxhall Corsa"){ $max="3250"; if ($damage == "0"){ $for=$max; }elseif ($damage == "50"){ $for = "0"; }else{ $for = $max / $damage *2; } } ////////////////////////////////////// if ($cars[$win] == "Ford Fiesta ST"){ $max="3850"; if ($damage == "0"){ $for=$max; }elseif ($damage == "50"){ $for = "0"; }else{ $for = $max / $damage *2; } } ////////////////////////////////////// if ($cars[$win] == "Renault Clio"){ $max="4000"; if ($damage == "0"){ $for=$max; }elseif ($damage == "50"){ $for = "0"; }else{ $for = $max / $damage *2; } } ////////////////////////////////////// if ($cars[$win] == "Peugeot 206"){ $max="5000"; if ($damage == "0"){ $for=$max; }elseif ($damage == "50"){ $for = "0"; }else{ $for = $max / $damage *2; } } ////////////////////////////////////// if ($cars[$win] == "Ford Focus ST"){ $max="9000"; if ($damage == "0"){ $for=$max; }elseif ($damage == "50"){ $for = "0"; }else{ $for = $max / $damage *2; } } ////////////////////////////////////// if ($cars[$win] == "Nissan 350Z"){ $max="14000"; if ($damage == "0"){ $for=$max; }elseif ($damage == "50"){ $for = "0"; }else{ $for = $max / $damage *2; } } ////////////////////////////////////// if ($cars[$win] == "Subaru Impreza WRX"){ $max="15000"; if ($damage == "0"){ $for=$max; }elseif ($damage == "50"){ $for = "0"; }else{ $for = $max / $damage *2; } } ////////////////////////////////////// if ($cars[$win] == "Toyota Supra"){ $max="20000"; if ($damage == "0"){ $for=$max; }elseif ($damage == "50"){ $for = "0"; }else{ $for = $max / $damage *2; } } ////////////////////////////////////// if ($cars[$win] == "Lamborghini Gallardo"){ $max="53499"; if ($damage == "0"){ $for=$max; }elseif ($damage == "50"){ $for = "0"; }else{ $for = $max / $damage *2; } } ////////////////////////////////////// if ($cars[$win] == "Lamborghini Murcielago"){ $max="75000"; if ($damage == "0"){ $for=$max; }elseif ($damage == "50"){ $for = "0"; }else{ $for = $max / $damage *2; } } ////////////////////////////////////// if ($cars[$win] == "Mercades SLR"){ $max="95000"; if ($damage == "0"){ $for=$max; }elseif ($damage == "50"){ $for = "0"; }else{ $for = $max / $damage *2; } } ////////////////////////////////////// if ($cars[$win] == "Bugatti Veyron"){ $max="275000"; if ($damage == "0"){ $for=$max; }elseif ($damage == "50"){ $for = "0"; }else{ $for = $max / $damage *2; } } ////////////////////////////////////// $for=round($for); //print "$for!!"; mysql_query("INSERT INTO `garage` ( `id` , `owner` , `car` , `damage`,`origion`,`location`,`worth`) VALUES ( '', '$username', '$cars[$win]', '$damage','$info->location','$info->location','$max' )"); mysql_query("UPDATE users SET rankpoints='$newrank' WHERE username='$username'"); if ($site->xpcompstatus == "2"){ mysql_query("UPDATE users SET compxp=$newcomprank WHERE username='$username'"); } }else{ if ($radiobutton == "6"){ $quote="You Got No Way Near The Posh House The Dogs Scared You Away. You Got Away With Nothing"; }elseif ($radiobutton == "1"){ $quote="You Triped On The Curb And Set The Car Alarm Off. You Got Away With Nothing"; }elseif ($radiobutton == "2"){ $quote="You Got Caught Climbing In To The Car And You Were Taken Down By A Car Model. You Got Away With Nothing"; }elseif ($radiobutton == "4"){ $quote="The Car Lot Owner Saw You Go In To The Show Room After Dark And Followed You In. You Got Away With Nothing"; }elseif ($radiobutton == "5"){ $quote="The Crew Caught You Hiding In There Car Lot. You Got Away With Nothing"; } $reason = "Gta"; require_once "includes/failed.php"; echo "<link href='style.css' rel='stylesheet' type='text/css'><br><center> <table width='30%' align='center' cellspacing='0' cellpadding=0 border=0 class='table'> <tr> <td colspan='6' class='header' align=left>Failed!</center></td> </tr> <tr> <td align='center'>You tryed to steal the car but the police drove passed you failed to get away with a car!</label></td> </tr> </div></table>"; mysql_query("UPDATE user_info SET gtas=gtas+1 WHERE username='$username'"); } if($chance[0] == 1){$chance[1] = 1;} elseif(($chance[0] >= 1) && ($chance[0] <= 2)){$chance[0] = rand(1,$chance[0]);} elseif(($chance[0] >= 2) && ($chance[0] <= 10)){$chance[0] = rand(10,$chance[0]);} elseif(($chance[0] >= 5) && ($chance[0] <= 25)){$chance[0] = rand(25,$chance[0]);} elseif(($chance[0] >= 18) && ($chance[0] <= 36)){$chance[0] = rand(36,$chance[0]);} elseif(($chance[0] >= 25) && ($chance[0] <= 49)){$chance[0] = rand(49,$chance[0]);} elseif(($chance[0] >= 36) && ($chance[0] <= 58)){$chance[0] = rand(58,$chance[0]);} elseif(($chance[0] >= 49) && ($chance[0] <= 55)){$chance[0] = rand(55,$chance[0]);} elseif($chance[0] >= 55){$chance[0] = rand(55,$chance[0]);} if($chance[0] == 1){$chance[1] = 0;} elseif(($chance[0] >= 1) && ($chance[0] <= 2)){$chance[1] = rand(0,$chance[0]);} elseif(($chance[0] >= 3) && ($chance[0] <= 8)){$chance[1] = rand(7,$chance[0]);} elseif(($chance[0] >= 9) && ($chance[0] <= 15)){$chance[1] = rand(14,$chance[0]);} elseif(($chance[0] >= 16) && ($chance[0] <= 34)){$chance[1] = rand(33,$chance[0]);} elseif(($chance[0] >= 35) && ($chance[0] <= 74)){$chance[1] = rand(45,$chance[0]);} elseif($chance[0] >= 75){$chance[1] = rand(50,$chance[0]);} if($chance[0] == 1){$chance[2] = 0;} elseif(($chance[0] >= 1) && ($chance[0] <= 2)){$chance[2] = rand(0,$chance[0]);} elseif(($chance[0] >= 3) && ($chance[0] <= 8)){$chance[2] = rand(6,$chance[0]);} elseif(($chance[0] >= 9) && ($chance[0] <= 15)){$chance[2] = rand(13,$chance[0]);} elseif(($chance[0] >= 16) && ($chance[0] <= 34)){$chance[2] = rand(32,$chance[0]);} elseif(($chance[0] >= 35) && ($chance[0] <= 74)){$chance[2] = rand(60,$chance[0]);} elseif($chance[0] >= 75){$chance[2] = rand(85,$chance[0]);} if($chance[0] == 1){$chance[4] = 0;} elseif(($chance[0] >= 1) && ($chance[0] <= 2)){$chance[4] = rand(0,$chance[0]);} elseif(($chance[0] >= 3) && ($chance[0] <= 8)){$chance[4] = rand(6,$chance[0]);} elseif(($chance[0] >= 9) && ($chance[0] <= 15)){$chance[4] = rand(13,$chance[0]);} elseif(($chance[0] >= 16) && ($chance[0] <= 34)){$chance[4] = rand(32,$chance[0]);} elseif(($chance[0] >= 35) && ($chance[0] <= 74)){$chance[4] = rand(60,$chance[0]);} elseif($chance[0] >= 75){$chance[4] = rand(85,$chance[0]);} if($chance[0] == 1){$chance[5] = 0;} elseif(($chance[0] >= 1) && ($chance[0] <= 2)){$chance[5] = rand(0,$chance[0]);} elseif(($chance[0] >= 3) && ($chance[0] <= 8)){$chance[5] = rand(6,$chance[0]);} elseif(($chance[0] >= 9) && ($chance[0] <= 15)){$chance[5] = rand(13,$chance[0]);} elseif(($chance[0] >= 16) && ($chance[0] <= 34)){$chance[5] = rand(32,$chance[0]);} elseif(($chance[0] >= 35) && ($chance[0] <= 74)){$chance[5] = rand(60,$chance[0]);} elseif($chance[0] >= 75){$chance[5] = rand(85,$chance[0]);} if($chance[0] > 70){ $chance[0] = 40; } if($chance[1] > 70){ $chance[1] = 40; } if($chance[2] > 75){ $chance[2] = 40; } if($chance[4] > 85){ $chance[4] = 40; } if($chance[5] > 48){ $chance[5] = 40; } $chance[0]++; if ($chance[0] > 50){ $chance[0] = 40; } $arrayrates = array($chance[0], $chance[1], $chance[2], $chance[3], $chance[4], $chance[5]); $newrates = implode("-", $arrayrates); $tim = time() + (60*5); mysql_query("UPDATE users SET gtachance='$newrates',lastgta='$tim' WHERE username='$username'"); exit; } ?> <? if ($site->gupdate == "1"){ echo "<link href='style.css' rel='stylesheet' type='text/css'><center><div class='update'>$site->gupdatetext</div></center> <br>"; } ?> <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> try { var pageTracker = _gat._getTracker("UA-12456885-1"); pageTracker._trackPageview(); } catch(err) {}</script> <script type="text/javascript"> if(!top || top.frames.length < 4) { top.location="/index2.php";} </script> <link href="style.css" rel="stylesheet" type="text/css"> <script language=JavaScript> function so(dis) { for (i=0;i<dis.elements.length;i++){ if (dis.elements[i].type=='submit') dis.elements[i].style.visibility='hidden'; } if(fs==false){ fs=true; return true; }else return false; } function goaway() { for(i=0;i<document.forms.length;i++) document.forms[i].onsubmit = function() {return so(this);}; } </script> <style > .bar_cont { display: inline-block; vertical-align:middle; } .bar { position: relative; width: 150px; line-height: 11px; border: 1px solid #000; color: #000000; background: url('images/crimebg/red.jpg'); background-repeat: repeat-x; } .rg { position: relative; height: 11px; background-image: url('images/crimebg/green.jpg'); background-repeat: repeat-x; z-index: 2; } </style> </head> <body onLoad="goaway();"> <form name="form1" method="post" action=""> <table width="300" align="center" border="0" cellpadding="0" cellspacing="0" class="table"> <tr class="header"> <td colspan="2">GTA</td> </tr> <tr> <td align="center" width="20"><input type="radio" name="radiobutton" value="1"></td> <td>Street<br><div class="bar" align="left"><div class="per" align="left"><?php echo "$chance[1]"; ?>%</div><div class="rg" align="left" style="width:<?php echo "$chance[1]"; ?>%"></div></div></td> </tr> <tr> <td align="center"><input type="radio" name="radiobutton" value="2"></td> <td>Car Park: <div class="bar" align="left"><div class="per" align="left"><?php echo "$chance[2]"; ?>%</div><div class="rg" align="left" style="width:<?php echo "$chance[2]"; ?>%"></div></div></td> </tr> <tr> <td align="center"><input type="radio" name="radiobutton" value="4"></td> <td>Car Dealership: <div class="bar" align="left"><div class="per" align="left"><?php echo "$chance[4]"; ?>%</div><div class="rg" align="left" style="width:<?php echo "$chance[4]"; ?>%"></div></div></td> </tr> <tr> <td align="center"><input type="radio" name="radiobutton" value="5"></td> <td>Car manufacturer: <div class="bar" align="left"><div class="per" align="left"><?php echo "$chance[5]"; ?>%</div><div class="rg" align="left" style="width:<?php echo "$chance[5]"; ?>%"></div></div></td> </tr> <tr> <td colspan="2" align="center"> <div align="center"> <input name="submit" type="submit" class="button" id="submit" value="Steal Car"> </div></td> </tr> </table> </form> <p> </p> </html>
-
Warning: preg_match() [function.preg-match]: Unknown modifier '@' in /home/mafiasil/public_html/v2/checkem.php on line 20 Warning: preg_match() [function.preg-match]: Unknown modifier '_' in /home/mafiasil/public_html/v2/checkem.php on line 28 Warning: preg_match() [function.preg-match]: No ending delimiter '^' found in /home/mafiasil/public_html/v2/checkem.php on line 32 Invalid - Already In Use
-
ive used preg_match which is replacing ereg ? but like i said i get the error when changing to preg_match : Warning: preg_match() [function.preg-match]: Unknown modifier '@' in /home/mafiasil/public_html/v2/checkem.php on line 20 Invalid - Bad Format also looked on this to get info http://www.php.net/manual/en/migration53.deprecated.php any more ideas
-
checkem : <?php /************************************************************************************************** | Software Name : Ravan Scripts Online Mafia Game | Software Author : Ravan Soft Tech | Software Version : Version 2.0.1 Build 2101 | Website : http://www.ravan.info/ | E-mail : [email protected] |************************************************************************************************** | The source files are subject to the Ravan Scripts End-User License Agreement included in License Agreement.html | The files in the package must not be distributed in whole or significant part. | All code is copyrighted unless otherwise advised. | Do Not Remove Powered By Ravan Scripts without permission . |************************************************************************************************** | Copyright (c) 2010 Ravan Scripts . All rights reserved. |**************************************************************************************************/ //thx to http://www.phpit.net/code/valid-email/ for valid_email function valid_email($email) { // First, we check that there's one @ symbol, and that the lengths are right if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) { // Email invalid because wrong number of characters in one section, or wrong number of @ symbols. return false; } // Split it into sections to make life easier $email_array = explode("@", $email); $local_array = explode(".", $email_array[0]); for ($i = 0; $i < sizeof($local_array); $i++) { if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) { return false; } } if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) { // Check if domain is IP. If not, it should be valid domain name $domain_array = explode(".", $email_array[1]); if (sizeof($domain_array) < 2) { return false; // Not enough parts to domain } for ($i = 0; $i < sizeof($domain_array); $i++) { if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_array[$i])) { return false; } } } return true; } include "config.php"; include "language.php"; global $_CONFIG; define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; if(!$_GET['password']) { die("<font color='red'>$rrerr10</font>"); } if(!valid_email($_GET['password'])) { die("<font color='red'>$rrerr8</font>"); } $un=$_GET['password']; $q=$db->query("SELECT * FROM users WHERE email='$un'"); if($db->num_rows($q)) { die("<font color='red'>$rrerr9</font>"); } print "<font color='green'>$rrerr13</font>"; ?> error message : Deprecated: Function ereg() is deprecated in /home/mafiasil/public_html/v2/checkem.php on line 20 Replaced With Preg_match then i get this error message : Warning: preg_match() [function.preg-match]: Unknown modifier '@' in /home/mafiasil/public_html/v2/checkem.php on line 20 Invalid - Bad Format any ideas
-
Error When Buying property ? The error: it cost 25 million To buy a bf but when i have 17 million it allows me to buy it but then my money goes into -(minus) amounts here the code any help will be greatly appreciated <?php error_reporting(0); session_start(); include_once "includes/db_connect.php"; include_once "includes/functions.php"; logincheck(); $username=$_SESSION['username']; $fetch= mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$username'")); $bf = mysql_fetch_object(mysql_query("SELECT * FROM bf WHERE location='$fetch->location'")); $fetch_owner=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$RPS->owner'")); ?> <? if ($site->gupdate == "1"){ echo "<link href='style.css' rel='stylesheet' type='text/css'><center><div class='update'>$site->gupdatetext</div></center> <br>"; } ?> <link href='style.css' rel='stylesheet' type='text/css'> <script type="text/javascript" src="/js/select.js"></script> <style type="text/css"> .select, .selected { width: 110px; padding: 10px; } </style> <?php if($_GET['buyfactory']){ $bf = mysql_fetch_object(mysql_query("SELECT * FROM bf WHERE location='$fetch->location'")); if($bf->owner == "0"){ if($info->money < 2500000){ echo "<table border=0 bordercolor=black align=center cellpadding=2 cellspacing=0><tr><td class=notice align=center><center><font color=red>You dont have £25,000,000 to purchase this factory!</td></tr></table>"; }else{ mysql_query("UPDATE users SET money=money-25000000 WHERE username='$username'"); mysql_query("UPDATE bf SET owner='$username' WHERE location='$fetch->location'"); mysql_query("UPDATE bf SET jspprice='4500' WHERE location='$fetch->location'"); mysql_query("UPDATE bf SET fmjprice='4500' WHERE location='$fetch->location'"); mysql_query("UPDATE bf SET profit='0' WHERE location='$fetch->location'"); echo" <table border=0 bordercolor=black align=center cellpadding=2 cellspacing=0><tr><td class=notice align=center><center><font color=green>Your now the owner of $fetch->location bullet factory!</td></tr></table>"; }}} ?> <?php if($_GET['drop']){ $bf = mysql_fetch_object(mysql_query("SELECT * FROM bf WHERE location='$fetch->location' AND owner='$username'")); if ($bf->owner == $username) { mysql_query("UPDATE bf SET owner='0' WHERE location='$fetch->location'"); mysql_query("UPDATE bf SET jspprice='4500' WHERE location='$fetch->location'"); mysql_query("UPDATE bf SET fmjprice='4500' WHERE location='$fetch->location'"); mysql_query("UPDATE bf SET profit='0' WHERE location='$fetch->location'"); echo"<br><div class=success>You have dropped the bullet factory in $fetch->location!<br><br>"; }} ///////////////////////////////////////////////////// if(strip_tags($_POST['submit'])){ $type=$_POST['type']; $amount=strip_tags($_GET['amount']); if($type == "1"){ $bf = mysql_fetch_object(mysql_query("SELECT * FROM bf WHERE location='$fetch->location'")); if ($bf->owner == $username) { echo" <table border=0 bordercolor=black align=center cellpadding=2 cellspacing=0><tr><td class=notice align=center><center><font color=red>You cant buy from your own factory!</td></tr></table><br>"; } elseif ($bf->owner != $username) { $amount=intval(strip_tags($_POST['amount'])); if ($amount == 0 || !$amount || ereg('[^0-9]',$amount)){ print " <table border=0 bordercolor=black align=center cellpadding=2 cellspacing=0><tr><td class=notice align=center><center><font color=red>You cant buy that amount!</td></tr></table><br>"; }elseif ($amount != 0 || $amount || !ereg('[^0-9]',$amount)){ $costs = $bf->jhpprice * $amount; if ($costs > $fetch->money){ echo " <table border=0 bordercolor=black align=center cellpadding=2 cellspacing=0><tr><td class=notice align=center><center><font color=red>You do not have enough money!</td></tr></table><br>"; }elseif ($costs <= $fetch->money){ if ($bf->jhpstock < $amount){ echo " <table border=0 bordercolor=black align=center cellpadding=2 cellspacing=0><tr><td class=notice align=center><center><font color=red>There isn't enough JHP in stock for you to buy that amount!</td></tr></table><br>"; }elseif ($amount <= $bf->jhpstock){ mysql_query("UPDATE users SET money=money-$costs WHERE username='$username'"); mysql_query("UPDATE users SET JHP=JHP+$amount WHERE username='$username'"); mysql_query("UPDATE bf SET jhpstock=jhpstock-$amount WHERE location='$fetch->location'"); mysql_query("UPDATE bf SET profit=profit+$cost WHERE location='$fetch->location'"); mysql_query("UPDATE users SET money=money+$costs WHERE username='$bf->owner'"); echo" <table border=0 bordercolor=black align=center cellpadding=2 cellspacing=0> <tr><td class=notice align=center><center><font color=green>You've bought ".makecomma($amount)." JHP for £".makecomma($costs)."!</td></tr></table><br>"; }}}}}} ///////////////////////////////////////////////// if($type == "2"){ $bf = mysql_fetch_object(mysql_query("SELECT * FROM bf WHERE location='$fetch->location'")); if ($bf->owner == $username) { echo" <table border=0 bordercolor=black align=center cellpadding=2 cellspacing=0><tr><td class=notice align=center><center><font color=red>You cant buy from your own factory!</td></tr></table><br>"; } elseif ($bf->owner != $username) { $amount=intval(strip_tags($_POST['amount'])); if ($amount == 0 || !$amount || ereg('[^0-9]',$amount)){ print " <table border=0 bordercolor=black align=center cellpadding=2 cellspacing=0><tr><td class=notice align=center><center><font color=red>You cant buy that amount!</td></tr></table><br>"; }elseif ($amount != 0 || $amount || !ereg('[^0-9]',$amount)){ $costs = $bf->fmjprice * $amount; if ($costs > $fetch->money){ echo " <table border=0 bordercolor=black align=center cellpadding=2 cellspacing=0><tr><td class=notice align=center><center><font color=red>You do not have enough money!</td></tr></table><br>"; }elseif ($costs <= $fetch->money){ if ($bf->fmjstock < $amount){ echo " <table border=0 bordercolor=black align=center cellpadding=2 cellspacing=0><tr><td class=notice align=center><center><font color=red>There isn't enough FMJ in stock for you to buy that amount!</td></tr></table><br>"; }elseif ($amount <= $bf->fmjstock){ mysql_query("UPDATE users SET money=money-$costs WHERE username='$username'"); mysql_query("UPDATE users SET FMJ=FMJ+$amount WHERE username='$username'"); mysql_query("UPDATE bf SET fmjstock=fmjstock-$amount WHERE location='$fetch->location'"); mysql_query("UPDATE bf SET profit=profit+$cost WHERE location='$fetch->location'"); mysql_query("UPDATE users SET money=money+$costs WHERE username='$bf->owner'"); echo" <table border=0 bordercolor=black align=center cellpadding=2 cellspacing=0> <tr><td class=notice align=center><center><font color=green>You've bought ".makecomma($amount)." FMJ for £".makecomma($costs)."!</td></tr></table><br>"; }}}}} ?> <?php if($bf->owner == "0"){ echo "<link href='style.css' rel='stylesheet' type='text/css'><table border=0 bordercolor=black align=center cellpadding=2 cellspacing=0><tr><td class=notice align=center><center>This bullet factory has no owner.<br> The price to buy this factory is £25,000,000.<br> <a href=?buyfactory=yes>Buy Bullet Factory</a></td></tr></table><br>";exit; } ?> <br> <form action='' method='post'> <input type="hidden" name="type" id="select" value="0"> <table width="400" align="center" cellspacing="0" class="table"> <tr class="header"><td colspan="2">Bullet Factory - Owner: <?php if($bf->owner == "0"){ echo "No Owner"; }else{ echo "Owned by <a href='profile.php?viewuser=$bf->owner'>$bf->owner</a>"; } ?></td></tr> <?php if($bf->producing == "yes"){ ?> <tr class="subhead"><td colspan="2" align="center">The stock will update in: <?php echo"".maketime($finds_status->bfstocktime).""; ?></td></tr> <? }else{ ?> <tr class="subhead"><td colspan="2" align="center">This bullet factory is currently not producing.</td></tr> <? } ?> <tr><td height="10"> </td></tr> <tr><td width='50%' align='center'><div id='1' value='1' class='action select' onclick='SelectOption(this.id, this.className);'><img src='images/items/jhp.png'><br>Jacketed Hollow Point<br>Stock: <?php echo "".number_format($bf->jhpstock).""; ?><br>Cost: <?php echo "£".number_format($bf->jhpprice).""; ?> / per bullet</div></td> <td width='50%' align='center'><div id='2' value='2' class='action select' onclick='SelectOption(this.id, this.className);'><img src='images/items/fmj.png'><br>Full Metal Jacketed<br>Stock: <?php echo "".number_format($bf->fmjstock).""; ?><br>Cost: <?php echo "£".number_format($bf->fmjprice).""; ?> / per bullet</div></td></tr> <tr><td height="10"> </td></tr> <?php if($username == $bf->owner){ ?> <tr><td class=notice colspan='5' align=center><center><font color=red>You cannot buy from your own Bullet Factory!</td></tr> <? }else{ ?> <tr><td align='center' colspan='2'>Bullets: <input type="text" name="amount" class="textbox" id="bullets" autocomplete="off" class="input"></td></tr> <tr><td align='center' colspan='2'><input type='submit' name='submit' class='button' value='Purchase'></td></tr> </table> <? } ?> </form> <table align="center"> <tr> <td> <table align="center" cellspacing="0" class="table"> <tr> <td width="25" align="right"><img src='/images/items/jhp.png' width="25"></td> <td>You have <?php echo "".number_format($fetch->JHP).""; ?> JHP!</td> </tr> </table> </td> <td> <table align="center" cellspacing="0" class="table"> <tr> <td width="25" align="right"><img src='/images/items/fmj.png' width="25"></td> <td>You have <?php echo "".number_format($fetch->FMJ).""; ?> FMJ!</td> </tr> </table> </td> <td> <table align="center" cellspacing="0" class="table"> <tr> <td width="25" align="right"><img src='/images/items/gbullet.png' width="25"></td> <td>You have <?php echo "".number_format($fetch->GoldenBullet).""; ?> Golden Bullets!</td> </tr> </table> </td> </tr> </table>