Jump to content
MakeWebGames

boionfire81

Members
  • Posts

    532
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by boionfire81

  1. Well it started with GET ID & POST ID. The GET ID had to be changed from ID to id, in order for the page to display at all. So I've been playing around a bit with the ID v id part. And in either case the result is the same. This item is not a gun.
  2. Yes in itemtypes data it is listed as 15, worded as Gun.
  3. Does anyone know of a way for v2 to allow a player to trade/swap a single item for a set of multiple items?
  4. ok, so in this case   switch ($_GET['action']) { case "add": add_contact(); break; case "remove": remove_contact(); break; default: contacts_list(); break; }   the default is not defined. but the default does not have an action. Soooo?????
  5. Ok, this is my one and only project today. (Unless I hear back from Kyle)   <?php include "globals.php"; print "<font face='Arial' size='4'>Ammunition Store</font><hr width=75%> "; $_GET['id'] = abs((int) $_GET['id']); $_POST['id'] = abs((int) $_POST['id']); $_POST['clips'] = abs((int) $_POST['clips']); $cost=($_POST['clips']*500); if($_POST['clips']) { $q=$db->query("SELECT iv.*,i.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid WHERE i.itmid={$_POST['ID']} AND i.itmtype=15 AND iv.inv_userid=$userid"); if($db->num_rows($q)==0) { print "This item is not a Gun! <a href='inventory.php' class='button'>Exit</a>"; } else if ($ir['money']<$cost) { print "You cannot afford that many clips! <a href='inventory.php' class='button'>Exit</a>"; } else { $r=$db->fetch_row($q); $x=$db->query("SELECT * FROM ammunition WHERE amWEAPON={$_POST['ID']} AND amUSER=$userid"); $y=$db->num_rows($x); $z=$db->fetch_row($x); if ($y) { $clips=($z['amAMMO']+$_POST['clips']); $db->query("UPDATE users SET money=money-$cost WHERE userid=$userid"); $db->query("UPDATE ammunition SET amAMMO=amAMMO+{$_POST['clips']} WHERE amWEAPON={$_POST['id']} AND amUSER=$userid"); print "You bought {$_POST['clips']} rounds of ammunition for your {$r['itmname']}! You now have $clips clips for this gun. <a href='inventory.php' class='button'>Exit</a>"; } else { $db->query("UPDATE users SET money=money-$cost WHERE userid=$userid"); $db->query("INSERT INTO ammunition VALUES ('','$userid','{$_POST['id']}',{$_POST['clips']})"); print "You bought {$_POST['clips']} rounds of ammunition for your {$r['itmname']}! <a href='inventory.php' class='button'>Exit</a>"; } } } else { $q=$db->query("SELECT iv.*,i.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid WHERE i.itmid={$_GET['id']} AND itmtype=15 AND iv.inv_userid=$userid"); if($db->num_rows($q)==0) { print "This item is not a Gun! <a href='inventory.php' class='button'>Exit</a>"; } else { $r=$db->fetch_row($q); print "Standard ammunition costs $500 per round for all guns. How much ammunition would you like to buy for your {$r['itmname']}. <form action='ammunition.php' method='post'> <input type='hidden' name='ID' value='{$_GET['id']}' /> Clips: <input type='text' name='clips' value='0' /> <input type='submit' value='Purchase' /></form> <a href='inventory.php' class='button'>Exit</a>"; } } $h->endpage(); ?>   Always shows This item is not a Gun! for the ammunition.php file
  6. Well half of the time the issue was simply not including the $value in the SELECT from. But I have seen so many ways of defining a variable/array it's ridiculous. What I do know is a variable is basically a constant. Representing an item or amount. While an array is several values. That's all I have understood so far.
  7. well whatever it is. It's in contact list which is a standard mccode 2.0.5 file. So there are definitely going to be issues with the php 7.   Not to mention after how many attempts there is still no clear definition of how to get rid of these undefined. I've been able to understand most of what you guys have said. But for whatever reason undefined slips past me every time >.<
  8. Yes, but the undefined index is   switch ($_GET['action']) { case "add": add_contact(); break; case "remove": remove_contact(); break; default: contacts_list(); break; }   and GET action has never been a variable that I'm aware of. So was just wondering if it was a php 7 thing.
  9. Last edited by KyleMassacre; 03-25-2016, 04:55 PM. Reason: Added code tags around the SQL Can ya fix it?
  10. dunno what you mean poduction/dev. It's visible via http://www.com but considering no one knows the url. I'm old skool here. From back in the days of cgi. Shoot I still hand write code.
  11. function newspaper_page_2_form() { global $db; if(!isset($_POST['submit'])) { $news = $db->fetch_single($db->query("SELECT page2_content FROM papercontent LIMIT 1")); echo "<h3>Editing Newspaper Page 2</h3> <form action='staff_special.php?action=editnews2' method='post'> <textarea rows='7' cols='35' name='newspaper'>".stripslashes($news)."</textarea> <input type='submit' name='submit' value='Change' /> </form>"; } else { $db->query("UPDATE papercontent SET page2_content = '".$db->escape($news)."'"); echo "Newspaper updated!"; stafflog_add("Updated game newspaper page 2"); } } function newspaper_page_3_form() { global $db; if(!isset($_POST['submit'])) { $news = $db->fetch_single($db->query("SELECT page3_content FROM papercontent LIMIT 1")); echo "<h3>Editing Newspaper Page 3</h3> <form action='staff_special.php?action=editnews3' method='post'> <textarea rows='7' cols='35' name='newspaper'>".stripslashes($news)."</textarea> <input type='submit' name='submit' value='Change' /></form>"; } else { $db->query("UPDATE papercontent SET page3_content = '".$db->escape($news)."'"); echo "Newspaper updated!"; stafflog_add("Updated game newspaper page 3"); } }
  12. Here is one I found...And Kyle I KNOW....but is action now an issue?   switch ($_GET['action']) { case "add": add_contact(); break; case "remove": remove_contact(); break; default: contacts_list(); break; }   A non-critical error has occurred. Page execution will continue. Below are the details: PHP Notice: Undefined index: action (8) Line executed: /home/public_html/contactlist.php:39   And yes it's just a notice the page does display. But the notices are there for a reason. I feel fixing notices can help prevent more issues in the future.
  13. Kyle the code for the sql is there, but now the rest has disappeared lol! When it didn't work, I completely uninstalled.
  14. Yeah updated the driver. Now hopefully upgrading to php 7 works too :)
  15. well technically it's more than 0, but less than 1 lol but I'm thinking the mccode dude agrees with you. But almost every value would = a 0.*** prior to any further instructions.
  16. No matter what I try I get division by zero. My first crime is just set at 100, so everyone can begin crimes. My next set I wanted to be their will % -.- zero=zero=zero Just saying I graduated from school about 15 years ago and .92 = 92% My issue is NOT going over 100 -.-
  17. lol well with the args in nothing below the args were working despite the error actually only being a notice. That was because of the ifs. So the arg error wasnt actually the issue. Make sense? lol 1 file, 30 lines, hundreds of possible reasons lol. But it's fixed I think. Removed the args completely (might be a security risk though?) and everything is working. I just cant subscribe to get error reports for crons because of the mysqli notice I get an email every 60 seconds. >.<
  18. I went through the files. Other than the cron_minute the arg isn't called anywhere. However, the beginning of the file has if & else if. Adding another if breaks anything after the original cron info.
  19. As mysql's site no longer offers the tool, can you help me mtg?
  20. I have my cron jobs set to alert me when there is an error. This is what I get   A non-critical error has occurred. Page execution will continue. Below are the details:<br /><strong>PHP Deprecation Notice</strong>: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead (8192)<br /><br /><strong>Line executed</strong>: /home/public_html/class/class_db_mysql.php:82<br /><br />   My cron is   <?php /** * MCCodes Version 2.0.5b * Copyright (C) 2005-2012 Dabomstew * All rights reserved. * * Redistribution of this code in any form is prohibited, except in * the specific cases set out in the MCCodes Customer License. * * This code license may be used to run one (1) game. * A game is defined as the set of users and other game database data, * so you are permitted to create alternative clients for your game. * * If you did not obtain this code from MCCodes.com, you are in all likelihood * using it illegally. Please contact MCCodes to discuss licensing options * in this case. * * File: cron_minute.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; //} if(!isset($_GET['code']) || $_GET['code'] !== $_CONFIG['code']) { exit; } $db->query( "UPDATE `users` SET `hospital` = GREATEST(`hospital` - 1, 0), `jail` = GREATEST(`jail` - 1, 0)"); $counts = $db->fetch_row( $db->query( "SELECT SUM(IF(`hospital` > 0, 1, 0)) AS `hc`, SUM(IF(`jail` > 0, 1, 0)) AS `jc` FROM `users`")); $db->query( "UPDATE `settings` SET `conf_value` = '{$counts['hc']}' WHERE `conf_name` = 'hospital_count'"); $db->query( "UPDATE `settings` SET `conf_value` = '{$counts['jc']}' WHERE `conf_name` = 'jail_count'"); $expired = $db->query("SELECT `userid`,`expire` FROM `users` WHERE `expire`=1"); while($ex=$db->fetch_row($expired)) { $findout = $db->query("SELECT `strength`,`agility`,`guard` FROM `oldstats` WHERE `userid`=".$ex['userid'].""); $update = $db->fetch_row($findout); $db->query("UPDATE `userstats` SET `agility`=".$update['agility'].",`strength`=".$update['strength'].",`guard`=".$update['guard']." WHERE `userid`=".$ex['userid'].""); } $db->query("DELETE FROM `oldstats` WHERE `userid`=".$ex['userid'].""); $db->query("UPDATE `users` SET `expire`=0 WHERE `userid`=".$ex['userid'].""); $db->query("UPDATE `rehab` SET `rTIME`=`rTIME`-1 WHERE `rTIME`>0"); # check if there is anyone traveling $tcheck = $db->query("SELECT `time`,`userid`,`location`,`ttype` FROM `traveling` WHERE `time` >= 0"); if($db->num_rows($tcheck)) { while($t = $db->fetch_row($tcheck)) { if($t['time']) { $db->query("UPDATE `traveling` SET `time` = GREATEST(`time` - 1, 0)"); if(mt_rand(1,3) == 3) { $insured = $db->query("SELECT `insured`,`money` FROM `users` WHERE `userid` = {$t['userid']}"); $in = $db->fetch_row($insured); if($in['insured']) { $travelcost = $db->fetch_single($db->query("SELECT `travelcost` FROM `locations` WHERE `ttype` = {$t['ttype']} AND `cityid` = {$t['location']}")); if($t['ttype'] == 'Car') { switch(mt_rand(1,4)) { case 1: $msg = $db->escape("Your tire poped and your car spun out of control"); $time = mt_rand(1,5); $money = $travelcost / 100 * 50 / 2; $in['money'] += $money; $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}',`money` = {$in['money']} WHERE `userid` = {$t['userid']}"); $db->query("INSERT INTO `mail` VALUES (NULL, 0, 0, {$t['userid']}, ".time().", 'Insurance Team', 'As you are insured we have returned half of your travel cost which is ".money_formatter($money)."')"); $db->query("UPDATE `users` SET `new_mail` = `new_mail` + 1 WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); $db->query("DELETE FROM `traveling` WHERE `userid` = {$t['userid']}"); break; case 2: $msg = $db->escape("You fainted while driving"); $time = mt_rand(1,15); $money = $travelcost / 100 * 50 / 2; $in['money'] += $money; $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}',`money` = {$in['money']} WHERE `userid` = {$t['userid']}"); $db->query("INSERT INTO `mail` VALUES (NULL, 0, 0, {$t['userid']}, ".time().", 'Insurance Team', 'As you are insured we have returned half of your travel cost which is ".money_formatter($money)."')"); $db->query("UPDATE `users` SET `new_mail` = `new_mail` + 1 WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); $db->query("DELETE FROM `traveling` WHERE `userid` = {$t['userid']}"); break; case 3: $msg = $db->escape("A crazy driver ran you off the road"); $time = mt_rand(1,25); $money = $travelcost / 100 * 50 / 2; $in['money'] += $money; $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}',`money` = {$in['money']} WHERE `userid` = {$t['userid']}"); $db->query("INSERT INTO `mail` VALUES (NULL, 0, 0, {$t['userid']}, ".time().", 'Insurance Team', 'As you are insured we have returned half of your travel cost which is ".money_formatter($money)."')"); $db->query("UPDATE `users` SET `new_mail` = `new_mail` + 1 WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); $db->query("DELETE FROM `traveling` WHERE `userid` = {$t['userid']}"); break; case 4; $msg = $db->escape("Your car engine exploded"); $time = mt_rand(1,50); $money = $travelcost / 100 * 50 / 2; $in['money'] += $money; $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}',`money` = {$in['money']} WHERE `userid` = {$t['userid']}"); $db->query("INSERT INTO `mail` VALUES (NULL, 0, 0, {$t['userid']}, ".time().", 'Insurance Team', 'As you are insured we have returned half of your travel cost which is ".money_formatter($money)."')"); $db->query("UPDATE `users` SET `new_mail` = `new_mail` + 1 WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); $db->query("DELETE FROM `traveling` WHERE `userid` = {$t['userid']}"); break; } } else if($t['ttype'] == 'Boat') { switch(mt_rand(1,3)) { case 1: $msg = $db->escape("Your boat hit a rock and you bumped your head"); $time = mt_rand(1,5); $money = $travelcost / 100 * 50 / 2; $in['money'] += $money; $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}',`money` = {$in['money']} WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); break; case 2: $msg = $db->escape("The boats engine stopped working and you tried to fix it and lost your hand"); $time = mt_rand(1,15); $money = $travelcost / 100 * 50 / 2; $in['money'] += $money; $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}',`money` = {$in['money']} WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); break; case 3: $msg = $db->escape("The boats engine exploded"); $time = mt_rand(1,25); $money = $travelcost / 100 * 50 / 2; $in['money'] += $money; $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}',`money` = {$in['money']} WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); break; } } else if($t['ttype'] == 'Bus') { switch(mt_rand(1,3)) { case 1: $msg = $db->escape("The bus swearved another car and tumbled over you were hurt in acident"); $time = mt_rand(1,5); $money = $travelcost / 100 * 50 / 2; $in['money'] += $money; $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}',`money` = {$in['money']} WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); break; case 2: $msg = $db->escape("Gang of thugs pull a driveby on your bus"); $time = mt_rand(1,15); $money = $travelcost / 100 * 50 / 2; $in['money'] += $money; $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}',`money` = {$in['money']} WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); break; case 3: $msg = $db->escape("The buses engine exploded"); $time = mt_rand(1,25); $money = $travelcost / 100 * 50 / 2; $in['money'] += $money; $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}',`money` = {$in['money']} WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); break; } } else { switch(mt_rand(1,2)) { case 1: $msg = $db->escape("Pilot fell aleep at wheel lucky the co was there and stoped a big acidident"); $time = mt_rand(1,5); $money = $travelcost / 100 * 50 / 2; $in['money'] += $money; $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}',`money` = {$in['money']} WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); break; case 2: $msg = $db->escape("Planes Engines failed and crashed you were the only survior"); $time = mt_rand(1,45); $money = $travelcost / 100 * 50 / 2; $in['money'] += $money; $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}',`money` = {$in['money']} WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); break; } } } else { if($t['ttype'] == 'Car') { switch(mt_rand(1,4)) { case 1: $msg = $db->escape("Your tire poped and your car spun out of control"); $time = mt_rand(1,5); $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}'WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); $db->query("DELETE FROM `traveling` WHERE `userid` = {$t['userid']}"); break; case 2: $msg = $db->escape("You fainted while driving"); $time = mt_rand(1,15); $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}' WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); $db->query("DELETE FROM `traveling` WHERE `userid` = {$t['userid']}"); break; case 3: $msg = $db->escape("A crazy driver ran you off the road"); $time = mt_rand(1,25); $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}' WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); $db->query("DELETE FROM `traveling` WHERE `userid` = {$t['userid']}"); break; case 4; $msg = $db->escape("Your car engine exploded"); $time = mt_rand(1,50); $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}' WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); $db->query("DELETE FROM `traveling` WHERE `userid` = {$t['userid']}"); break; } } else if($t['ttype'] == 'Boat') { switch(mt_rand(1,3)) { case 1: $msg = $db->escape("Your boat hit a rock and you bumped your head"); $time = mt_rand(1,5); $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}' WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); break; case 2: $msg = $db->escape("The boats engine stopped working and you tried to fix it and lost your hand"); $time = mt_rand(1,15); $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}' WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); break; case 3: $msg = $db->escape("The boats engine exploded"); $time = mt_rand(1,25); $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}' WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); break; } } else if($t['ttype'] == 'Bus') { switch(mt_rand(1,3)) { case 1: $msg = $db->escape("The bus swearved another car and tumbled over you were hurt in acident"); $time = mt_rand(1,5); $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}' WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); break; case 2: $msg = $db->escape("Gang of thugs pull a driveby on your bus"); $time = mt_rand(1,15); $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}' WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); break; case 3: $msg = $db->escape("The buses engine exploded"); $time = mt_rand(1,25); $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}' WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); break; } } else { switch(mt_rand(1,2)) { case 1: $msg = $db->escape("Pilot fell aleep at wheel lucky the co was there and stoped a big acidident"); $time = mt_rand(1,5); $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}' WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); break; case 2: $msg = $db->escape("Planes Engines failed and crashed you were the only survior"); $time = mt_rand(1,45); $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}' WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); break; } } } } } else { $db->query("UPDATE `users` SET `location` = {$t['location']},`traveling` = 0 WHERE `userid` = {$t['userid']}"); $db->query("DELETE FROM `traveling` WHERE `userid` = {$t['userid']} AND `time` = 0"); } } }
  21. I'm guessing the first take would just be a simple take. Just a visit the city and take. And a warning would be issued anytime a pres or vice pres try to travel from their city that one of them must be in the city at all times, or they forfeit the city (lose the city and it becomes openly available) Basically the stats from the gang members are combined. So if 3 members have 1mill stats in strength then the combined stats would be 3 mill in strength vs the other gangs defense. The gang with the higher combined stat would win. (strength for the challenger and defense for the defender)
  22. I have a few that are argc that keep my crons from running. It's not just the day one, but the minute one too.
  23. yeah but to me there is still something about using java. I'd like the only java I use to be keeping the bars updated.
  24. There's no screenshot. This is more cosmetic than functional. So a screenshot needs to be seen before just flat out forking over $20
×
×
  • Create New...