
Dragon Blade
Members-
Posts
209 -
Joined
-
Last visited
-
Days Won
1
Content Type
Profiles
Forums
Events
Everything posted by Dragon Blade
-
Hey all, I have a script here. It doesn't update the tables? Everything seems fine? <?php include"globals.php"; global $db, $ir, $c, $h, $userid, $set; if (!isset($_GET['ID'])) { $_GET['ID'] = ''; } $_GET['ID'] = abs((int) $_GET['ID']); if($_POST) { foreach ($_POST as $k => $v) { mysql_query( "UPDATE pages SET $k ='$v' WHERE page_id =".$_GET['ID']); } stafflog_add("Edited Index Page"); echo ' Index Page Updated!<br /> > <a href="staff_index.php">Staff Index</a> '; $h->endpage(); exit; } if(!$_GET['ID']) { echo ' <b><u>Editing Index Page</u></b> Please select the page you wish to edit below. <table width="70%" class="table" cellpadding="5" cellspacing="1"> <tr> <th width="50%">Page ID</th> </tr> <tr> <td style="text-align: center;"> <form action="'.basename($_SERVER['SCRIPT_FILENAME']).'" method="get"> '.page_dropdown($c, 'ID').' <input type="submit" value="Edit" /> </form> </td> </tr> </table><br /><br /> '; $h->endpage(); exit; } function showTable($variable) { if ($variable === true) { return 'true'; } else if ($variable === false) { return 'false'; } else if ($variable === null) { return 'null'; } else if (is_array($variable)) { $html = ' <table width="80%" class="table" cellpadding="5" cellspacing="1" style="text-align: left;"> <tr><th colspan="2">Updating page ['.$_GET['ID'].'] <div style="float: right;"><a href="staff_index.php">Back</a></div></th></tr> <tr><th width="20%" style="text-align: left;">Field</th><th style="text-align: left;">Value</th></tr>'; foreach ($variable as $key => $value) { $value = showTable($value); $hide = array('page_id'); if(!in_array($key, $hide)) { $html .= '<tr><td style="text-align: left;">'.ucfirst($key).'</td> <td style="text-align: left;"> <input type="text" name="'.$key.'" value="'.$value.'" size="70"> </td></tr>'; } } return $html; } else { return strval($variable); } } $ro = mysql_query("SELECT * FROM pages WHERE page_id=".$_GET['ID']); if(!mysql_num_rows($ro)) { echo 'No Page Found<br /> <a href="staff_index.php">>Staff Index</a>'; $h->endpage(); exit; } $r = mysql_fetch_assoc($ro); echo '<form action="staff_pageupdate.php" method="post">'; echo showTable($r); echo '<tr><td colspan="2"><input type="submit" value="Save new updates" /></td></tr></form> </table><br /><br /> '; $h->endpage();
-
Hello all, I have a problem when I race in game. If the person who sends the challenge, and the other person accepted it. The person who sent the challenge wins? Can someone fix this for me? <?php session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); check_level(); $fm=money_formatter($ir['money']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); // Security check $id=abs((int) $_POST['id']); $car=abs((int) $_POST['car']); if(!$id || !$car) { print "<hr width='50%'>Please read the error message.<hr width='50%'><h3>! ERROR</h3>Invalid usage.<br /><br /> <hr width='50%'><a href='index.php'>> Go Home</a><hr width='50%'><br />"; $h->endpage(); exit; } // End $q=mysql_query("SELECT ch.*, cp.*, ct.*, u1.username as challenger, u2.username as challenged FROM challenges ch LEFT JOIN cars_playercars cp ON ch.chCHRCAR=cp.cpcID LEFT JOIN cars_types ct ON ct.carID=cp.cpcCAR LEFT JOIN users u1 ON ch.chCHR=u1.userid LEFT JOIN users u2 ON ch.chCHD=u2.userid WHERE ch.chID={$id} AND (ch.chCHR=$userid OR ch.chCHD=$userid)"); if(mysql_num_rows($q) == 0) { print "<hr width='50%'>Please read the error message.<hr width='50%'><h3>! ERROR</h3>Invalid challenge.<br /><br /> <hr width='50%'><a href='index.php'>> Go Home</a><hr width='50%'><br />"; $h->endpage(); exit; } $r=mysql_fetch_array($q); if($r['chSTATUS']=="open") { $bet=$r['chBET']; if($bet > $ir['money']) { print "<hr width='50%'>Please read the error message.<hr width='50%'><h3>! ERROR</h3>The bet is too large.<br /><br /> <hr width='50%'><a href='index.php'>> Go Home</a><hr width='50%'><br />"; $h->endpage(); exit; } $q=mysql_query("SELECT cp.*,ct.* FROM cars_playercars cp LEFT JOIN cars_types ct ON ct.carID=cp.cpcCAR WHERE cp.cpcID={$car} AND cp.cpcPLAYER=$userid"); if(mysql_num_rows($q) == 0) { print "<hr width='50%'>Please read the error message.<hr width='50%'><h3>! ERROR</h3>Invalid car.<br /><br /> <hr width='50%'><a href='index.php'>> Go Home</a><hr width='50%'><br />"; $h->endpage(); exit; } $m=mysql_fetch_array($q); if($m['cpcID'] == $r['cpcID']) { print "<hr width='50%'>Please read the error message.<hr width='50%'><h3>! ERROR</h3>????<br /><br /> <hr width='50%'><a href='index.php'>> Go Home</a><hr width='50%'><br />"; $h->endpage(); exit; } //kk, time to race =D print "<hr width='50%'>Please read the confirmation message.<hr width='50%'><h3>! CONFIRMATION</h3>You will receive the results of this race in an event.<br /><br /> <hr width='50%'><a href='events.php'>> Go Back</a><hr width='50%'><br />"; mysql_query("UPDATE users SET money=money-$bet WHERE userid={$userid}"); $q=mysql_query("SELECT * FROM cars_tracks ORDER BY rand() LIMIT 1"); $t=mysql_fetch_row($q); $stats_y=0; $stats_y+=$m['cpcACCLV']*$m['carACC']*$t['ctrkACC']; $stats_y+=$m['cpcHANLV']*$m['carHAN']*$t['ctrkHAN']; $stats_y+=$m['cpcSPDLV']*$m['carSPD']*$t['ctrkSPD']; $stats_y+=$m['cpcSHDLV']*$m['carSHD']*$t['ctrkSHD']; $stats_o=0; $stats_o+=$r['cpcACCLV']*$r['carACC']*$t['ctrkACC']; $stats_o+=$r['cpcHANLV']*$r['carHAN']*$t['ctrkHAN']; $stats_o+=$r['cpcSPDLV']*$r['carSPD']*$t['ctrkSPD']; $stats_o+=$r['cpcSHDLV']*$r['carSHD']*$t['ctrkSHD']; $stats_y*=rand(800,1200); $stats_o*=rand(800,1200); $notes="No-one won anything"; mysql_query("UPDATE users SET cars_challs_accpt=cars_challs_accpt+1 WHERE userid=$userid"); if($stats_y > $stats_o) { $winner=$ir['username']; $winnings=$bet*2; mysql_query("UPDATE users SET money=money+$winnings, cars_races_income=cars_races_income+$bet,cars_races_won=cars_races_won+1 WHERE userid={$r['chCHD']}"); mysql_query("UPDATE users SET cars_races_income=cars_races_income-$bet,cars_races_lost=cars_races_lost+1 WHERE userid={$r['chCHR']}"); if($bet > 0) { $notes="{$r['challenged']} won \$$winnings"; } if($r['chTYPE'] == "High-Stakes") { mysql_query("UPDATE cars_playercars SET cpcPLAYER=$userid WHERE cpcID={$r['cpcID']}"); $notes="{$r['challenged']} won {$r['challenger']}\'s {$r['carNAME']}"; mysql_query("UPDATE users SET cars_lost=cars_lost+1 WHERE userid={$r['chCHR']}"); mysql_query("UPDATE users SET cars_won=cars_won+1,cars_owned=cars_owned+1 WHERE userid={$r['chCHD']}"); } else if($r['chTYPE'] == "Betted") { mysql_query("UPDATE users SET cars_races_betted=cars_races_betted+1 WHERE userid IN ({$r['chCHR']}, {$r['chCHD']})"); } else { mysql_query("UPDATE users SET cars_races_friendly=cars_races_friendly+1 WHERE userid IN ({$r['chCHR']}, {$r['chCHD']})"); } } else { $winner=$r['challenger']; $winnings=$bet*2; if($bet > 0) { $notes="{$r['challenger']} won \$$winnings"; } mysql_query("UPDATE users SET money=money+$winnings, cars_races_income=cars_races_income+$bet,cars_races_won=cars_races_won+1 WHERE userid={$r['chCHR']}"); mysql_query("UPDATE users SET cars_races_income=cars_races_income-$bet,cars_races_lost=cars_races_lost+1 WHERE userid={$r['chCHD']}"); if($r['chTYPE'] == "High-Stakes") { mysql_query("UPDATE cars_playercars SET cpcPLAYER={$r['chCHR']} WHERE cpcID={$m['cpcID']}"); $notes="{$r['challenger']} won {$r['challenged']}\'s {$m['carNAME']}"; mysql_query("UPDATE users SET cars_lost=cars_lost+1 WHERE userid={$r['chCHD']}"); mysql_query("UPDATE users SET cars_won=cars_won+1,cars_owned=cars_owned+1 WHERE userid={$r['chCHR']}"); } else if($r['chTYPE'] == "Betted") { mysql_query("UPDATE users SET cars_races_betted=cars_races_betted+1 WHERE userid IN ({$r['chCHR']}, {$r['chCHD']})"); } else { mysql_query("UPDATE users SET cars_races_friendly=cars_races_friendly+1 WHERE userid IN ({$r['chCHR']}, {$r['chCHD']})"); } } $challengercar=$r['carNAME']; $challengedcar=$m['carNAME']; mysql_query("INSERT INTO race_results VALUES('', '{$r['chTYPE']}', '{$r['chBET']}', '{$r['challenger']}', '{$r['challenged']}', '$challengercar', '$challengedcar','$winner', '$notes')", $c); $i=mysql_insert_id($c); event_add($r['chCHR'], "Your race with <a href='viewuser.php?u={$r['chCHD']}'>{$r['challenged']}</a> is finished. Click <a href='viewrace.php?race={$i}'><font color='green'>here</font></a> to view the results.</a>"); event_add($r['chCHD'], "Your race with <a href='viewuser.php?u={$r['chCHR']}'>{$r['challenger']}</a> is finished. Click <a href='viewrace.php?race={$i}'><font color='green'>here</font></a> to view the results.</a>"); mysql_query("UPDATE challenges SET chSTATUS='accepted' WHERE chID={$id}"); } $h->endpage(); ?>
-
testers needed for new mod beta testing...
Dragon Blade replied to Uridium's topic in Requests & In Production
I do not mind helping out for free :) Add me on Skype: [email protected]. -
Can someone neaten this up? <?php session_start(); require "global_func.php"; if ($_SESSION['loggedin'] == 0) { header("Location: login.php"); exit; } $userid = $_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is = mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid", $c) or die(mysql_error()); $ir = mysql_fetch_array($is); check_level(); $fm = money_formatter($ir['money']); $cm = money_formatter($ir['crystals'], ''); $lv = date('F j, Y, g:i a', $ir['laston']); $h->userdata($ir, $lv, $fm, $cm); $h->menuarea(); if ($ir['user_level'] != 2 && $ir['userid'] != 288) { echo " New Roulette Being Placed"; $h->endpage(); exit(); } $number = rand(1, 36); $n0 = abs(intval($_POST['n0'])); $n1 = abs(intval($_POST['n1'])); $n2 = abs(intval($_POST['n2'])); $n3 = abs(intval($_POST['n3'])); $n4 = abs(intval($_POST['n4'])); $n5 = abs(intval($_POST['n5'])); $n6 = abs(intval($_POST['n6'])); $n7 = abs(intval($_POST['n7'])); $n8 = abs(intval($_POST['n8'])); $n9 = abs(intval($_POST['n9'])); $n10 = abs(intval($_POST['n10'])); $n11 = abs(intval($_POST['n11'])); $n12 = abs(intval($_POST['n12'])); $n13 = abs(intval($_POST['n13'])); $n14 = abs(intval($_POST['n14'])); $n15 = abs(intval($_POST['n15'])); $n16 = abs(intval($_POST['n16'])); $n17 = abs(intval($_POST['n17'])); $n18 = abs(intval($_POST['n18'])); $n19 = abs(intval($_POST['n19'])); $n20 = abs(intval($_POST['n20'])); $n21 = abs(intval($_POST['n21'])); $n22 = abs(intval($_POST['n22'])); $n23 = abs(intval($_POST['n23'])); $n24 = abs(intval($_POST['n24'])); $n25 = abs(intval($_POST['n25'])); $n26 = abs(intval($_POST['n26'])); $n27 = abs(intval($_POST['n27'])); $n28 = abs(intval($_POST['n28'])); $n29 = abs(intval($_POST['n29'])); $n30 = abs(intval($_POST['n30'])); $n31 = abs(intval($_POST['n31'])); $n32 = abs(intval($_POST['n32'])); $n33 = abs(intval($_POST['n33'])); $n34 = abs(intval($_POST['n34'])); $n35 = abs(intval($_POST['n35'])); $n36 = abs(intval($_POST['n36'])); $e = abs(intval($_POST['e'])); $o = abs(intval($_POST['o'])); $teen = abs(intval($_POST['teen'])); $teen1 = abs(intval($_POST['teen1'])); $black = abs(intval($_POST['black'])); $red = abs(intval($_POST['red'])); $twelve = abs(intval($_POST['twelve'])); $dtv = abs(intval($_POST['dtv'])); $vtz = abs(intval($_POST['vtz'])); $ek = abs(intval($_POST['ek'])); $tk = abs(intval($_POST['tk'])); $dk = abs(intval($_POST['dk'])); if (!empty($_POST['go4'])) { $bet = $n0 + $n1 + $n2 + $n3 + $n4 + $n5 + $n6 + $n7 + $n8 + $n9 + $n10 + $n11 + $n12 + $n13 + $n14 + $n15 + $n16 + $n17 + $n18 + $n19 + $n20 + $n21 + $n22 + $n23 + $n24 + $n25 + $n26 + $n27 + $n28 + $n29 + $n30 + $n31 + $n32 + $n33 + $n34 + $n35 + $n36 + $e + $o + $teen + $teen1 + $black + $red + $twelve + $dtv + $vtz + $ek + $dk + $tk; $maxbet = 50000; $minbet = 1000; if ($bet > $ir['money']) { print "<hr width='50%'>Please read the error message.<hr width='50%'><h3>! ERROR</h3>You do not have that much money!<br /><br /> <hr width='50%'><a href='index.php'>> Go Home</a><hr width='50%'><br />"; $h->endpage(); exit; } if ($bet > $maxbet) { print "<hr width='50%'>Please read the error message.<hr width='50%'><h3>! ERROR</h3>You cannot bet that much money!<br /><br /> <hr width='50%'><a href='roulette.php'>> Go Back</a><hr width='50%'><br />"; $h->endpage(); exit; } if ($bet < $minbet) { print "<hr width='50%'>Please read the error message.<hr width='50%'><h3>! ERROR</h3>You need to place more money to the bet!<br /><br /> <hr width='50%'><a href='roulette.php'>> Go Back</a><hr width='50%'><br />"; $h->endpage(); exit;; } $nmoney = 0; if ($number == 1) { $nmoney = $nmoney + $n1 * 35; $on = 1; } elseif ($number == 2) { $nmoney = $nmoney + $n2 * 35; $on = 2; } elseif ($number == 3) { $nmoney = $nmoney + $n3 * 35; $on = 3; } elseif ($number == 4) { $nmoney = $nmoney + $n4 * 35; $on = 4; } elseif ($number == 5) { $nmoney = $nmoney + $n5 * 35; $on = 5; } elseif ($number == 6) { $nmoney = $nmoney + $n6 * 35; $on = 6; } elseif ($number == 7) { $nmoney = $nmoney + $n7 * 35; $on = 7; } elseif ($number == 8) { $nmoney = $nmoney + $n8 * 35; $on = 8; } elseif ($number == 9) { $nmoney = $nmoney + $n9 * 35; $on = 9; } elseif ($number == 10) { $nmoney = $nmoney + $n10 * 35; $on = 10; } elseif ($number == 11) { $nmoney = $nmoney + $n11 * 35; $on = 11; } elseif ($number == 12) { $nmoney = $nmoney + $n12 * 35; $on = 12; } elseif ($number == 13) { $nmoney = $nmoney + $n13 * 35; $on = 13; } elseif ($number == 14) { $nmoney = $nmoney + $n14 * 35; $on = 14; } elseif ($number == 15) { $nmoney = $nmoney + $n15 * 35; $on = 15; } elseif ($number == 16) { $nmoney = $nmoney + $n16 * 35; $on = 16; } elseif ($number == 17) { $nmoney = $nmoney + $n17 * 35; $on = 17; } elseif ($number == 18) { $nmoney = $nmoney + $n18 * 35; $on = 18; } elseif ($number == 19) { $nmoney = $nmoney + $n19 * 35; $on = 19; } elseif ($number == 20) { $nmoney = $nmoney + $n20 * 35; $on = 20; } elseif ($number == 21) { $nmoney = $nmoney + $n21 * 35; $on = 21; } elseif ($number == 22) { $nmoney = $nmoney + $n22 * 35; $on = 22; } elseif ($number == 23) { $nmoney = $nmoney + $n23 * 35; $on = 23; } elseif ($number == 24) { $nmoney = $nmoney + $n24 * 35; $on = 24; } elseif ($number == 25) { $nmoney = $nmoney + $n25 * 35; $on = 25; } elseif ($number == 26) { $nmoney = $nmoney + $n26 * 35; $on = 26; } elseif ($number == 27) { $nmoney = $nmoney + $n27 * 35; $on = 27; } elseif ($number == 28) { $nmoney = $nmoney + $n28 * 35; $on = 28; } elseif ($number == 29) { $nmoney = $nmoney + $n29 * 35; $on = 29; } elseif ($number == 30) { $nmoney = $nmoney + $n30 * 35; $on = 30; } elseif ($number == 31) { $nmoney = $nmoney + $n31 * 35; $on = 31; } elseif ($number == 32) { $nmoney = $nmoney + $n32 * 35; $on = 32; } elseif ($number == 33) { $nmoney = $nmoney + $n33 * 35; $on = 33; } elseif ($number == 34) { $nmoney = $nmoney + $n34 * 35; $on = 34; } elseif ($number == 35) { $nmoney = $nmoney + $n35 * 35; $on = 35; } elseif ($number == 36) { $nmoney = $nmoney + $n36 * 35; $on = 36; } else { $nmoney = ""; } // odd or even if ($number % 2 == 0) { $type = "even"; } else { $type = "odd"; } if ($type == "odd") { $nmoney = $nmoney + $o * 2; } elseif ($type == "even") { $nmoney = $nmoney + $e * 2; } //Low or high if ($nummer >= 19) { $nmoney = $nmoney + $high * 2; } elseif ($nummer >= 0) { $nmoney = $nmoney + $low * 2; } $red = $_POST['red']; $black = $_POST['black']; $red22 = array( "1" => "1", "2" => "3", "3" => "5", "4" => "7", "5" => "9", "6" => "12", "7" => "14", "8" => "16", "9" => "18", "10" => "19", "11" => "21", "12" => "23", "13" => "25", "14" => "27", "15" => "30", "16" => "32", "17" => "34", "18" => "36" ); $ii = 1; while ($ii < 18) { if ($red22[$ii] == $number) { $colour1 = red; $nmoney = $nmoney + $red * 2; } /////////////////////////////////////////////need to fix coloums!!!! $ii++; } if ($colour1 == "") { $black1 = array( "1" => "2", "2" => "4", "3" => "6", "4" => "8", "5" => "10", "6" => "13", "7" => "15", "8" => "17", "9" => "20", "10" => "22", "11" => "24", "12" => "26", "13" => "28", "14" => "29", "15" => "31", "16" => "33", "17" => "35" ); $iii = 0; while ($iii < 18) { if ($black1[$iii] == $number) { $colour1 = black; $nmoney = $nmoney + $black * 2; } $iii++; } } //fine $one218 = array( "0" => "1", "1" => "2", "2" => "3", "3" => "4", "4" => "5", "5" => "6", "6" => "7", "7" => "8", "8" => "9", "9" => "10", "10" => "11", "11" => "12", "12" => "13", "13" => "14", "14" => "15", "15" => "16", "16" => "17", "17" => "18" ); $part = 0; while ($part < 17) { if ($one218[$part] == $number) { $nmoney = $nmoney + $teen * 2; } $part++; } $teen236 = array( "0" => "19", "1" => "20", "2" => "21", "3" => "22", "4" => "23", "5" => "24", "6" => "25", "7" => "26", "8" => "27", "9" => "28", "10" => "29", "11" => "30", "12" => "31", "13" => "32", "14" => "33", "15" => "34", "16" => "35", "17" => "36" ); $part1 = 0; while ($part1 < 17) { if ($teen236[$part1] == $number) { $nmoney = $nmoney + $teen1 * 2; } $part1++; } $one212 = array( "0" => "1", "1" => "2", "2" => "3", "3" => "4", "4" => "5", "5" => "6", "6" => "7", "7" => "8", "8" => "9", "9" => "10", "10" => "11", "11" => "12" ); $part2 = 0; while ($part2 < 11) { if ($one212[$part2] == $number) { $nmoney = $nmoney + $twelve * 3; } $part2++; } $teen2244 = array( "0" => "13", "1" => "14", "2" => "15", "3" => "16", "4" => "17", "5" => "18", "6" => "19", "7" => "20", "8" => "21", "9" => "22", "10" => "23", "11" => "24" ); $part3 = 0; while ($part3 < 11) { if ($teen2244[$part3] == $number) { $nmoney = $nmoney + $dtv * 3; } $part3++; } $twen5 = array( "0" => "25", "1" => "26", "2" => "27", "3" => "28", "4" => "29", "5" => "30", "6" => "31", "7" => "32", "8" => "33", "9" => "34", "10" => "35", "11" => "36" ); $part4 = 0; while ($part4 < 11) { if ($twen5[$part4] == $number) { $nmoney = $nmoney + $vtz * 3; } $part4++; } $small = array( "0" => "1", "1" => "5", "2" => "9", "3" => "13", "4" => "17", "5" => "21", "6" => "25", "7" => "29", "8" => "33" ); $part5 = 0; while ($part5 < 8) { if ($small[$part5] == $number) { $nmoney = $nmoney + $ek * 3; } $part5++; } $small1 = array( "0" => "1", "1" => "5", "2" => "9", "3" => "13", "4" => "17", "5" => "21", "6" => "25", "7" => "29", "8" => "33" ); $part6 = 0; while ($part6 < 8) { if ($small1[$part6] == $number) { $nmoney = $nmoney + $tk * 3; } $part6++; } $small2 = array( "0" => "1", "1" => "5", "2" => "9", "3" => "13", "4" => "17", "5" => "21", "6" => "25", "7" => "29", "8" => "33" ); $part7 = 0; while ($part7 < 8) { if ($small2[$part7] == $number) { $nmoney = $nmoney + $dk * 3; } $part7++; } $yougot = $nmoney - $bet; } ?> <table width="75%" border="0" cellspacing="0" cellpadding="0" > <tr> <td>Roulette</td> </tr> </table> <form method="post"> <table width="75%" border="0" cellspacing="0" cellpadding="0" > <tr> <td width="0%" height="48"> </td> <td width="0%"> </td> <td width="0%"> </td> <td width="0%"> </td> <td width="31%"> </td> <td COLSPAN="3" align="center">0 <input name=n0 type=text class="text" ID="n0" size=8 maxlength="10"></td> </tr> <tr> <td height="37"> </td> <td> </td> <td> </td> <td> </td> <td> Max Bet: $50,000 Minimum Bet: $1,000</td> <td width="23%" align="center">1 <input name=n1 type=text class="text" ID="n1" size=8 maxlength="10"></td> <td width="23%" align="center">2 <input name=n2 type=text class="text" ID="n2" size=8 maxlength="10"></td> <td width="23%" align="center">3 <input name=n3 type=text class="text" ID="n3" size=8 maxlength="10"></td> </tr> <tr> <td height="30"> </td> <td> </td> <td> </td> <td> </td> <td align="center"><h2>Money $<? echo number_format($ir['money']); ?></h2></td> <td align="center">4 <input name=n4 type=text class="text" ID="n4" size=8 maxlength="10"></td> <td align="center">5 <input name=n5 type=text class="text" ID="n5" size=8 maxlength="10"></td> <td align="center">6 <input name=n6 type=text class="text" ID="n6" size=8 maxlength="10"></td> </tr> <tr> <td height="31"> </td> <td> </td> <td> </td> <td> </td> <td align="center"><?php if (!empty($_POST['go4'])) { if ($yougot <= 0) { echo " <h3>Wheel Number " . $number . "</h3> <font color='#ff000'>you lost $" . number_format($bet) . "</font>"; $result = mysql_query("UPDATE `users` SET money=money-$bet WHERE `userid`='" . $userid . "'"); } elseif ($yougot > 0) { echo "<h3>Wheel Number " . $number . "</h3> <font color='green'>Congratulations you won $" . number_format($nmoney) . "</font>"; $result = mysql_query("UPDATE `users` SET money=money+$nmoney WHERE `userid`='" . $userid . "'"); } } ?> </td> <td align="center">7 <input name=n7 type=text class="text" ID="n7" size=8 maxlength="10"></td> <td align="center">8 <input name=n8 type=text class="text" ID="n8" size=8 maxlength="10"></td> <td align="center">9 <input name=n9 type=text class="text" ID="n9" size=8 maxlength="10"></td> </tr> <tr> <td height="35"> </td> <td> </td> <td> </td> <td> </td> <td rowspan="12"><img src="images/roulettetable.gif" width="250" height="329"></td> <td align="center">10 <input name=n10 type=text class="text" ID="n10" size=8 maxlength="10"></td> <td align="center">11 <input name=n11 type=text class="text" ID="n11" size=8 maxlength="10"></td> <td align="center">12 <input name=n12 type=text class="text" ID="n12" size=8 maxlength="10"></td> </tr> <tr> <td height="34"> </td> <td> </td> <td> </td> <td> </td> <td align="center">13 <input name=n13 type=text class="text" ID="n13" size=8 maxlength="10"></td> <td align="center">14 <input name=n14 type=text class="text" ID="n14" size=8 maxlength="10"></td> <td align="center">15 <input name=n15 type=text class="text" ID="n15" size=8 maxlength="10"></td> </tr> <tr> <td height="34"> </td> <td COLSPAN="3"> </td> <td align="center">16 <input name=n16 type=text class="text" ID="n16" size=8 maxlength="10"></td> <td align="center">17 <input name=n17 type=text class="text" ID="n17" size=8 maxlength="10"></td> <td align="center">18 <input name=n18 type=text class="text" ID="n18" size=8 maxlength="10"></td> </tr> <tr> <td height="35"> </td> <td COLSPAN="3"> </td> <td align="center">19 <input name=n19 type=text class="text" ID="n19" size=8 maxlength="10"></td> <td align="center">20 <input name=n20 type=text class="text" ID="n20" size=8 maxlength="10"></td> <td align="center">21 <input name=n21 type=text class="text" ID="n21" size=8 maxlength="10"></td> </tr> <tr> <td height="38"> </td> <td> </td> <td> </td> <td> </td> <td align="center">22 <input name=n22 type=text class="text" ID="n22" size=8 maxlength="10"></td> <td align="center">23 <input name=n23 type=text class="text" ID="n23" size=8 maxlength="10"></td> <td align="center">24 <input name=n24 type=text class="text" ID="n24" size=8 maxlength="10"></td> </tr> <tr> <td height="33"> </td> <td> </td> <td> </td> <td> </td> <td align="center">25 <input name=n25 type=text class="text" ID="n25" size=8 maxlength="10"></td> <td align="center">26 <input name=n26 type=text class="text" ID="n26" size=8 maxlength="10"></td> <td align="center">27 <input name=n27 type=text class="text" ID="n27" size=8 maxlength="10"></td> </tr> <tr> <td height="37"> </td> <td> </td> <td> </td> <td> </td> <td align="center">28 <input name=n28 type=text class="text" ID="n28" size=8 maxlength="10"></td> <td align="center">29 <input name=n29 type=text class="text" ID="n29" size=8 maxlength="10"></td> <td align="center">30 <input name=n30 type=text class="text" ID="n30" size=8 maxlength="10"></td> </tr> <tr> <td height="35"> </td> <td> </td> <td> </td> <td> </td> <td align="center">31 <input name=n31 type=text class="text" ID="n31" size=8 maxlength="10"></td> <td align="center">32 <input name=n32 type=text class="text" ID="n32" size=8 maxlength="10"></td> <td align="center">33 <input name=n33 type=text class="text" ID="n33" size=8 maxlength="10"></td> </tr> <tr> <td height="32"> </td> <td> </td> <td> </td> <td> </td> <td align="center">34 <input name=n34 type=text class="text" ID="n34" size=8 maxlength="10"></td> <td align="center">35 <input name=n35 type=text class="text" ID="n35" size=8 maxlength="10"></td> <td align="center">36 <input name=n36 type=text class="text" ID="n36" size=8 maxlength="10"></td> </tr> <tr> <td height="40"> </td> <td> </td> <td> </td> <td> </td> <td align="center">odd <input name=o type=text class="text" SIZE=8 maxlength="10"></td> <td align="center">19- 36 <input name=teen type=text class="text" ID="teen" size=8 maxlength="10"></td> <td align="center">Even <input name=e type=text class="text" SIZE=8 maxlength="10"></td> </tr> <tr> <td height="53"> </td> <td> </td> <td> </td> <td> </td> <td align="center">red <input name=red type=text class="text" SIZE=8 maxlength="10"></td> <td align="center">1 - 18 <input name=teen type=text class="text" ID="teen" SIZE=8 maxlength="10"></td> <td align="center">black <input name=black type=text class="text" SIZE=8 maxlength="10"></td> </tr> <tr> <td height="58"> </td> <td> </td> <td> </td> <td> </td> <td align="center">1 -12 <input name=twelve type=text class="text" ID="twelve" SIZE=8 maxlength="10"></td> <td align="center">13 -24 <input name=dtv type=text class="text" SIZE=8 maxlength="10"></td> <td align="center">25-36 <input name=vtz type=text class="text" SIZE=8 maxlength="10"></td> </tr> <tr> <td height="65"> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td align="center">1st column <input name=ek type=text class="text" SIZE=8 maxlength="10"></td> <td align="center">2nd column <input name=tk type=text class="text" SIZE=8 align="10"></td> <td align="center">3rd column <input name=dk type=text class="text" SIZE=8 maxlength="10"></td> </tr> <tr> <td height="37"> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td align="center"><input name='go4' type=submit class="buttong" value=Bet> <input type=reset class="buttong" value=Reset></td> <td> </td> </tr> </table></form> <table width="75%" border="0" cellspacing="0" cellpadding="0" > <tr> <td> </td> </tr> </table> <?php $h->endpage(); ?> I neatened it bit.
-
So I have no idea why this roulette mod I found on mwg coming out disfigured? If someone can fix this up for me will be great... [ATTACH=CONFIG]1269[/ATTACH] <?php session_start(); require "global_func.php"; if ($_SESSION['loggedin'] == 0) { header("Location: login.php"); exit; } $userid = $_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is = mysql_query( "SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid", $c) or die(mysql_error()); $ir = mysql_fetch_array($is); check_level(); $fm = money_formatter($ir['money']); $cm = money_formatter($ir['crystals'], ''); $lv = date('F j, Y, g:i a', $ir['laston']); $h->userdata($ir, $lv, $fm, $cm); $h->menuarea(); function getAvailableCash( ) { global $ir; return $ir['money']; } function getMaximumBet( ) { global $ir; return min($ir['level'] * 150, getAvailableCash()); } function creditPlayer( $amount ) { global $db, $userid, $ir; $sql = sprintf("UPDATE `users` SET `money` = `money` + %u WHERE (`userid` = %u)", $amount, $userid); mysql_query($sql); $ir['money'] += $amount; } function debitPlayer( $amount ) { global $db, $userid, $ir; $sql = sprintf("UPDATE `users` SET `money` = GREATEST(0, `money` - %u) WHERE (`userid` = %u)", $amount, $userid); mysql_query($sql); $ir['money'] = max(0, $ir['money'] - $amount); } function pageFooter( ) { global $h; $h->endpage(); } function lookupBet( $bet ) { $data = array ( '0' => "0,35,0", '00' => "00,35,00", '1' => "1,35,1", '2' => "2,35,2", '3' => "3,35,3", '4' => "4,35,4", '5' => "5,35,5", '6' => "6,35,6", '7' => "7,35,7", '8' => "8,35,8", '9' => "9,35,9", '10' => "10,35,10", '11' => "11,35,11", '12' => "12,35,12", '13' => "13,35,13", '14' => "14,35,14", '15' => "15,35,15", '16' => "16,35,16", '17' => "17,35,17", '18' => "18,35,18", '10' => "19,35,19", '20' => "20,35,20", '21' => "21,35,21", '22' => "22,35,22", '23' => "23,35,23", '24' => "24,35,24", '25' => "25,35,25", '26' => "26,35,26", '27' => "27,35,27", '28' => "28,35,28", '29' => "29,35,29", '30' => "30,35,30", '31' => "31,35,31", '32' => "32,35,32", '33' => "33,35,33", '34' => "34,35,34", '35' => "35,35,35", '36' => "36,35,36", 'R0' => "Row 0,17,0-00", 'R1' => "Row 1,11,1-2-3", 'R2' => "Row 2,11,4-5-6", 'R3' => "Row 3,11,7-8-9", 'R4' => "Row 4,11,10-11-12", 'R5' => "Row 5,11,13-14-15", 'R6' => "Row 6,11,16-17-18", 'R7' => "Row 7,11,19-20-21", 'R8' => "Row 8,11,22-23-24", 'R9' => "Row 9,11,25-26-27", 'R10' => "Row 10,11,28-29-30", 'R11' => "Row 11,11,31-32-33", 'R12' => "Row 12,11,34-35-36", 'C1' => "Column 1,2,1-4-7-10-13-16-19-22-25-28-31-34", 'C2' => "Column 2,2,2-5-8-11-14-17-20-23-26-29-32-35", 'C3' => "Column 3,2,3-6-9-12-15-18-21-24-27-30-33-36", 'F12' => "First 12,2,1-2-3-4-5-6-7-8-9-10-11-12", 'M12' => "Second 12,2,13-14-15-16-17-18-19-20-21-22-23-24", 'L12' => "Third 12,2,25-26-27-28-29-30-31-32-33-34-35-36", 'F18' => "First 18,1,1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16-17-18", 'L18' => "Last 18,1,19-20-21-22-23-24-25-26-27-28-29-30-31-32-33-34-35-36", 'ODD' => "Odd,1,1-3-5-7-9-11-13-15-17-19-21-23-25-27-29-31-33-35", 'EVEN' => "Even,1,2-4-6-8-10-12-14-16-18-20-22-24-26-28-30-32-34-36", 'RED' => "Red,1,1-3-5-7-9-12-14-16-18-19-21-23-25-27-30-32-34-36", 'BLACK' => "Black,1,2-4-6-8-10-11-13-15-17-20-22-24-26-28-29-31-33-35", ); if (is_string($bet)) { $bet = strtoupper(trim($bet)); if (strlen($bet) && isset($data[$bet])) { list($name, $payoff, $numbers) = explode(",", $data[$bet]); return array('name' => $name, 'payoff' => $payoff, 'numbers' => explode("-", $numbers)); } } return null; } function formatLink( $text, $link ) { $found = false; foreach ($_SESSION['roulette']['bets'] as $bet) if ($bet == $link) $found = lookupBet($bet); if ($found) return sprintf("[img=/images/roulette.png]", $found['name'], $found['name']); if (count($_SESSION['roulette']['bets']) == 5) return $text; else return sprintf("<a href='roulette.php?action=place&bet=%s'>%s</a>", $link, $text); } function renderPage( $spun = null, $winAmount = null, $betAmount = null ) { $green_background = "#3C3"; $red_background = "#F33"; $black_background = "#333"; $border_color = "#333"; $green_link = "#111"; $red_link = "#EEE"; $black_link = "#EEE"; echo "<style type='text/css'>"; echo "table.roulette-table { border-collapse:collapse; }"; echo sprintf("table.roulette-table td { text-align:center; padding:0.5em; border:solid 1px %s; }", $border_color); echo sprintf("table.roulette-table td.g { background:%s; }", $green_background); echo sprintf("table.roulette-table td.r { background:#F33;color:#EEE; }", $red_background); echo sprintf("table.roulette-table td.b { background:#333;color:#EEE; }", $black_background); echo sprintf("table.roulette-table td.g a { color: #111; }", $green_link); echo sprintf("table.roulette-table td.r a { color: #EEE; }", $red_link); echo sprintf("table.roulette-table td.b a { color: #EEE; }", $black_link); echo "</style>"; echo "<h3>Roulette</h3>"; echo "<table cellpadding='0' cellspacing='0' style='width:95%;'>"; echo "<tr>"; echo "<td align='left' style='vertical-align:top;'>"; echo "You may place up to 5 bets before 'spinning' the wheel…"; echo " "; $bets = $_SESSION['roulette']['bets']; $i = 0; $numbers = array(); foreach ($bets as $bet) { $info = lookupBet($bet); foreach ($info['numbers'] as $number) $numbers[$number] = true; echo sprintf(" Bet #%u: %s (<a href='roulette.php?action=clear&bet=%s'>Clear</a>) ", ++$i, $info['name'], $bet); } if ($i) { echo " "; echo " <a href='roulette.php?action=reset'>Clear All</a>"; echo " "; echo "Winning numbers: "; $numbers = array_keys($numbers); sort($numbers); for ($i = 0, $count = count($numbers); $i < $count; $i++) echo sprintf("%s%s%u", $i % 6 ? "" : " ", $i % 6 ? ", " : "", $numbers[$i]); echo " "; } echo sprintf("You may bet up to a maximum of $%s ", number_format(getMaximumBet())); echo sprintf(" Current bet: $%s ", number_format($_SESSION['roulette']['cash'])); $bets = array(5, 25, 50, 100, 250, 500, 1000, 2500, 5000); echo sprintf(" Bet: "); for ($i = 0, $count = count($bets); $i < $count; $i++) echo sprintf("%s<a href='roulette.php?action=money&amount=%u'>$%s</a>", $i ? ", " : "", $bets[$i], number_format($bets[$i])); echo " "; if (!is_null($spun)) { if ($winAmount > 0) { echo sprintf("<span style='color:#070;'><b>%u</b> – Congratulations, you win $%s</span>", $spun, number_format($winAmount)); } else { echo sprintf("<span style='color:#700;'><b>%u</b> – Sorry, you lose $%s</span>", $spun, number_format($betAmount)); } } else { echo "Spin the wheel to gamble…"; } echo " "; echo "<form action='roulette.php?action=play' method='post'>"; echo "<input type='submit' value='Spin the Wheel' />"; echo "</form>"; echo "</td>"; echo "<td align='right' style='vertical-align:top;'>"; echo "<table cellpadding='0' cellspacing='0' border='1' class='roulette-table'>"; echo "<tr>"; echo "<td class='g' colspan='2'></td>"; echo "<td class='g'>" . formatLink("0", "0") . "</td>"; echo "<td class='g'></td>"; echo "<td class='g'>" . formatLink("00", "00") . "</td>"; echo "<td class='g'>" . formatLink("«", "R0") . "</td>"; echo "</tr>"; echo "<tr>"; echo "<td class='g' rowspan='2'>" . formatLink("1 to 18", "F18") . "</td>"; echo "<td class='g' rowspan='4'>" . formatLink("1<sup>st</sup> 12", "F12") . "</td>"; echo "<td class='r'>" . formatLink("1", "1") . "</td>"; echo "<td class='b'>" . formatLink("2", "2") . "</td>"; echo "<td class='r'>" . formatLink("3", "3") . "</td>"; echo "<td class='g'>" . formatLink("«", "R1") . "</td>"; echo "</tr>"; echo "<tr>"; echo "<td class='b'>" . formatLink("4", "4") . "</td>"; echo "<td class='r'>" . formatLink("5", "5") . "</td>"; echo "<td class='b'>" . formatLink("6", "6") . "</td>"; echo "<td class='g'>" . formatLink("«", "R2") . "</td>"; echo "</tr>"; echo "<tr>"; echo "<td class='g' rowspan='2'>" . formatLink("ODD", "ODD") . "</td>"; echo "<td class='r'>" . formatLink("7", "7") . "</td>"; echo "<td class='b'>" . formatLink("8", "8") . "</td>"; echo "<td class='r'>" . formatLink("9", "9") . "</td>"; echo "<td class='g'>" . formatLink("«", "R3") . "</td>"; echo "</tr>"; echo "<tr>"; echo "<td class='b'>" . formatLink("10", "10") . "</td>"; echo "<td class='r'>" . formatLink("11", "11") . "</td>"; echo "<td class='b'>" . formatLink("12", "12") . "</td>"; echo "<td class='g'>" . formatLink("«", "R4") . "</td>"; echo "</tr>"; echo "<tr>"; echo "<td class='r' rowspan='2'>" . formatLink("RED", "RED") . "</td>"; echo "<td class='g' rowspan='4'>" . formatLink("2<sup>nd</sup> 12", "M12") . "</td>"; echo "<td class='r'>" . formatLink("13", "13") . "</td>"; echo "<td class='b'>" . formatLink("14", "14") . "</td>"; echo "<td class='r'>" . formatLink("15", "15") . "</td>"; echo "<td class='g'>" . formatLink("«", "R5") . "</td>"; echo "</tr>"; echo "<tr>"; echo "<td class='b'>" . formatLink("16", "16") . "</td>"; echo "<td class='r'>" . formatLink("17", "17") . "</td>"; echo "<td class='b'>" . formatLink("18", "18") . "</td>"; echo "<td class='g'>" . formatLink("«", "R6") . "</td>"; echo "</tr>"; echo "<tr>"; echo "<td class='b' rowspan='2'>" . formatLink("BLACK", "BLACK") . "</td>"; echo "<td class='r'>" . formatLink("19", "19") . "</td>"; echo "<td class='b'>" . formatLink("20", "20") . "</td>"; echo "<td class='r'>" . formatLink("21", "21") . "</td>"; echo "<td class='g'>" . formatLink("«", "R7") . "</td>"; echo "</tr>"; echo "<tr>"; echo "<td class='b'>" . formatLink("22", "22") . "</td>"; echo "<td class='r'>" . formatLink("23", "23") . "</td>"; echo "<td class='b'>" . formatLink("24", "24") . "</td>"; echo "<td class='g'>" . formatLink("«", "R8") . "</td>"; echo "</tr>"; echo "<tr>"; echo "<td class='g' rowspan='2'>" . formatLink("EVEN", "EVEN") . "</td>"; echo "<td class='g' rowspan='4'>" . formatLink("3<sup>rd</sup> 12", "L12") . "</td>"; echo "<td class='r'>" . formatLink("25", "25") . "</td>"; echo "<td class='b'>" . formatLink("26", "26") . "</td>"; echo "<td class='r'>" . formatLink("27", "27") . "</td>"; echo "<td class='g'>" . formatLink("«", "R9") . "</td>"; echo "</tr>"; echo "<tr>"; echo "<td class='b'>" . formatLink("28", "28") . "</td>"; echo "<td class='r'>" . formatLink("29", "29") . "</td>"; echo "<td class='b'>" . formatLink("30", "30") . "</td>"; echo "<td class='g'>" . formatLink("«", "R10") . "</td>"; echo "</tr>"; echo "<tr>"; echo "<td class='g' rowspan='2'>" . formatLink("19 to 36", "L18") . "</td>"; echo "<td class='r'>" . formatLink("31", "31") . "</td>"; echo "<td class='b'>" . formatLink("32", "32") . "</td>"; echo "<td class='r'>" . formatLink("33", "33") . "</td>"; echo "<td class='g'>" . formatLink("«", "R11") . "</td>"; echo "</tr>"; echo "<tr>"; echo "<td class='b'>" . formatLink("34", "34") . "</td>"; echo "<td class='r'>" . formatLink("35", "35") . "</td>"; echo "<td class='b'>" . formatLink("36", "36") . "</td>"; echo "<td class='g'>" . formatLink("«", "R12") . "</td>"; echo "</tr>"; echo "<tr>"; echo "<td class='g' colspan='2'></td>"; echo "<td class='g'>" . formatLink("^", "C1") . "</td>"; echo "<td class='g'>" . formatLink("^", "C2") . "</td>"; echo "<td class='g'>" . formatLink("^", "C3") . "</td>"; echo "<td class='g'></td>"; echo "</tr>"; echo "</table>"; echo "</td>"; echo "</tr>"; echo "</table>"; } if (!isset($_SESSION['roulette'])) { $_SESSION['roulette'] = array ( 'bets' => array(), 'cash' => 0, ); } function act_index( ) { renderPage(); } function act_place( ) { if (is_string($_GET['bet'])) { $bet = strtoupper(trim($_GET['bet'])); if (strlen($bet)) { if (!is_null($info = lookupBet($bet))) { if (count($_SESSION['roulette']['bets']) < 5) { $duplicate = false; foreach ($_SESSION['roulette']['bets'] as $temp) if ($temp == $bet) $duplicate = true; if (!$duplicate) $_SESSION['roulette']['bets'][] = $bet; } } } } renderPage(); } function act_clear( ) { if (is_string($_GET['bet'])) { $bet = strtoupper(trim($_GET['bet'])); if (strlen($bet)) { if (!is_null($info = lookupBet($bet))) { $bets = array(); foreach ($_SESSION['roulette']['bets'] as $temp) if ($temp != $bet) $bets[] = $temp; $_SESSION['roulette']['bets'] = $bets; } } } renderPage(); } function act_reset( ) { $_SESSION['roulette']['bets'] = array(); renderPage(); } function act_money( ) { $amount = isset($_GET['amount']) && is_string($_GET['amount']) && preg_match("`^\d+$`ims", $_GET['amount']) ? @intval($_GET['amount']) : null; if (!is_null($amount)) $_SESSION['roulette']['cash'] = min($amount, getMaximumBet()); renderPage(); } function act_play( ) { if (!count($_SESSION['roulette']['bets'])) return act_index(); $_SESSION['roulette']['cash'] = min($_SESSION['roulette']['cash'], getMaximumBet()); if (!$_SESSION['roulette']['cash']) return act_index(); $wheel = "0-28-9-26-30-11-7-20-32-17-5-22-34-15-3-24-36-13-1-00-27-10-25-29-12-8-19-31-18-6-21-33-16-4-23-35-14-2"; $slots = explode("-", $wheel); $count = count($slots); $spin = $slots[mt_rand(1, $count)]; $cash = $_SESSION['roulette']['cash']; $count = count($_SESSION['roulette']['bets']); $split = $cash / $count; $win = 0; $lose = 0; foreach ($_SESSION['roulette']['bets'] as $bet) { $info = lookupBet($bet); if (in_array($spin, $info['numbers'])) { $payoff = $info['payoff'] * $split; $win += $split + $payoff; } else $lose += $split; } if ($lose) debitPlayer(ceil($lose)); if ($win) creditPlayer(floor($win)); $_SESSION['roulette']['cash'] = min($_SESSION['roulette']['cash'], getMaximumBet()); renderPage($spin, $win, $cash); } $actions = array ( 'index' => "act_index", 'place' => "act_place", 'clear' => "act_clear", 'reset' => "act_reset", 'money' => "act_money", 'play' => "act_play", ); $keys = array_keys($actions); $action = isset($_GET['action']) && is_string($_GET['action']) && preg_match("`^((" . implode(")|(", $keys) . "))$`ims", $_GET['action']) ? strtolower($_GET['action']) : array_shift($keys); $actions[$action](); pageFooter(); ?>
-
God dammit, I used both of the searches!!!
-
Not yet, as I have no money...I would have paid. But I know there is some free ones about...I cant find them :/
-
Hello all, i really need help from all of you's! I need 'free' modifications for my game. I need casino types of modification. I am begging you all to help me out. If someone can send me some modifications that will be great. Please send it to, [email protected]. I am begging you to help me out. I need - Blackjack Roulette High or Low Slots Cherry Slots I need them to be fun, not normal MCCodes ones. Something that will intrest my members.
-
I like it. But it's not my style :( I like the menubar on left...not top... But then thats my opinion....
-
Game folder writable Failed Probably the host?
-
Hello, I have a template with no css. I have the index.html but thats pretty useless :/ There is the template. If anyone can do the css and re-do the index.html. I will be willing to give out this template. Yes I have permission to do so.
-
You can make a template like that with css only :D But I like it, if you could change colors...My opinion I dont like green XD
-
So what if he ripping people ideas off? Unlike some people they steal and claim it as theirs. He made the template, he made it.
-
I read it, I tried but I always fail! Can someone help me?
-
Thanks Newbie and Kyle! But Kyle I still get an error? Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/8888/public_html/new_staff/staff_menu.php on line 26 Line - 26 if ($ir['users'] == 1 && $ir['punish_two'] == 1 && $ir['announcement'] == 1 && $ir['staff_application'] == 1 && $ir['staff'] == 1)
-
Hello all, my main menu ain't working. The link to my menu - http://pastebin.com/LhvsHgnd. Error - Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/****/public_html/new_staff/staff_menu.php on line 162 Anyone can help me out?
-
Thanks Kyle, I will check that out now :) I got my own VPS, so I think I got a good host xD
-
MailChimp, I will look into that. Thank you Angle for your response :)
-
Hello there, I need someone to help me out. Well I need a modification to be built for me. I need someone too make a file and send an email to everyone in my game. It can only send email to people who are not in federal jail. If someone can do this for me I would be really happy! Or if there is one made can someone please send me the link as I am looking for one! Good day and thanks. UPDATE - I tried too make one myself, how ever I have failed to? Everytime I send an email it does not get sent to me? <?php session_start(); require "../global_func.php"; if ($_SESSION['loggedin'] == 0) { header("Location:../login.php"); exit; } $userid = $_SESSION['userid']; require "staff_header.php"; $h = new headers; $h->startheaders(); include "staff_mysql.php"; global $c; $is = mysql_query( "SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid", $c) or die(mysql_error()); $ir = mysql_fetch_array($is); check_level(); $fm = money_formatter($ir['money']); $cm = money_formatter($ir['crystals'], ''); $lv = date('F j, Y, g:i a', $ir['laston']); $h->userdata($ir, $lv, $fm, $cm); $h->staffarea(); if (!in_array($ir['user_level'], array(2))) { echo 'This page cannot be accessed.<br />> <a href="index.php">Go Home</a>'; die; } switch($_GET['action']) { case 'sendmail' : send_mail(); break; default: mail_index(); break; } function mail_index() { global $ir,$h; echo"<h3><u>Mass Emailer</u></h3>"; echo"<form action='staff_email.php?action=sendmail' method='post'> <table width=75% cellspacing=1 class='table'> <tr style='background: gray; '> <th colspan = 2>Email</th> </tr> <tr><td>Email: </td><td><textarea rows=10 cols=50 name='email'></textarea></td></tr> <tr><td colspan='2'><center><input type='submit' value='Send Mass Email' /></form></center></td></tr></table>"; $h->endpage(); } function send_mail() { global $db,$ir,$c,$h,$userid; if($_POST['email'] == '') { print "You did not enter a anything."; $h->endpage(); exit; } $email=mysql_query("SELECT email FROM users WHERE userid = 1"); $r=mysql_fetch_array($email); $news=$_POST['email']; $to = "{$r['email']}"; $from = "[email protected]"; $subject = "NationOfTheLost Newsletter"; $message = <<<EOF <html> <b><small>Hi {$r['username']},</small></b> <br / > <small>{$news}</small><br /><br /> <small>That's all for this month!<br /><br /> <b>Thanks,<br /> Staff @ {$set['game_name']} </small></b> </html> EOF; $headers = "From: $from\r\n"; $headers .= "Content-type: text/html\r\n"; mail($to, $subject, $message, $headers); print "Email Sent."; $h->endpage(); } ?>
-
I think Peter summed it up :) But it hurts my eye :(
-
Hello all, I have a problem when ever I dump the item it always come out as blank? Any reasons why too? And if anyone could help me out that would be great! <?php session_start(); require "global_func.php"; if ($_SESSION['loggedin'] == 0) { header("Location: login.php"); exit; } $userid = $_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is = mysql_query( "SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid", $c) or die(mysql_error()); $ir = mysql_fetch_array($is); check_level(); $fm = money_formatter($ir['money']); $cm = money_formatter($ir['crystals'], ''); $lv = date('F j, Y, g:i a', $ir['laston']); $h->userdata($ir, $lv, $fm, $cm); $h->menuarea(); echo '<h3><u>Dump</u></h3><hr width="75%" />'; switch($_GET['step']) { case "dump": dump(); break; case "dump2": dump2(); break; case "search": search(); break; default: index(); } function index() { global $db, $ir, $c, $h, $userid; $num = mysql_query("SELECT * FROM `dump`"); echo '<br />Welcome to the dump, people all over the city come here to dump there crap. <br />There are currently <font color=blue><b>'.mysql_num_rows($num).'</b></font> items that are dumped.<br /><br /> > <a href="dump.php?step=search">Search the dump!</a><br /><br />'; } function dump2() { global $db, $ir, $c, $h, $userid; if($_POST) { $itemid = abs((int) $_GET['id']); $amount = abs((int) $_POST['amount']); $query = mysql_query("SELECT * FROM `inventory` WHERE `inv_userid` = {$ir['userid']} and inv_itemid = ".$itemid.""); $data = mysql_fetch_array($query); if($_POST['amount'] < 1) { echo '<br />You have to dump something to be able to dump it!<br /><br />'; } if($data['inv_qty'] < $_POST['amount']) { echo '<br />You do not have that many of this item to dump!<br /><br />'; } else { $query = mysql_query("SELECT * FROM `inventory` WHERE `inv_userid` = ".$userid.""); $data = mysql_fetch_array($query); item_remove($userid, $itemid, $_POST['amount']); for($i=1; $i <= $_POST['amount']; $i++) { mysql_query("INSERT INTO `dump` (dumpID, itmID, dumperID) VALUES (NULL, ".$itemid.", ".$userid.")"); } echo '<br />You have dumped '.$_POST['amount'].' '.getitmname($itemid).'(s)!<br /><br />'; } } } function dump() { global $db, $ir, $c, $h, $userid; echo " <br />Please pick which items you would like to dump.<br /><br /><hr width='75%' />"; echo" <table width='75%' cellspacing='1' class='table'><tr style='background:gray'> <th width='70%'>Name</th><th>Qty</th><th width='15%'>Amount</th><th width='15%'>Trash</th></tr>"; $query = mysql_query("SELECT * FROM `inventory` WHERE `inv_userid` = ".$userid.""); while($data=mysql_fetch_array($query)) { echo" <td>".getitmname($data['inv_itemid'])." </td> <td>x".$data['inv_qty']."</td> <td><input type=text name='amount' size='5' maxlength='5' value='0'></td> <form action=dump.php?step=dump2&id=".$data['inv_itemid']." method='post'> <td><input type='submit' value='Dump' /></td> </tr>"; } echo '<br /></form></table>'; } function search() { global $db, $ir, $c, $h, $userid; $energy=(int) ($ir['maxenergy']/100*10); $rfc =rand(1,5); $num = mysql_query("SELECT * FROM `dump`"); if ($energy >= $ir['energy']+1) { echo '<br />You do not have enough energy to search the dump any longer.<br /><br />'; } else if($rfc != 3) { echo '<br />You searched the dump for hours but couldn\'t find anything.<br /><br />> <a href="dump.php?step=search">Search again!</a><br /><br />'; mysql_query("UPDATE `users` SET `energy` = `energy` - {$energy} WHERE `userid` = ".$userid.""); } else if(mysql_num_rows($num) < 1) { echo '<br />You searched the dump for hours but couldn\'t find anything.<br /><br />> <a href="dump.php?step=search">Search again!</a><br /><br />'; mysql_query("UPDATE `users` SET `energy` = `energy` - {$energy} WHERE `userid` = ".$userid.""); } else { $query = mysql_query("SELECT * FROM `dump` ORDER BY RAND() LIMIT 0,1;"); while($data = mysql_fetch_array($query)) { $getname = mysql_query("SELECT `username` FROM `users` WHERE `userid` = ".$data['dumperID']."", $c); if(mysql_num_rows($getname)) { $a = mysql_fetch_array($getname); $name = '<a href="viewuser.php?u='.$data['dumperID'].'" alt="'.$a['username'].'">'.$a['username'].'</a>'; } else { $name = "Unknown"; } echo '<br />You searched the dump and find a <font color = gold>'.getitmname($data['itmID']).'</font> that was dumped by '.$name.'!'; item_add($userid, $data['itmID'], 1); mysql_query("UPDATE `users` SET `energy` = `energy` - {$energy} WHERE `userid` = ".$userid.""); mysql_query("DELETE FROM `dump` WHERE `dumpID`= ".$data['dumpID'].""); } echo'<br /><br />> <a href="dump.php?step=search">Search again!</a><br /><br />'; } } echo ' <hr width="75%" /><table width="75%"> <tr><td width="50%" align="center"> > <a href="dump.php">Back</a> </td><td width="50%" align="center"> > <a href="dump.php?step=dump" alt="Dump your items!">Dump Items</a> </td></tr></table><hr width="75%" /><br />'; function getitmname($itmid) { global $db, $ir, $c, $h, $userid; $getitem = mysql_query("SELECT `itmname` FROM `items` WHERE `itmid` = ".$itmid.""); if(mysql_num_rows($getitem)) { $itemData = mysql_fetch_array($getitem); $item = $itemData['itmname']; return $item; } } $h->endpage(); ?>
-
<?php require_once('globals_nonauth.php'); if ($argc == 2) { if ($argv[1] != $_CONFIG['code']) { exit; } } else if (!isset($_GET['code']) || $_GET['code'] !== $_CONFIG['code']) { exit; } ///Picks at random (The winner) $draw=mysql_query("SELECT * FROM userstatistics WHERE draw > 0 LIMIT 1"); $sql=mysql_fetch_array($draw); $draw2 = mysql_query("SELECT * FROM users WHERE userid = {$sql['userid']}"); $sql2=mysql_fetch_array($draw2); ///This is where the item is added item_add($sql2['userid'], ITEMID, 1); ///This is where the event is added event_add($sql2['userid'],"Congratulations, you are a winner of this weeks donators draw and have been credited a donator pack - offer 1"); ///This is where the annoucement is added $name="Donator Draw"; $announcement="<font size=3 face=Impact color=orange><u>General Draw</u></font> The winners of this weeks general draw is: Winner - {$sql2['username']} [{$sql2['userid']}] Winner will be credited immediately along with an event notification. Want to take part? Login on your account in any one week to be automatically entered. Prize: Prize is a free Donator Pack - Offer 1."; $db->query("UPDATE users SET userstatistics = 0"); $db->query("UPDATE users SET `new_announcements` = `new_announcements` + 1"); $db->query("INSERT INTO announcements (`announce_NAME`, `announce_TEXT`, `announce_TIME`, `announce_URGENCY`, `announce_TOPIC`, `announce_POSTED`) VALUES ('$name', '$announcement', unix_timestamp(), 'No Urgency', 'General News', 'SYSTEM')"); Here's an little help. Edit this in your needs.
-
I need someone to clean up my code! If you can I will be great full! function fight() { global $db, $ir, $c, $h, $userid; if (isset($_POST['submit']) && !empty($_POST['ID']) && !preg_match('[^1-9]', $_POST['ID'])) { $_GET['ID'] = abs((int) $_GET['ID']); $robot = mysql_query("SELECT * FROM robots WHERE userid='{$_POST['ID']}'"); $opp=mysql_fetch_array($robot); $yourrobot= mysql_query("SELECT * FROM robots WHERE userid='{$ir['userid']}'"); $you=mysql_fetch_array($yourrobot); if ($_POST['ID'] == $_SESSION['userid']) { echo "<hr width='50%'>Please read the error message.<hr width='50%'><h3>! ERROR</h3>You can not fight your own robot!<br /> <hr width='50%'><a href='robots.php'>> Go Back</a><hr width='50%'><br /><br />"; $h->endpage(); exit; } if (empty($opp['ID'])) { echo "<hr width='50%'>Please read the error message.<hr width='50%'><h3>! ERROR</h3>This user does not have a robot!<br /> <hr width='50%'><a href='robots.php'>> Go Back</a><hr width='50%'><br /><br />"; $h->endpage(); exit; } echo"<hr width = 95%><font color='red'><b>".$you['name']." vs ".$opp['name']."</b></font><br/><br/>"; $opp_stats = $opp['speed'] + $opp['aggression'] + $opp['health']; $you_stats = $you['speed'] + $you['aggression'] + $you['health']; $winner = ($opp_stats > $you_stats) ? $opp['name'] : $you['name']; $winner_ID = ($opp_stats > $you_stats) ? $opp['userid'] : $you['userid']; $loser = ($opp_stats > $you_stats) ? $you['userid'] : $opp['userid']; $speed_winner = ($opp['speed'] > $you['speed']) ? $opp['name'] : $you['name']; $agg_winner = ($opp['aggression'] > $you['aggression']) ? $opp['name'] : $you['name']; $health_winner = ($opp['health'] > $you['health']) ? $opp['name'] : $you['name']; echo 'The robots both enter the arena.<br /> <b>1.</b> <b>'.$speed_winner.'</b> runs in and starts swinging away, the other robot has no chance, <b>'.$speed_winner.'</b> is obviously faster<br /> <b>2.</b> The robots scrap each other to the ground, <b>'.$agg_winner.'</b> is alot more aggressive and punches furiously!<br /> <b>3.</b> The robots are both drained out, <b>'.$health_winner.'</b> seems to have had the most health throughout this fight, but its not over yet!<br /> <br /> <b>Result:</b> Both the robots are giving it their best. But to finish it off <b>'.$winner.'</b> jumps in the air and lands a critical big punch to the opponents neck!<br /> <br /><b>'.$winner.' is the winner!</b><hr width=95%><a href="robots.php">> Go Back</a><hr width=95%><br /><br />'; event_add($opp['userid'], '<a href="viewuser.php?u='.$you['userid'].'">'.$you['name'].'</a> fought your robot, the winning robot was '.$winner.'!'); $SQL = sprintf("UPDATE `cocks` SET `lost` = `lost` + 1, `health` = 0 WHERE `userid` = %u", $loser); $SQL_2 = sprintf("UPDATE `cocks` SET `won` = `won` + 1 WHERE `userid` = %u", $winner_ID); mysql_query($SQL); mysql_query($SQL_2); } else { echo '<hr width=75%><br /><form action="robots.php?x=fight" method="POST"> Userid: <input type="text" name="ID" /><br /> <input type="submit" name="submit" value="Fight" /> </form><br /><hr width=75%><a href="robots.php">> Go Back</a><hr width=75%><br /><br />'; } } For some reason this also dont work! $SQL = sprintf("UPDATE `cocks` SET `lost` = `lost` + 1, `health` = 0 WHERE `userid` = %u", $loser); $SQL_2 = sprintf("UPDATE `cocks` SET `won` = `won` + 1 WHERE `userid` = %u", $winner_ID); mysql_query($SQL); mysql_query($SQL_2);
-
Well, I aint cleaver with php :( If I was I would be helping people myself. But can someone help me?
-
So I have put this in my class_db_mysql.php - function query_error(){ global $userid,$db; $file = $_SERVER['REQUEST_URI']; if(!isset($_SESSION['error_event_sent'][$file])){ mysql_query("INSERT INTO `mysql_errors` (`me_userid`, `error_msg`, `query_was`, `file`, `error_time`) VALUES('$userid', '".mysql_real_escape_string(mysql_error())."', '{$this->last_query}', '{$file}', unix_timestamp())"); event_add(1, 'MySQL error logged, please check mysql_errors table in the database for more information.'); $_SESSION['error_event_sent'][$file] = true; } } When ever I fail a query it does not report it. My file... <?php if (!defined('MONO_ON')) { exit; } function query_error(){ global $userid,$db; $file = $_SERVER['REQUEST_URI']; if(!isset($_SESSION['error_event_sent'][$file])){ mysql_query("INSERT INTO `mysql_errors` (`me_userid`, `error_msg`, `query_was`, `file`, `error_time`) VALUES('$userid', '".mysql_real_escape_string(mysql_error())."', '{$this->last_query}', '{$file}', unix_timestamp())"); event_add(1, 'MySQL error logged, please check mysql_errors table in the database for more information.'); $_SESSION['error_event_sent'][$file] = true; } } if (!function_exists('error_critical')) { // Umm... die('<h1>Error</h1>' . 'Error handler not present'); } if (!extension_loaded('mysql')) { // dl doesn't work anymore, crash error_critical('Database connection failed', 'MySQL extension not present but required', 'N/A', debug_backtrace(false)); } class database { var $host; var $user; var $pass; var $database; var $persistent = 0; var $last_query; var $result; var $connection_id; var $num_queries = 0; var $start_time; function configure($host, $user, $pass, $database, $persistent = 0) { $this->host = $host; $this->user = $user; $this->pass = $pass; $this->database = $database; $this->persistent = $persistent; return 1; //Success. } function connect() { if (!$this->host) { $this->host = "localhost"; } if (!$this->user) { $this->user = "root"; } if ($this->persistent) { $conn = mysql_pconnect($this->host, $this->user, $this->pass); } else { $conn = mysql_connect($this->host, $this->user, $this->pass, true); } if ($conn === false) { error_critical('Database connection failed', mysql_errno() . ': ' . mysql_error(), 'Attempted to connect to database on ' . $this->host, debug_backtrace(false)); } // @overridecharset mysql $this->connection_id = $conn; if (!mysql_select_db($this->database, $this->connection_id)) { error_critical('Database connection failed', mysql_errno($conn) . ': ' . mysql_error($conn), 'Attempted to select database: ' . $this->database, debug_backtrace(false)); } return $this->connection_id; } function disconnect() { if ($this->connection_id) { mysql_close($this->connection_id); $this->connection_id = 0; return 1; } else { return 0; } } function change_db($database) { if (!mysql_select_db($database, $this->connection_id)) { error_critical('Database change failed', mysql_errno($this->connection_id) . ': ' . mysql_error($this->connection_id), 'Attempted to select database: ' . $database, debug_backtrace(false)); } $this->database = $database; } function query($query) { $this->last_query = $query; $this->num_queries++; $this->result = mysql_query($this->last_query, $this->connection_id); if ($this->result === false) { error_critical('Query failed', mysql_errno($this->connection_id) . ': ' . mysql_error($this->connection_id), 'Attempted to execute query: ' . nl2br($this->last_query), debug_backtrace(false)); } return $this->result; } function fetch_row($result = 0) { if (!$result) { $result = $this->result; } return mysql_fetch_assoc($result); } function num_rows($result = 0) { if (!$result) { $result = $this->result; } return mysql_num_rows($result); } function insert_id() { return mysql_insert_id($this->connection_id); } function fetch_single($result = 0) { if (!$result) { $result = $this->result; } return mysql_result($result, 0, 0); } function easy_insert($table, $data) { $query = "INSERT INTO `$table` ("; $i = 0; foreach ($data as $k => $v) { $i++; if ($i > 1) { $query .= ", "; } $query .= $k; } $query .= ") VALUES("; $i = 0; foreach ($data as $k => $v) { $i++; if ($i > 1) { $query .= ", "; } $query .= "'" . $this->escape($v) . "'"; } $query .= ")"; return $this->query($query); } function query_error(){ global $userid,$db; $file = $_SERVER['REQUEST_URI']; if(!isset($_SESSION['error_event_sent'][$file])){ mysql_query("INSERT INTO `mysql_errors` (`me_userid`, `error_msg`, `query_was`, `file`, `error_time`) VALUES('$userid', '".mysql_real_escape_string(mysql_error())."', '{$this->last_query}', '{$file}', unix_timestamp())"); event_add(1, 'MySQL error logged, please check mysql_errors table in the database for more information.'); $_SESSION['error_event_sent'][$file] = true; } } function escape($text) { return mysql_real_escape_string($text, $this->connection_id); } function affected_rows() { return mysql_affected_rows($this->connection_id); } function free_result($result) { return mysql_free_result($result); } }