Jump to content
MakeWebGames

boionfire81

Members
  • Posts

    532
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by boionfire81

  1. I'm looking for a mod that gangs can own a city. To own a city the gang pres or vice pres must reside in that city (i.e. can not leave the city unless the vice is in that city during the time they are gone) The city can be stolen from them by another gang through a fight that lasts 24 hours. The fight would be each members stats combined to total gang stats for fight. But if a member is only in the city for **% of the 24 hours, only **% of their stats will count towards the fight. The losing gang of the fight is banned from the city for 7 days.   plan to extend this later. But for now just want to take care of the "ownership" value.  
  2. This line is keeping my cron day from running   require_once('globals_nonauth.php'); if ($argc == 2) { if ($argc[1] != $_CONFIG['code']) { exit; } } else if (!isset($_GET['code']) || $_GET['code'] !== $_CONFIG['code']) { exit; }   reason argc undefined. It is right under globals.php
  3. For some reason it's not updating brew time. You click brew, and game over. You're stuck with that brew time forever.
  4. Kinda yeah. Basically filtering for those with massive amounts of items.
  5. does not work. To many errors to post. Probably because no sql.
  6. Nice one! Abandoned my paid for this one. excellent job!
  7. 2.0.5 items page is one slab. everything in one list. What I want to do is make the item page display items by category (through switching tabs). But you cant just say food and it only display food items. You have to define the term. Not sure how to define the term so it can be called to display only items from that category (itmtype id #)
  8. I'm trying to redesign the inventory page so each type is in a tab. Problem is trying to figure out how to define the item type so I can simply call it like $food or $weapon, etc.
  9. Ok so for the pull   require('globals.php'); $query = $db->query("SELECT `inv_qty` FROM inventory WHERE inv_userid = {$userid} AND `inv_itemid` = array('7','40','50','51')");   Keep in mind guys that php 5.6 has to be used with mccodes.
  10. Attempting a fishing mod that will require the player to own a boat, a rod, and bait. Upon fishing 1 bait would be removed from their inventory. They would then receive 1-2 fish in their inventory upon success, or lose their rod and/or boat upon failure. But right now I can't even seem to get past the item check. Anyone care to take a look and let me know where I'm messing up at?   <?php require('globals.php'); if($ir['hospital'] || $ir['jail']) { echo "This page can't be accessed while in jail or hospital."; } global $db; $query = $db->query("SELECT `inv_qty` FROM inventory WHERE inv_userid = {$userid} AND `inv_itemid` = 40"); $query = $db->query("SELECT `inv_qty` FROM inventory WHERE inv_userid = {$userid} AND `inv_itemid` = 7"); $query = $db->query("SELECT `inv_qty` FROM inventory WHERE inv_userid = {$userid} AND `inv_itemid` = 51"); if($inv_qty == 0) { echo "You are missing one of the required items. <a href='fishingshop.php' class='button'>Shop</a>"; $h->endpage(); exit; } else { switch(mt_rand(1,10)) { case 1: if(mt_rand(1,3) ==1) { item_remove(40,$userid,1); echo "You did not find any fish while fishing this turn."; } case 2: if(mt_rand(1,8) == 1) { echo "Your rod broke in the water."; item_remove(40,$userid,1); item_remove(7,$userid,1); } case 3: if(mt_rand(1,3) == 1) { $item = `inv_itemid`; item_add(50,$userid,1); item_remove(40,$userid,1); echo "You managed to catch a fish."; } case 4: if(mt_rand(1,6) ==1) { item_add(50,$userid,2); item_remove(40,$userid,1); echo "You grabbed 2 fish this time woa nice one."; } case 5: if(mt_rand(1,10) ==1) { item_remove(40,$userid,1); item_remove(7,$userid,1); item_remove(51,$userid,1); $hospital = mt_rand(1,3 * $ir['level']); $hospreason = $db->escape('Boat sunk while fishing.'); $db->query("UPDATE `users` SET `hospital` = `hospital` + {$hospital},`hospreason` = '{$hospreason}' WHERE `userid` = {$ir['userid']}"); echo "You're boat sunk while fishing you lost everything and landed in hospital for {$hospital} minutes."; } } } /* Item ID Numbers *bait = 40 *rod = 7 *fish = 50 *boat = 51 */ $h->endpage(); exit;
  11. what file does that go in?
  12. Where do I set the time length of login before auto kick? i.e. stay logged in for 24 hours?
  13. Yeah, simply mod the bb code. Works well. I did have debug on though and there is a simple "notice" A non-critical error has occurred. Page execution will continue. Below are the details: PHP Notice: Undefined variable: news (8) Posting this to subscribe for updates.
  14. It will work for V2.0.5 I'm working on an updated version. Will post code soon.
  15. my bad, just mysql as I had to downgrade my php to work for the mccode.
  16. Right now my debug is turned on so I see every little error even. I'm using mysqli with mccode v2.0.5 Issue here is if I input the weapon category id which is 15 then the buy ammunition link doesn't appear. If I remove just the 15 the button will appear, but then tells me it is not a valid weapon when I try to buy ammo. The error on inventory.php without the id is of course: A non-critical error has occurred. Page execution will continue. Below are the details: PHP Notice: Undefined index: weip (8) A non-critical error has occurred. Page execution will continue. Below are the details: PHP Notice: Undefined variable: i (8)
  17. $_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 itmid={$_POST['ID']} AND i.itmtype=15 AND inv_userid=$userid"); if($db->num_rows($q)==0) does not seem to correspond to a valid mysql. I updated to item type 15 (gun). But the mysql structure is does not contain those values. I'm just learning to read mysql, so please bear with me here.
  18. Looks like guest might have a lack of smexi. Bruh, if you can't help, why you talking?
  19. So far my solution is populating the data into the standard users and house tables. I have no clue how to make one form disperse the same info into 2 tables. So adding houses seems to be fine. But I'm getting an error at editing. I can select the house, but then on loading next step I get A critical error has occurred, and page execution has stopped. Below are the details: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3 Action taken: Attempted to execute query: SELECT `hWILL`, `hPRICE`, `hNAME` FROM `houses` WHERE `hID` =   Here is the add & edit php code.   function addhouse() { global $db, $ir, $c, $h, $userid; $price = (isset($_POST['price']) && is_numeric($_POST['price'])) ? abs(intval($_POST['price'])) : ''; $will = (isset($_POST['will']) && is_numeric($_POST['will'])) ? abs(intval($_POST['will'])) : ''; $name = (isset($_POST['name']) && preg_match( "/^[a-z0-9_]+([\\s]{1}[a-z0-9_]|[a-z0-9_])+$/i", $_POST['name'])) ? $db->escape(strip_tags(stripslashes($_POST['name']))) : ''; if ($price && $will && $name) { staff_csrf_stdverify('staff_addhouse', 'staff_houses.php?action=addhouse'); $q = $db->query( "SELECT COUNT(`hID`) FROM `houses` WHERE `hWILL` = {$will}"); if ($db->fetch_single($q) > 0) { $db->free_result($q); echo 'Sorry, you cannot have two houses with the same conscience.<br /> > <a href="staff_houses.php?action=addhouse">Go Back</a>'; die($h->endpage()); } $db->free_result($q); $db->query( "INSERT INTO `houses` VALUES(NULL, '$name', '$price', '$will', '$picture', '$description')"); stafflog_add('Created House ' . $name); echo 'House ' . $name . ' added to the game.<br /> > <a href="staff.php">Go Back</a>'; die($h->endpage()); } else { $csrf = request_csrf_html('staff_addhouse'); echo " <h3>Add House</h3> <hr /> <form action='staff_houses.php?action=addhouse' method='post'> Name: <input type='text' name='name' /><br /> Price: <input type='text' name='price' /><br /> Conscience: <input type='text' name='will' /><br /> Picture: <input type='text' name='picture'><br /> Description:<br /> <textarea name='description'></textarea> <br /> {$csrf} <input type='submit' value='Add House' /> </form> "; } } function edithouse() { global $db, $ir, $c, $h, $userid; if (!isset($_POST['step'])) { $_POST['step'] = '0'; } switch ($_POST['step']) { case "2": $price = (isset($_POST['price']) && is_numeric($_POST['price'])) ? abs(intval($_POST['price'])) : 0; $will = (isset($_POST['will']) && is_numeric($_POST['will'])) ? abs(intval($_POST['will'])) : 0; $_POST['id'] = (isset($_POST['id']) && is_numeric($_POST['id'])) ? abs(intval($_POST['id'])) : 0; if (!$price || !$will || !$_POST['id']) { echo 'Sorry, invalid input. <br />> <a href="staff_houses.php?action=edithouse">Go Back</a>'; die($h->endpage()); } staff_csrf_stdverify('staff_edithouse2', 'staff_houses.php?action=edithouse'); $q = $db->query( "SELECT `hID` FROM `houses` WHERE `hWILL` = {$will} AND `hID` != {$_POST['id']}"); if ($db->num_rows($q)) { echo 'Sorry, you cannot have two houses with the same conscience. <br />> <a href="staff_houses.php?action=edithouse">Go Back</a>'; die($h->endpage()); } $q = $db->query( 'SELECT `hWILL` FROM `houses` WHERE `hID` = ' . $_POST['ID']); if ($db->num_rows($q) == 0) { $db->free_result($q); echo 'Invalid house.<br /> > <a href="staff_houses.php?action=edithouse">Go Back</a>'; die($h->endpage()); } $oldwill = $db->fetch_single($q); $name = (isset($_POST['name']) && preg_match( "/^[a-z0-9_]+([\\s]{1}[a-z0-9_]|[a-z0-9_])+$/i", $_POST['name'])) ? $db->escape(strip_tags(stripslashes($_POST['name']))) : ''; if ($oldwill == 100 && $oldwill != $will) { echo 'Sorry, this house\'s conscience bar cannot be edited.<br /> > <a href="staff_houses.php?action=edithouse">Go Back</a>'; die($h->endpage()); } $db->query( "UPDATE `houses` SET `hWILL` = $will, `hPRICE` = $price, `hNAME` = '$name' WHERE `hID` = {$_POST['id']}"); $db->query( "UPDATE `users` SET `maxwill` = $will, `will` = LEAST(`will`, $will) WHERE `maxwill` = {$old['hWILL']}"); stafflog_add('Edited house ' . $name); echo 'House ' . $name . ' was edited successfully.<br /> > <a href="staff_houses.php?action=edithouse">Go Back</a>'; die($h->endpage()); break; case "1": $_POST['house'] = (isset($_POST['house']) && is_numeric($_POST['house'])) ? abs(intval($_POST['house'])) : 0; staff_csrf_stdverify('staff_edithouse1', 'staff_houses.php?action=edithouse'); $q = $db->query( "SELECT `hWILL`, `hPRICE`, `hNAME` FROM `houses` WHERE `hID` = {$_POST['id']}"); if ($db->num_rows($q) == 0) { $db->free_result($q); echo 'Invalid house.<br /> > <a href="staff_houses.php?action=edithouse">Go Back</a>'; die($h->endpage()); } $old = $db->fetch_row($q); $db->free_result($q); $csrf = request_csrf_html('staff_edithouse2'); echo " <h3>Editing a House</h3> <hr /> <form action='staff_houses.php?action=edithouse' method='post'> <input type='hidden' name='step' value='2' /> <input type='hidden' name='id' value='{$_POST['id']}' /> Name: <input type='text' name='name' value='{$old['hNAME']}' /> <br /> Price: <input type='text' name='price' value='{$old['hPRICE']}' /> <br /> Conscience: <input type='text' name='will' value='{$old['hWILL']}' /> <br /> Picture: <input type='text' name='picture' value='{$old['hWILL']}' /> <br /> Description:<br /> <textarea name='description'>{$old['hWILL']}</textarea> <br /> {$csrf} <input type='submit' value='Edit House' /> </form> "; break; default: $csrf = request_csrf_html('staff_edithouse1'); echo " <h3>Editing a House</h3> <hr /> <form action='staff_houses.php?action=edithouse' method='post'> <input type='hidden' name='step' value='1' /> House: " . house_dropdown(NULL, "house") . " <br /> {$csrf} <input type='submit' value='Edit House' /> </form> "; break; } }
  20. ok so just   [color=#000000][color=#007700]if([/color][color=#0000BB]array_key_exists[/color][color=#007700]([[/color][color=#DD0000]'itmid'[/color][color=#007700],[/color][color=#DD0000]'someThingElse'[/color][color=#007700]],[/color][color=#0000BB]$r[/color][color=#007700])) {[/color][/color]   then let the file flow through & add an extra } at the end?
  21. Yeah, probably end up going that route. Just curious how php handles chinese lol!
  22. I handle the change manually. I cant write mysql yet but I have learned a bit for reading it. :)
  23. Sorry guest. But if the script isnt complete, it's not complete. Noob or not.
  24. Yeah this is an awesome idea. Thinking of not using trade able meds, and just use this.
  25. I just have about 6 or 7 cities where I'd like their description to show in their own language. If the database isn't possible, what about coding it via an print statement with the link coded as well. Basically not dynamic.
×
×
  • Create New...