Jump to content
MakeWebGames

Magictallguy

Administrators
  • Posts

    2,124
  • Joined

  • Last visited

  • Days Won

    144

Everything posted by Magictallguy

  1. IF you can code ;) Not everyone can xD If they can't code, then that's their problem - they should learn!
  2. Perhaps converting the system from v2 would help you here
  3. As the game grows, so do the stats - it's inevitable. Limiting the trains seems like a good idea in principle, but you could also/just limit the amount gained from training
  4. HTML fail much?   <?php session_start(); 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']; } ?> <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'> <html xmlns='http://www.w3.org/1999/xhtml' lang='en' xml:lang='en'> <head> <title><?php echo stripslashes(htmlspecialchars($set['game_name'])); ?></title> </head> <body style='background-color:#CCC;'> <table border='0' style='background-color:#DDE;text-align:center;'> <tr style='background-color:#AAA;'> <td style='text-align:center;'><?php echo stripslashes(htmlspecialchars($set['game_name'])); ?> - Login</td> </tr> <tr> <td> <form action='authenticate.php' method='post'> <input type='text' name='name' /> <input type='password' name='password' /> <input type='image' src='submit.jpg' style='width:84;height:26;' /> </form> </td> </tr> </table> </body> </html>   XHTML valid, Transitional level.
  5. The abs() and intval() on the number coming from the database is not required - and is pretty much a waste of space ;)   $check = $db->query(sprintf("SELECT daily_train_id FROM daily_train WHERE (daily_train_userid = %u)", $ir['userid'])); if($db->num_rows($check)) { $db->query(sprintf("UPDATE daily_train SET daily_train_time = %u WHERE (daily_train_userid = %u)", time(), $ir['userid'])); } else { $db->query(sprintf("INSERT INTO daily_train VALUES ('', %u, %u)", $ir['userid'], time())); }   $allow_train = $db->query(sprintf("SELECT daily_train_time FROM daily_train WHERE (daily_train_userid = %u)", $ir['userid'])); $allow_t = $db->fetch_row($allow_train); if($allow_t['daily_train_time'] < time() - 86400) { echo 'Sorry, you can only train once a day. [url="index.php"]> Go Home[/url]'; $h->endpage(); exit; }
  6. I'd rather just call you Sahid, shedh, or Mr. Chunara :P
  7. Fair enough, all yours :)
  8. Getting back on topic, I can create this - make an offer my friend :P
  9. My edits: Bytes: 9,775 to 8,673 Lines: 221 to 152 <?php /*----------------------------------------------------- - MCCodes V2 || Streets - Revamped by Jordan ('Pudda') - Freebie :D -----------------------------------------------------*/ $noturns = "Sorry you dont see to have any walks left today. Come back tomorrow"; include(DIRNAME(__FILE__) . '/globals.php'); if($ir['turns'] <= 0) { echo $noturns; $h->endpage(); exit; } $_GET['act'] = isset($_GET['act']) && is_string($_GET['act']) ? trim($_GET['act']) : ""; switch($_GET['act']) { case 'search': search_streets(); break; default: index(); break; } function index() { global $db, $ir, $userid, $h, $db; $cityname = $db->fetch_single($db->query("SELECT cityname FROM cities WHERE cityid = ".$ir['location'])); $Type = mt_rand(1, 8); echo "<h2 style='text-align:center;'>".$cityname." Streets</center></h2>"; echo "[img=http://i42.tinypic.com/2h6cd41.jpg] <map name='Map'> <area shape='rect' coords='205,274,270,339' href='?act=search&search=".$Type."'> <area shape='rect' coords='273,3,338,68' href='?act=search&search=".$Type."'> <area shape='rect' coords='138,138,203,203' href='?act=search&search=".$Type."'> <area shape='rect' coords='274,138,339,203' href='?act=search&search=".$Type."'> <area shape='rect' coords='204,137,269,202' href='?act=search&search=".$Type."'> <area shape='rect' coords='2,138,67,203' href='?act=search&search=".$Type."'> <area shape='rect' coords='3,69,68,134' href='?act=search&search=".$Type."'> <area shape='rect' coords='273,207,338,272' href='?act=search&search=".$Type."'> <area shape='rect' coords='275,70,340,135' href='?act=search&search=".$Type."'> <area shape='rect' coords='205,70,270,135' href='?act=search&search=".$Type."'> <area shape='rect' coords='2,274,67,339' href='?act=search&search=".$Type."'> <area shape='rect' coords='69,274,134,339' href='?act=search&search=".$Type."'> <area shape='rect' coords='340,342,405,407' href='?act=search&search=".$Type."'> <area shape='rect' coords='341,409,406,474' href='?act=search&search=".$Type."'> <area shape='rect' coords='273,410,338,475' href='?act=search&search=".$Type."'> <area shape='rect' coords='206,410,271,475' href='?act=search&search=".$Type."'> <area shape='rect' coords='138,410,203,475'href='?act=search&search=".$Type."'> <area shape='rect' coords='70,408,135,473' href='?act=search&search=".$Type."'> <area shape='rect' coords='3,407,68,472' href='?act=search&search=".$Type."'> <area shape='rect' coords='3,341,68,406' href='?act=search&search=".$Type."'> <area shape='rect' coords='138,342,203,407' href='?act=search&search=".$Type."'><area shape='rect' coords='68,341,133,406' href='?act=search&search=".$Type."'> <area shape='rect' coords='206,342,271,407' href='?act=search&search=".$Type."'><area shape='rect' coords='274,342,339,407' href='?act=search&search=".$Type."'> <area shape='rect' coords='272,272,337,337' href='?act=search&search=".$Type."'> </map> </center>"; } function search_streets() { global $db, $ir, $userid, $h; /*----------------------------------------------------- # Start Config # -----------------------------------------------------*/ $cityname = $db->fetch_single($db->query("SELECT cityname FROM cities WHERE cityid = ".$ir['location'])); $nonrecorded = "What you doing here? [url='index.php']Go back[/url]"; $rand = mt_rand(0,2); $randhard = mt_rand(0,3); $randmoney = mt_rand(1,100); $randcrystals = mt_rand(1,8); $itemidsearch2 = 39; //Item id for search 2 $quantitysearch2 = 1; //Item quantity for search 2 $itemidsearch4 = 36; //Item id for search 4 $quantitysearch4 = 1; //Item quantity for search 4 $itemidsearch5 = 37; //Item id for search 5 $quantitysearch5 = 1; //Item quantity for search 5 $itemidsearch7 = 38; //Item id for search 7 $quantitysearch7 = 1; //Item quantity for search 7 $itemidsearch8 = 36; //Item id for search 8 $quantitysearch8 = 1; //Item quantity for search 8 /*----------------------------------------------------- # End Config # -----------------------------------------------------*/ $_GET['search'] = abs(@intval($_GET['search'])); if(!$_GET['search']) { echo $nonrecorded; $h->endpage(); exit; } $db->query("UPDATE `users` SET `turns`=`turns`-1 WHERE `userid`=$userid"); if($_GET['search'] == 1) { if($rand == 1) { $db->query("UPDATE `users` SET `money`=`money`+".$randmoney." WHERE `userid`=$userid"); echo "<span style='color:green;font-weight:700;'>Success</span> You found ".money_formatter($randmoney)." after searching an random box"; } else { echo "<span style='color:red;font-weight:700;'>Unlucky!</span> While searching ".$cityname." You didnt come across anything useful "; } } else if($_GET['search'] == 2) { if($rand == 1) { $db->query("INSERT INTO `inventory` VALUES('',$itemidsearch2,$userid,$quantitysearch2)"); echo "<span style='color:green;font-weight:700;'>Success</span> While searching ".$cityname." you found an mysterious item. Go to your inventory to find out what"; } else { $Time = mt_rand(20,100); echo "<span style='color:red;font-weight:700;'>Unlucky!</span> While searching ".$cityname." a police officer arrested you."; $db->query(sprintf("UPDATE `users` SET `jail` = %u, `jail_reason` = 'Arrested for hanging around %s' WHERE `userid` = %u", $Time, $cityname, $userid)); } } else if($_GET['search'] == 3) { if($rand == 1) { $db->query("UPDATE `users` SET `money`=`money`+".$randmoney." WHERE `userid`=$userid"); echo "<font color = 'green'>[b]Sucess[/b]</font> You found ".money_formatter($randmoney)." after robbing an random old man"; } else { $Time = mt_rand(20,100); echo "<span style='color:red;font-weight:700;'>Unlucky!</span> While searching ".$cityname." you got shot."; $db->query(sprintf("UPDATE `users` SET `hospital` = %u, `hospreason` = 'While searching %s they got shot' WHERE `userid` = %u", $Time, $cityname, $userid)); } } else if($_GET['search'] == 4) { if($randhard == 1) { $db->query("INSERT INTO inventory VALUES('',$itemidsearch4,$userid,$quantitysearch4)"); echo "<span style='color:green;font-weight:700;'>Success</span> While searching ".$cityname." you found an mysterious item. Go to your inventory to find out what"; } else { echo "<span style='color:red;font-weight:700;'>Unlucky!</span> While searching ".$cityname." you found NOTHING!"; } } else if($_GET['search'] == 5) { $db->query("INSERT INTO inventory VALUES('',$itemidsearch5,$userid,$quantitysearch5)"); echo "<span style='color:green;font-weight:700;'>Success</span> While searching ".$cityname." you found an mysterious item. Go to your inventory to find out what"; } else if($_GET['search'] == 6) { if($rand == 1) { $db->query("UPDATE users SET `crystals`=`crystals`+".$randcrystals." WHERE userid=$userid"); echo "<span style='color:green;font-weight:700;'>Success</span> While searching ".$cityname." You fell down a hole and found ".number_format($randcrystals); } else { $Time = mt_rand(20,100); echo "<span style='color:red;font-weight:700;'>Unlucky!</span> While searching ".$cityname." a police officer arrested you."; $db->query(sprintf("UPDATE `users` SET `jail` = %u, `jail_reason` = 'Arrested for hanging around %s' WHERE `userid` = %u", $Time, $cityname, $userid)); } } else if($_GET['search'] == 7) { if($rand == 1) { $db->query("INSERT INTO inventory VALUES('',$itemidsearch7,$userid,$quantitysearch7)"); echo "<span style='color:green;font-weight:700;'>Success</span> While searching ".$cityname." You found an mysterious item. Go to your inventory to find out what"; } else { $Time = mt_rand(20,100); echo "<span style='color:red;font-weight:700;'>Unlucky!</span> While searching ".$cityname." a police officer arrested you."; $db->query(sprintf("UPDATE `users` SET `jail` = %u, `jail_reason` = 'Arrested for hanging around %s' WHERE `userid` = %u", $Time, $cityname, $userid)); } } else if($_GET['search'] == 8) { if($randhard == 1) { $db->query("INSERT INTO inventory VALUES('',$itemidsearch8,$userid,$quantitysearch8)"); echo "<span style='color:green;font-weight:700;'>Success</span> While searching ".$cityname." You found an mysterious item. Go to your inventory to find out what"; } else { $Time = mt_rand(20,100); echo "<span style='color:red;font-weight:700;'>Unlucky!</span> While searching ".$cityname." a police officer arrested you."; $db->query(sprintf("UPDATE `users` SET `jail` = %u, `jail_reason` = 'Arrested for hanging around %s' WHERE `userid` = %u", $Time, $cityname, $userid)); } } } $h->endpage(); ?>
  10. Haha, I'm African! Nagubal Wbeqna
  11. I taught myself from MC Craps v1 and v2.. Hey, don't knock it until you've tried it! I can code pretty well (if I do say so myself :P), and I taught myself from that - so yeah!
  12. Your reasoning seems fair. If you're serious about this, I'd be happy to help you here :)
  13. Is it wrong to want to hide your identity online? Are you not wanting to keep yourself safe from online predators of information (or more)? I, personally, couldn't give a crap what people find out about me, I have very little to hide.
  14. What made you want to start a game? (just curious)
  15. Magictallguy

    weird

    I like working with classes, it allows me to change anything about how my site handles itself (i.e. my profile() function in a personal class, including username colours, formatting, etc. - my entire game uses that function instead of constantly selecting and displaying a username and donator icon (functions FTW)), from 1 file! I prefer using them to be honest, it makes things so much easier. OOP FTW!
  16. That's a security fail - that won't help you. Wrapping the output in nl2br() would help you here.
  17. "Nyna", an alias of "Alan", a Website Developer, programmer, and hack artist.
  18. Meh, what can I say.. People are money grabbers these days - I can think of a few personally, I "work" with one
  19. [mccode v2] Gym Quick 2 second search :P
  20. Magictallguy

    weird

    Or write your own class.. The v2 database class is a *very* simple one - basic (and outdated, unless you've brought it out of the stone ages!). Heck, I'll write one for you if you want
  21. :/ Database -> users table -> brave and maxbrave rows. Files -> global_func.php -> check_level() function -> updating.
  22. If these 2 haven't done it, feel free to contact me. I'm happy to do it free MSN/Email: [email protected]
  23. If you're going to use sprintf() operators, make sure you actually wrap the code in sprintf().
  24. You're only displaying a message, you're not killing the page too ;) $q = $db->query("SELECT * FROM drugs_bank WHERE ((db_time = unix_timestamp - 21600) AND (userid = $userid))"); if(!$db->num_rows($q)) { echo "The time limit has expired yet please wait some more time"; $h->endpage(); exit; }
  25. That way works too (and is more efficient for those that care).. But you may want to add: $quote = array(); above that to ensure there are no errors (error_reporting(E_ALL))
×
×
  • Create New...