Jump to content
MakeWebGames

NonStopCoding

Members
  • Posts

    572
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by NonStopCoding

  1.   if you have used that from my code that is because i don't use numbers when adding a new switch statement with a get variable
  2.   That would be because the $mc is only counting numbers showing the user how many mails/events they have what your wanting to do is a little more complicated as Zettieee said he pulled the mails from the mail table randing from users id and ordered it by time then limited it to 20 which will only grab the first 20 now adapting onto Zettieee code you will need to add some extra stuff for this to work.   $grabmails = $db->query("SELECT `mail_time`,`mail_subject`,`mail_text` FROM `mail` WHERE `mail_to` = ".$userid." AND `mail_read` = 0 ORDER BY `mail_time` DESC LIMIT 20"); while($gm = $db->fetch_row($grabmails)) { // cut messae down to 20 characters $qm = substr($gm['mail_text'], 0, 20); }   ill let you figure out the rest :)  
  3. ill use top 100 for this example (http://www.top100arena.com/) to set up for them would be http://www.top100arena.com/in.asp?id=xxx&incentive=1000 xxx being your special game id or name depends on the voting site really and incentive being the users id In the website that offers the incentive voting it will ask you for a call back url which would be your game url/voted.php inside this file you would then need to secure the $_GET['postback'] and then scan the users table to make sure the user is real using the post back if true then scan to check if they voted if not reward them and if voted already script does nothing.
  4. Another way could be pretty "much the same as kyle lol"   $loseperc = mt_rand(1,10); $perc = $ir['hp'] / 100 * $loseperc; $health = $ir['hp'] - $perc; if($health >= $ir['maxhp']) $health = $ir['maxhp']) $db->query("UPDATE `users` SET `hp` = `hp` - {$health} WHERE `userid` = ".$ir['userid']);
  5. I always support my modules :) and try something like this   if($ir['guard'] >= time() && $ir['guardon']) { echo "This user is protected against blocks."; $h->endpage(); exit; }   or a simple   if($ir['guardon']) { echo "This user is protected against blocks."; $h->endpage(); exit; }
  6. yes i need to update the version on mccodes marketplace. the new version removed the use of timeleft and other stuff will upload the updated version to market place now
  7. can help here and there if needed but got to much work on right now to take on anything else
  8.   iv not touched this paste at all since god nose how long :P ok so been a while since i touched this mod yea this cron is stupid don't know what i was thinking when i coded this wow. ill take a look tomorrow on my demo site but it was working when i released it
  9. there's a few ways it can be done using the if as stated above or switch http://codepad.org/psNITOdP
  10.   i have used it before and it's tabbed when you click on the tab et weapons it brings down the weapons it works great
  11. have you checked your cron job manager to make sure the code matches the code in the config.php file this will stop your cron from running.     there is no reference to it anyplace that i can find lol
  12.   so how does the gang take the city in the first place? what happens when both pres and vice pres are out of city? what do you mean by each members stats combined to total gang stats ?
  13.   No prob :P
  14.   yes my server was suffering from lag from last night but all issues have been fixed and site should be back up contact me on skype: dundeeboy09 or you can get me at [email protected] we can talk better
  15. If anyone has uploaded this and not corrected the errors i have posted update to petmarket.php and added a new sql file to op
  16. mccodes already does it well in v2.05b it does
  17. Ok so i originally coded this for GRPG engine but it has been getting a lot of hits from my website so i have now decided to convert this overt to work with mccodes. Have done a small amount of testing on a friends server and there are some issues so fixlist below. v1.01 Added a missing sql table that is needed for pets market. Fixed some issues in files. Added in the missing code for pet market. Fixed a issue with the getname function using ? twice Sql first CREATE TABLE IF NOT EXISTS `petshop` ( `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, `petname` varchar(75) NOT NULL, `cost` int(11) NOT NULL, `pic` varchar(75) NOT NULL ) ENGINE=MyISAM; CREATE TABLE IF NOT EXISTS `user_pets` ( `id` int(3) NOT NULL AUTO_INCREMENT PRIMARY KEY, `user` int(11) NOT NULL, `strength` int(11) NOT NULL DEFAULT '10', `defense` int(11) NOT NULL DEFAULT '10', `speed` int(11) NOT NULL DEFAULT '10', `aggression` int(11) NOT NULL DEFAULT '10', `petid` int(11) NOT NULL ) ENGINE=MyISAM; CREATE TABLE IF NOT EXISTS `user_pettraining` ( `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, `user` int(11) NOT NULL, `petid` int(11) NOT NULL, `time` int(20) NOT NULL, `stat` enum('Strength','Defense','Speed') NOT NULL DEFAULT 'Strength' ) ENGINE=MyISAM; CREATE TABLE IF NOT EXISTS `petmarket` ( `id` int(11) NOT NULL AUTO_INCREMENT, `petid` int(11) NOT NULL, `str` int(11) NOT NULL, `def` int(11) NOT NULL, `spe` int(11) NOT NULL, `agr` int(11) NOT NULL, `cost` int(11) NOT NULL, `owner` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; Ok time for the files now. petshop.php <?php /* Module Name: Pets Module * Module Version: v1.01 * Module Support: [email protected] * Module Price: $0.00 */ include(__DIR__.'/globals.php'); $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? strtolower(trim($_GET['action'])) : false; switch($_GET['action']) { case 'buy': buy_pet(); break; default: petshop(); break; } function petshop() { global $db,$h; ?> <table width="85%" style="text-align:center;" cellspacing="1" class="table"> <tr><th>Pet Shop</th></tr> <tr><td>Welcome to the pet shop below are a list of pets for sale.</td></tr> <tr> <th>Pets Name</th> <th>Pet Cost</th> <th>Action</th> </tr> <?php $res = $db->query("SELECT `id`,`petname`,`cost` FROM `petshop` ORDER BY `id` DESC"); while($row = $db->fetch_row($res)) { echo " <tr> <td>".htmlentities($row['petname'])."</td> <td>".money_formatter($row['cost'])."</td> <td><a href='petshop.php?action=buy&pet={$row['id']}'>Buy Pet</a></td> </tr>"; } echo "</table>"; $h->endpage(); } function buy_pet() { global $db,$ir,$h; $_GET['pet'] = isset($_GET['pet']) && ctype_digit($_GET['pet']) ? abs(intval($_GET['pet'])) : 0; if(empty($_GET['pet'])) { echo 'Invalid Choice of pet.'; $h->endpage(); exit; } $res = $db->query("SELECT `id`,`petname`,`cost` FROM `petshop` WHERE `id` = ".$_GET['pet']); if(!$db->num_rows($res)) { echo 'That is not a real pet.'; $h->endpage(); exit; } $row = $db->fetch_row($res); $checkpet = $db->query("SELECT `user` FROM `user_pets` WHERE `user` = ".$ir['userid']); if($db->num_rows($checkpet)) { echo 'You already have a pet sell your other one'; exit; } if($ir['money'] < $row['cost']) { echo 'You cant afford '.htmlentities($row['petname']).' you need '.money_formatter($row['cost']); $h->endpage(); exit; } $db->query("UPDATE `users` SET `money` = `money` - {$row['cost']} WHERE `userid` = ".$user_class->id); $db->query("INSERT INTO `user_pets` (`user`,`petid`) VALUES(".$ir['userid'].",".$_GET['pet'].")"); echo 'You have purchased '.htmlentities($row['petname']).' for '.money_formatter($row['cost']); $h->endpage(); } ?> petmarket.php <?php require(__DIR__.'/globals.php'); function getpetname($id) { global $db; $res = $db->query("SELECT `petname` FROM `petshop` WHERE `id` = ".$id); return ($db->num_rows($res)) ? htmlentities($db->fetch_single($res)) : "Error"; } $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? strtolower(trim($_GET['action'])) : null; switch($_GET['action']) { case 'buy': buy_pet(); break; default: petmarket(); break; } function petmarket() { global $db,$h; echo ' <table width="75%" style="text-align:center;" cellspacing="1" class="table"> <tr><th colspan="7">Pet Market</th></tr> <tr> <th>Pet</th> <th>Pet Cost</th> <th>Pet Strength</th> <th>Pet Defense</th> <th>Pet Speed</th> <th>Pet Aggression<th> <th>Action</th> </tr>'; $res = $db->query("SELECT `id`,`petid`,`str`,`def`,`spe`,`agr`,`cost` FROM `petmarket` ORDER BY `cost` ASC"); if($db->num_rows($res) == 0) echo "<tr><td colspan='7'>There are no pets listed in the market.</td></tr>"; while($row = $db->fetch_row($res)) { echo " <tr> <td>".getpetname($row['petid'])."</td> <td>".money_formatter($row['cost'])."</td> <td>".money_formatter($row['str'], false)."</td> <td>".money_formatter($row['def'], false)."</td> <td>".money_formatter($row['spe'], false)."</td> <td>".money_formatter($row['agr'], false)."</td> <td><a href='petshop.php?action=buy&pet={$row['id']}'>Buy Pet</a></td> </tr>"; } echo "</table>"; $h->endpage(); } function buy_pet() { global $db,$ir,$h; $_GET['pet'] = isset($_GET['pet']) && ctype_digit($_GET['pet']) ? abs(intval($_GET['pet'])) : 0; if(empty($_GET['pet'])) { echo 'Invalid Choice of pet.'; $h->endpage(); exit; } $res = $db->query("SELECT `petid`,`str`,`def`,`spe`,`agr`,`owner`,`cost` FROM `petmarket` WHERE `id` = ".$_GET['pet']); if(!$db->num_rows($res)) { echo 'That is not a real pet.'; $h->endpage(); exit; } $row = $db->fetch_row($res); $checkpet = $db->query("SELECT `user` FROM `user_pets` WHERE `user` = ".$ir['userid']); if($db->num_rows($checkpet)) { echo 'You already have a pet sell your other one'; $h->endpage(); exit; } if($ir['userid'] == $row['owner']) { echo 'You cant buy your own pet.'; $h->endpage(); exit; } if($ir['money'] < $row['cost']) { echo "You don't have enough money to buy this pet you need ".money_formatter($row['cost'] - $ir['money'])." more."; $h->endpage(); exit; } $db->query("UPDATE `users` SET `money` = `money` - {$row['cost']} WHERE `userid` = ".$ir['userid']); $db->query("UPDATE `users` SET `money` = `money` + {$row['cost']} WHERE `userid` = ".$row['owner']); $db->query("INSERT INTO `user_pets` (`user`,`petid`,`strength`,`defense`,`speed`,`aggression`) VALUES (".$ir['userid'].",".$row['id'].",".$row['str'].",".$row['def'].",".$row['spe'].",".$row['agr'].")"); event_add($row['owner'], 'Someone purchased your pet off the market.'); echo 'You purchased '.getpetname($row['petid']).' off the market.'; $db->query("DELETE FROM `petmarket` WHERE `id` = ".$_GET['pet']); $h->endpage(); } mypet.php <?php /* Module Name: Pets Module * Module Version: v1.00 * Module Support: [email protected] * Module Price: $0.00 */ include(__DIR__.'/globals.php'); function getpetname($id) { global $db; $res = $db->query("SELECT `petname` FROM `petshop` WHERE `id` = ".$id); return ($db->num_rows($res)) ? htmlentities($db->fetch_single($res)) ? "Error"; } $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? strtolower(trim($_GET['action'])) : null; switch($_GET['action']) { case 'sell': sell_pet(); break; case 'train': train_pet(); break; case 'begin': begin_training(); break; default: my_pet(); break; } function my_pet() { global $db,$ir,$h; $checkpet = $db->query("SELECT `user`,`petid`,`strength`,`defense`,`speed`,`aggression` FROM `user_pets` WHERE `user` = ".$ir['userid']); if(!$db->num_rows($checkpet)) { echo 'You dont own a pet.'; $h->endpage(); exit; } $row = $db->fetch_row($checkpet); $color = ($color > 1000) ? "red" : "black"; ?> <table width="85%" style="text-align:center;" cellspacing="1" class="table"> <tr><th>Your Pet</th></tr> <tr> <td> <?php echo getpetname($row['petid']); ?><br /> Strength: <span style="color:<?=$color?>"><?php echo money_formatter($row['strength'], false); ?></span><br /> Defense: <span style="color:<?=$color?>"><?php echo money_formatter($row['defense'], false); ?></span><br /> Speed: <span style="color:<?=$color?>"><?php echo money_formatter($row['speed'], false); ?></span><br /> Aggression: <span style="color:<?=$color?>"><?php echo money_formatter($row['aggression'], false); ?></span> <br /><br /> </td> </tr> <tr><th>Pet Activitys</th></tr> <tr> <td> What would you like to do with your pet?<br /> <hr width="50%" align="left"> <a href="mypet.php?action=train">Train Pet</a> | <a href="mypet.php?action=sell">Sell Pet</a> </td> </tr> </table> <?php $h->endpage(); } function sell_pet() { global $db,$ir,$h; $checkpet = $db->query("SELECT `user`,`petid` FROM `user_pets` WHERE `user` = ".$ir['userid']); if(!$db->num_rows($checkpet)) { echo 'You dont own a pet.'; $h->endpage(); exit; } $row = $db->fetch_row($checkpet); $cost = $db->query("SELECT `cost` FROM `petshop` WHERE `id` = ".$row['petid']); $ret = $db->fetch_row($cost); $petcost = $ret['cost'] / 2; $newmoney = $ir['money'] + $petcost; $db->query("UPDATE `users` SET `money` = '$newmoney' WHERE `userid` = ".$ir['userid']); $db->query("DELETE FROM `user_pets` WHERE `user` = ".$ir['userid']); echo 'You have sold your pet for '.money_formatter($petcost); $h->endpage(); } function train_pet() { global $db,$ir,$h; $checkpet = $db->query("SELECT `user`,`petid`,`strength`,`defense`,`speed` FROM `user_pets` WHERE `user` = ".$ir['userid']); if(!$db->num_rows($checkpet)) { echo 'You dont own a pet.'; $h->endpage(); exit; } $row = $db->fetch_row($checkpet); $stats = array( 'Strength', 'Defense', 'Speed' ); ?> <table width="85%" style="text-align:center;" cellspacing="1" class="table"> <tr><th>Pet Training</th></tr> <tr><td>Pick a stat from the drop down list to begin training.<br />training your pets stats is going to take some time.</td></tr> <tr> <td> <form method="post" action="mypet.php?action=begin"> <select name="stat" type="dropdown"> <?php foreach($stats as $opt) printf("<option value='%1\$s'>%1\$s</option>", $opt); ?> </select> <input type="submit" name="" value="Begin Training" /> </form> </td> </tr> </table> <?php $h->endpage(); } function begin_training() { global $db,$ir,$h; $checktrain = $db->query("SELECT `user` FROM `user_pettraining` WHERE `user` = ".$ir['userid']); if($db->num_rows($checktrain)) { echo 'Your pet is already in training come back when its done.'; $h->endpage(); exit; } $checkpet = $db->query("SELECT `user`,`petid`,`strength`,`defense`,`speed` FROM `user_pets` WHERE `user` = ".$ir['userid']); if(!$db->num_rows($checkpet)) { echo 'You dont own a pet.'; $h->endpage(); exit; } $row = $db->fetch_row($checkpet); $stats = array( 'Strength', 'Defense', 'Speed' ); $_POST['stat'] = isset($_POST['stat']) && ctype_alpha($_POST['stat']) && in_array($_POST['stat'], $stats) ? $_POST['stat'] : ''; if(empty($_POST['stat'])) { echo 'The stat you chose was not valid'; $h->endpage(); exit; } $time = 1200; # 20 minutes $cost = 0; if($ir['money'] < $cost) { echo 'You dont have enough money you need '.money_formatter($cost).' to train your pet.'; $h->endpage(); exit; } $_POST['stat'] = $db->escape($_POST['stat']); $db->query("INSERT INTO `user_pettraining` (`user`,`petid`,`time`,`stat`) VALUES (".$ir['userid'].",".$row['petid'].",'$time','".$_POST['stat']."')"); echo 'You have begin to train your pets '.$_POST['stat'].' it will take 20 minutes'; $h->endpage(); } ?> cron.php <?php if(!isset($_GET['code']) || $_GET['code'] != $_CONFIG['code']) exit; if(file_exists('globals_noauth.php')) require(__DIR__.'/globals_noauth.php'); else { include "config.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; $set = array(); $settq = $db->query("SELECT * FROM settings"); while($r $db->fetch_row($settq)) $set[$r['conf_name']] = $r['conf_value']; } $pet = $db->query("SELECT `user` FROM `user_pettraining`"); while($r = $db->fetch_row($pet)) { $pets = $db->query("SELECT `user`,`time`,`stat` FROM `user_pettraining` WHERE `user` = ".$r['user']); $c = $db->fetch_row($pets); $time = $c['time'] - 60; $check = $db->query("SELECT `aggression` FROM `user_pets` WHERE `user` = ".$c['user']); $w = $db->fetch_row($check); if($c['time'] > 0) $removet = $db->query("UPDATE `user_pettraining` SET `time` = '$time' WHERE `time` > 0"); else { if($c['stat'] == 'Strength' && $c['time'] == 0) { $stats = round(mt_rand(1,10 * $w['aggression'] / 10 + 5)); event_add($c['user'], 'Your pets training is completed you gained '.number_format($stats).' Strength This session'); $db->query("DELETE FROM `user_pettraining` WHERE `time` = 0 AND `user` = ".$c['user']); $db->query("UPDATE `user_pets` SET `strength` = `strength` + '$stats' WHERE `user` = ".$c['user']); } else if($c['stat'] == 'Defense' && $c['time'] == 0) { $stats = round(mt_rand(1,10 * $w['aggression'] / 10 + 5)); event_add($c['user'], 'Your pets training is completed you gained '.number_format($stats).' Defense This session'); $db->query("DELETE FROM `user_pettraining` WHERE `time` = 0 AND `user` = ".$c['user']); $db->query("UPDATE `user_pets` SET `defense` = `defense` + '$stats' WHERE `user` = ".$c['user']); } else if($c['stat'] == 'Speed' && $c['time'] == 0) { $stats = round(mt_rand(1,10 * $w['aggression'] / 10 + 5)); event_add($c['user'], 'Your pets training is completed you gained '.number_format($stats).' Speed This session'); $remove = $db->query("DELETE FROM `user_pettraining` WHERE `time` = 0 AND `user` = ".$c['user']); $update = $db->query("UPDATE `user_pets` SET `speed` = `speed` + '$stats' WHERE `user` = ".$c['user']); } } } ?>
  18.   You could go   $fiems = array_unique(array(12,15,17,15)); $itemcheck = $db->query("SELECT `inv_qty` FROM `inventory` WHERE `inv_userid` = {$userid} AND `inv_itemid` = IN(".implode(',', $fiems)"); if(!$db->num_rows($itemcheck)) { echo "You are missing a required item. $h->endpage(); exit; }
  19. few things 1. why global the $db variable this is already done and should work in any files that has globals.php includes in. 2. Your 3 queries can be turned into 1 3. if($inv_qty == 0) you have to call for this. look into $db->num_rows($yourvariable) == 0) 4. you have the variables mixed up prob due to me being my mistake yesterday hehe item_remove(userid,itemid,qty);
  20. Small little update if anyone is even going to use this hehe v1.01 Added in a small sessions code to track there current win streak   ALTER TABLE `users` ADD `winstreak` int(11) NOT NULL default 0;   http://codepad.org/9QLCRcY3
  21. ah ok misunderstood my bad haha
  22.   use codepad :)
  23. Thanks i am looking for good casino games for my game haha found this so decided to fix it up :p
  24. Hello all it's been a while since i posted anything so i found this module (attached) it was not working so i have fixed it up and made it work for v2.05b and added some stuff that was missing Credits go to The Monk and Joshua Sql CREATE TABLE `highlow` ( `uID` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, `userid` int(11) NOT NULL, `oldnum` int(2) NOT NULL ) ENGINE = MYISAM; highlow.php - Not working ? http://codepad.org/BRbUOchh <?php require_once('globals.php'); echo '<h3>High/Low</h3>'; $bet = array_key_exists('bet', $_POST) && ctype_digit($_POST['bet']) ? abs(intval($_POST['bet'])) : 0; $oldnum = array_key_exists('oldnum', $_POST) && ctype_digit($_POST['oldnum']) ? abs(intval($_POST['oldnum'])) : 0; $choice = array_key_exists('choice', $_POST) && is_string($_POST['choice']) ? stripslashes(strip_tags($_POST['choice'])) : ''; if($bet && !$choice) { if(!in_array($bet, array('100', '1000', '5000', '10000'))) { echo 'The bet you selected is not available.'; $h->endpage(); exit; } if($bet > $ir['money']) { echo 'Not enough money!'; $h->endpage(); exit; } $num = mt_rand(1,10); $check = $db->query("SELECT `userid` FROM `highlow` WHERE `userid` = ".$userid); if($db->num_rows($check)) $db->query("UPDATE `highlow` SET `oldnum` = ".$num." WHERE `userid` = ".$userid); else if(!$db->num_rows($check)) $db->query("INSERT INTO `highlow` (`userid`,`oldnum`) VALUES ($userid,$num)"); $db->free_result($check); echo 'The number is '.$num.'. Will the next number be higher or lower than '.$num.'? <table> <tr> <td> <form method="post"> <input type="hidden" value="'.$bet.'" name="bet"> <input type="hidden" value="high" name="choice"> <input type="submit" value="Higher"> </form> </td> <td> <form method="post"> <input type="hidden" value="'.$bet.'" name="bet"> <input type="hidden" value="low" name="choice"> <input type="submit" value="Lower"> </form> </td> </tr> </table>'; } else if($choice && $bet) { if(!in_array($bet, array('100', '1000', '5000', '10000'))) { echo 'The bet you selected is not available.'; $h->endpage(); exit; } if($bet > $ir['money']) { echo 'Not enough money!'; $h->endpage(); exit; } if(!in_array($choice, array('high','low'))) { echo 'Invalid guess, must be high or low.'; $h->endpage(); exit; } $newnum = mt_rand(1,10); $oldn = $db->query("SELECT `oldnum` FROM `highlow` WHERE `userid` = ".$userid); $oldnum = $db->fetch_row($oldn); $db->free_result($oldn); if($oldnum['oldnum'] <= 0 || $oldnum['oldnum'] > 10) { echo 'Invalid number generated, please message staff'; $h->endpage(); exit; } if($newnum < $oldnum['oldnum'] && $choice == 'high') $result = 2; else if($newnum < $oldnum['oldnum'] && $choice == 'low') $result = 1; else if($newnum > $oldnum['oldnum'] && $choice == 'high') $result = 1; else if($newnum > $oldnum['oldnum'] && $choice == 'low') $result = 2; else if($newnum == $oldnum['oldnum']) $result = 1; if(!$result) die("Error, contact Staff!"); $db->query("UPDATE `users` SET `money` = `money` - ".$bet." WHERE `userid` = ".$userid); if($result === 1) { $prize = $bet * 2; if(!in_array($prize, array('200','2000','10000','20000'))) { echo 'An invalid amount of prize money has been determined.'; $h->endpage(); exit; } echo 'Congratulations! You won your bet of '.money_formatter($bet); $db->query("UPDATE `users` SET `money` = `money` + ".$prize." WHERE `userid` = ".$userid); $db->query("UPDATE `highlow` SET `oldnum` = ".$newnum." WHERE `userid` = ".$userid); echo 'You guessed '.$choice.', the previous number was '.$oldnum['oldnum'].' and the new number was '.$newnum.'. Is the next number going to be higher or lower than '.$newnum.'? <table> <tr> <td> <form method="post"> <input type="hidden" value="'.$bet.'" name="bet"> <input type="hidden" value="high" name="choice"> <input type="submit" value="Higher"> </form> </td> <td> <form method="post"> <input type="hidden" value="'.$bet.'" name="bet"> <input type="hidden" value="low" name="choice"> <input type="submit" value="Lower"> </form> </td> </tr> </table>'; } else if($result === 2) { $db->query("UPDATE `highlow` SET `oldnum` = ".$newnum." WHERE `userid` = ".$userid); echo 'Sorry you lost your bet of '.money_formatter($bet).' You guessed '.$choice.', the previous number was '.$oldnum['oldnum'].' and the new number was '.$newnum.'. Is the next number going to be higher or lower than '.$newnum.'? <table> <tr> <td> <form method="post"> <input type="hidden" value="'.$bet.'" name="bet"> <input type="hidden" value="high" name="choice"> <input type="submit" value="Higher"> </form> </td> <td> <form method="post"> <input type="hidden" value="'.$newnum.'" name="oldnum"> <input type="hidden" value="'.$bet.'" name="bet"> <input type="hidden" value="low" name="choice"> <input type="submit" value="Lower"> </form> </td> </tr> </table>'; } } else { echo 'Welcome to the High/Low casino! <form action="highlow.php" method="post"> Select your bet: <select type="dropdown" name="bet"> <option value="100">$100</option> <option value="1000">$1000</option> <option value="5000">$5000</option> <option value="10000">$10000</option> </select> <input type="submit" value="Start Game!"> </form>'; } $h->endpage();
×
×
  • Create New...