Jump to content
MakeWebGames

shrek1609

Members
  • Posts

    310
  • Joined

  • Last visited

    Never

Everything posted by shrek1609

  1. Re: Itempedia FREE V2 Mod... Change this line   [b]Money:[/b] £{$ir['money']} OR {$fm}   to   [b]Money:[/b] £{$fm}   and please don't hijack my threads with help requests that are nothing to do with what i have posted
  2. Re: Itempedia FREE V2 Mod... I knew nothing a few months ago and have learnt alot by reading through the code of mods that people have posted... I have found people VERY helpful on here... so long as you show a willingness to learn and not just constantly asking for free help...
  3. Re: [V2]Items table Not being funny mate but this request is just laziness... Part of running an online game is to set it upto how you want the game to play... If you aren't prepared to put the time in you aren't going to get very far with it...
  4. Re: Itempedia FREE V2 Mod... If you don't have a Gang Armory use this code...   <?php include "globals.php"; print"<h2>Itempedia</h2>"; print"<font color='red'><h3>[b](Owned Totals do not include Equipped items or items on markets!!!)[/b]</h3></font>"; print" <table width=95% cellspacing=1 class='table'><tr><th>Item Type</th><th>Item Name</th><th>Attributes</th><th>Buy Price</th><th>Sale Price</th><th>Owned by:</th></tr>"; $q=$db->query("SELECT * FROM items where itmtype = 3 ORDER BY itmbuyprice ASC"); $cn=0; while($p=$db->fetch_row($q)) { $d=$db->query("SELECT inv_id FROM inventory where inv_itemid={$p['itmid']}"); $r=$db->num_rows($d); $cn++; print"<tr><td>Weapon</td><td>[url='iteminfo.php?ID={$p[']{$p['itmname']}[/url]</td><td>{$p['itmdesc']}</td><td>{$p['itmbuyprice']}</td><td>{$p['itmsellprice']}</td>"; print"<td>$r Members</td></tr>"; } $q=$db->query("SELECT * FROM items where itmtype = 4 ORDER BY itmbuyprice ASC"); $cn=0; while($p=$db->fetch_row($q)) { $d=$db->query("SELECT inv_id FROM inventory where inv_itemid={$p['itmid']}"); $cn++; print"<tr><td>Armour</td><td>[url='iteminfo.php?ID={$p[']{$p['itmname']}[/url]</td><td>{$p['itmdesc']}</td><td>{$p['itmbuyprice']}</td><td>{$p['itmsellprice']}</td>"; print"<td>$r Members</td></tr>"; } $q=$db->query("SELECT * FROM items where itmtype = 1 ORDER BY itmbuyprice ASC"); $cn=0; while($p=$db->fetch_row($q)) { $d=$db->query("SELECT inv_id FROM inventory where inv_itemid={$p['itmid']}"); $r=$db->num_rows($d); $cn++; print"<tr><td>Drugs and Potions</td><td>[url='iteminfo.php?ID={$p[']{$p['itmname']}[/url]</td><td>{$p['itmdesc']}</td><td>{$p['itmbuyprice']}</td><td>{$p['itmsellprice']}</td>"; print"<td>$r Members</td></tr>"; } $q=$db->query("SELECT * FROM items where itmtype = 2 ORDER BY itmbuyprice ASC"); $cn=0; while($p=$db->fetch_row($q)) { $d=$db->query("SELECT inv_id FROM inventory where inv_itemid={$p['itmid']}"); $r=$db->num_rows($d); $cn++; print"<tr><td>Donator Items</td><td>[url='iteminfo.php?ID={$p[']{$p['itmname']}[/url]</td><td>{$p['itmdesc']}</td><td>{$p['itmbuyprice']}</td><td>{$p['itmsellprice']}</td>"; print"<td>$r Members</td></tr>"; } print"</table>"; $h->endpage(); ?>
  5. Re: The Drug Deal --- Free V2 Mod forgot to say remember to add links to drugmarket.php and druginv.php whereever you want them :D
  6. I knew nothing about coding a few months ago and learnt so much from criminal existence that i have decided to try and give something back to your community... I have just posted The Drug Deal mod i made... And here is the itempedia mod i made... Screen Shot <?php include "globals.php"; print"<h2>Itempedia</h2>"; print"<font color='red'><h3>[b](Owned Totals do not include Equipped items or items on markets!!!)[/b]</h3></font>"; print" <table width=95% cellspacing=1 class='table'><tr><th>Item Type</th><th>Item Name</th><th>Attributes</th><th>Buy Price</th><th>Sale Price</th><th>Owned by:</th><th>Owned by:</tr>"; $q=$db->query("SELECT * FROM items where itmtype = 3 ORDER BY itmbuyprice ASC"); $cn=0; while($p=$db->fetch_row($q)) { $d=$db->query("SELECT inv_id FROM inventory where inv_itemid={$p['itmid']}"); $r=$db->num_rows($d); $s=$db->query("SELECT armoryID FROM gangarmory where armoryITEMID ={$p['itmid']}"); $x=$db->num_rows($s); $cn++; print"<tr><td>Weapon</td><td>[url='iteminfo.php?ID={$p[']{$p['itmname']}[/url]</td><td>{$p['itmdesc']}</td><td>{$p['itmbuyprice']}</td><td>{$p['itmsellprice']}</td>"; print"<td>$r Members</td><td>$x Gangs</td></tr>"; } $q=$db->query("SELECT * FROM items where itmtype = 4 ORDER BY itmbuyprice ASC"); $cn=0; while($p=$db->fetch_row($q)) { $d=$db->query("SELECT inv_id FROM inventory where inv_itemid={$p['itmid']}"); $r=$db->num_rows($d); $s=$db->query("SELECT armoryID FROM gangarmory where armoryITEMID ={$p['itmid']}"); $x=$db->num_rows($s); $cn++; print"<tr><td>Armour</td><td>[url='iteminfo.php?ID={$p[']{$p['itmname']}[/url]</td><td>{$p['itmdesc']}</td><td>{$p['itmbuyprice']}</td><td>{$p['itmsellprice']}</td>"; print"<td>$r Members</td><td>$x Gangs</td></tr>"; } $q=$db->query("SELECT * FROM items where itmtype = 1 ORDER BY itmbuyprice ASC"); $cn=0; while($p=$db->fetch_row($q)) { $d=$db->query("SELECT inv_id FROM inventory where inv_itemid={$p['itmid']}"); $r=$db->num_rows($d); $s=$db->query("SELECT armoryID FROM gangarmory where armoryITEMID ={$p['itmid']}"); $x=$db->num_rows($s); $cn++; print"<tr><td>Drugs and Potions</td><td>[url='iteminfo.php?ID={$p[']{$p['itmname']}[/url]</td><td>{$p['itmdesc']}</td><td>{$p['itmbuyprice']}</td><td>{$p['itmsellprice']}</td>"; print"<td>$r Members</td><td>$x Gangs</td></tr>"; } $q=$db->query("SELECT * FROM items where itmtype = 2 ORDER BY itmbuyprice ASC"); $cn=0; while($p=$db->fetch_row($q)) { $d=$db->query("SELECT inv_id FROM inventory where inv_itemid={$p['itmid']}"); $r=$db->num_rows($d); $s=$db->query("SELECT armoryID FROM gangarmory where armoryITEMID ={$p['itmid']}"); $x=$db->num_rows($s); $cn++; print"<tr><td>Donator Items</td><td>[url='iteminfo.php?ID={$p[']{$p['itmname']}[/url]</td><td>{$p['itmdesc']}</td><td>{$p['itmbuyprice']}</td><td>{$p['itmsellprice']}</td>"; print"<td>$r Members</td><td>$x Gangs</td></tr>"; } print"</table>"; $h->endpage(); ?> You may need to edit this slightly to fit the items you have on your game but they are pretty simple edits if needed... Remember to add the link to itempedia.php where ever you want it
  7. Re: The Drug Deal --- Free V2 Mod Either create a new file called cron_drug.php or add the following to your cron_day.php If adding to existing cron_day.php only add the code below where i have commented...   <?php include "config.php"; global $_CONFIG; if($_GET['code'] != $_CONFIG['code']) { die(""); } 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; //if adding to cron_day only add from here downwards $d=$db->query("SELECT * FROM drugs where drugid=1"); $t=$db->fetch_row($d); $chance6 = rand(50,100); $db->query("UPDATE drugs SET price=$chance6 WHERE drugid=1"); if ($t['lowprice'] > $chance6) { $db->query("UPDATE drugs SET lowprice=$chance6 WHERE drugid=1"); } if ($t['highprice'] < $chance6) { $db->query("UPDATE drugs SET highprice=$chance6 WHERE drugid=1"); } $d=$db->query("SELECT * FROM drugs where drugid=2"); $t=$db->fetch_row($d); $chance7 = rand(75,125); $db->query("UPDATE drugs SET price=$chance7 WHERE drugid=2"); if ($t['lowprice'] > $chance7) { $db->query("UPDATE drugs SET lowprice=$chance7 WHERE drugid=2"); } if ($t['highprice'] < $chance7) { $db->query("UPDATE drugs SET highprice=$chance7 WHERE drugid=2"); } $d=$db->query("SELECT * FROM drugs where drugid=3"); $t=$db->fetch_row($d); $chance8 = rand(100,150); $db->query("UPDATE drugs SET price=$chance8 WHERE drugid=3"); if ($t['lowprice'] > $chance8) { $db->query("UPDATE drugs SET lowprice=$chance8 WHERE drugid=3"); } if ($t['highprice'] < $chance8) { $db->query("UPDATE drugs SET highprice=$chance8 WHERE drugid=3"); } $d=$db->query("SELECT * FROM drugs where drugid=4"); $t=$db->fetch_row($d); $chance1 = rand(125,175); $db->query("UPDATE drugs SET price=$chance1 WHERE drugid=4"); if ($t['lowprice'] > $chance1) { $db->query("UPDATE drugs SET lowprice=$chance1 WHERE drugid=4"); } if ($t['highprice'] < $chance1) { $db->query("UPDATE drugs SET highprice=$chance1 WHERE drugid=4"); } $d=$db->query("SELECT * FROM drugs where drugid=5"); $t=$db->fetch_row($d); $chance2 = rand(150,200); $db->query("UPDATE drugs SET price=$chance2 WHERE drugid=5"); if ($t['lowprice'] > $chance2) { $db->query("UPDATE drugs SET lowprice=$chance2 WHERE drugid=5"); } if ($t['highprice'] < $chance2) { $db->query("UPDATE drugs SET highprice=$chance2 WHERE drugid=5"); } $d=$db->query("SELECT * FROM drugs where drugid=6"); $t=$db->fetch_row($d); $chance3 = rand(175,225); $db->query("UPDATE drugs SET price=$chance3 WHERE drugid=6"); if ($t['lowprice'] > $chance3) { $db->query("UPDATE drugs SET lowprice=$chance3 WHERE drugid=6"); } if ($t['highprice'] < $chance3) { $db->query("UPDATE drugs SET highprice=$chance3 WHERE drugid=6"); } $d=$db->query("SELECT * FROM drugs where drugid=7"); $t=$db->fetch_row($d); $chance4 = rand(200,250); $db->query("UPDATE drugs SET price=$chance4 WHERE drugid=7"); if ($t['lowprice'] > $chance4) { $db->query("UPDATE drugs SET lowprice=$chance4 WHERE drugid=7"); } if ($t['highprice'] < $chance4) { $db->query("UPDATE drugs SET highprice=$chance4 WHERE drugid=7"); } $d=$db->query("SELECT * FROM drugs where drugid=8"); $t=$db->fetch_row($d); $chance5 = rand(225,275); $db->query("UPDATE drugs SET price=$chance5 WHERE drugid=8"); if ($t['lowprice'] > $chance5) { $db->query("UPDATE drugs SET lowprice=$chance5 WHERE drugid=8"); } if ($t['highprice'] < $chance5) { $db->query("UPDATE drugs SET highprice=$chance5 WHERE drugid=8"); } ?>   create a file called runonce.php   <?php include "globals.php"; $q=$db->query("SELECT * FROM users"); while($r=$db->fetch_row($q)) { $db->query("INSERT INTO druginv VALUES({$r['userid']}, 0, 0, 0, 0, 0, 0, 0, 0, 1000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)"); } $h->endpage(); ?>   Ok now you have created all these files upload them to your server... Import the following mysql...   -- -- Table structure for table `drugs` -- CREATE TABLE IF NOT EXISTS `drugs` ( `drugid` int(11) NOT NULL auto_increment, `drugname` varchar(255) NOT NULL, `price` int(11) NOT NULL, `lowprice` int(11) NOT NULL, `highprice` int(11) NOT NULL, PRIMARY KEY (`drugid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ; -- -- Dumping data for table `drugs` -- INSERT INTO `drugs` (`drugid`, `drugname`, `price`, `lowprice`, `highprice`) VALUES (1, 'Space Dust', 94, 94, 94), (2, 'Crackle', 84, 84, 110), (3, 'Galactic Ganja', 128, 104, 128), (4, 'Wiz', 141, 137, 161), (5, 'Star Smack', 155, 155, 175), (6, 'Uranus Uppers', 204, 187, 215), (7, 'Krakanite', 237, 206, 238), (8, 'Moon Mushrooms', 232, 232, 262); -- -- Table structure for table `druginv` -- CREATE TABLE IF NOT EXISTS `druginv` ( `invid` int(11) NOT NULL default '0', `drug1` int(11) NOT NULL default '0', `drug2` int(11) NOT NULL default '0', `drug3` int(11) NOT NULL default '0', `drug4` int(11) NOT NULL default '0', `drug5` int(11) NOT NULL default '0', `drug6` int(11) NOT NULL default '0', `drug7` int(11) NOT NULL default '0', `drug8` int(11) NOT NULL default '0', `drugqty` int(11) NOT NULL default '1000', `buy1` int(11) NOT NULL default '0', `buy2` int(11) NOT NULL default '0', `buy3` int(11) NOT NULL default '0', `buy4` int(11) NOT NULL default '0', `buy5` int(11) NOT NULL default '0', `buy6` int(11) NOT NULL default '0', `buy7` int(11) NOT NULL default '0', `buy8` int(11) NOT NULL default '0', `sell1` int(11) NOT NULL default '0', `sell2` int(11) NOT NULL default '0', `sell3` int(11) NOT NULL default '0', `sell4` int(11) NOT NULL default '0', `sell5` int(11) NOT NULL default '0', `sell6` int(11) NOT NULL default '0', `sell7` int(11) NOT NULL default '0', `sell8` int(11) NOT NULL default '0', PRIMARY KEY (`invid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;     THE IMPORTANT PART... *** AFTER DOING THE FOLLOWING EDIT YOU MUST QUICKLY RUN THE FILE runonce.php *** open register.php and FIND   $db->query("INSERT INTO userstats VALUES($i, 10, 10, 10, 10, 10)");   ADD BELOW   $db->query("INSERT INTO druginv VALUES($i, 0, 0, 0, 0, 0, 0, 0, 0, 1000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)");   NOW QUICKLY RUN... www.yourgamename.com/runonce.php And thats if folks you are all done... Remember if you created the new cron_drug.php to add that to your cron jobs and remember to add your cron code at the end of the url...
  8. I'm Still a noob so please be kind with the feedback... I have fully tested this and works well..... This is basically a drug stock market, members can buy upto 1000 drugs and at day update the prices will fluctuate between a high price and a low price randomly... Screen Shots: *** Important follow the instructions to install carefully... *** Create a file called drugbuy.php <?php include "globals.php"; $_GET['ID']= abs((int) $_GET['ID']); $_POST['qty']= abs((int) $_POST['qty']); if(!$_GET['ID'] || !$_POST['qty']) { print "Invalid use of file"; } else if($_POST['qty'] <= 0) { print "You have been added to the delete list for trying to cheat the game."; } else { $q=$db->query("SELECT * FROM drugs WHERE drugid={$_GET['ID']}"); if(mysql_num_rows($q) == 0) { print "Invalid item ID"; } else { $itemd=$db->fetch_row($q); if($ir['money'] < $itemd['price']*$_POST['qty']) { print "You don't have enough money to buy this item!"; $h->endpage(); exit; } $price=($itemd['price']*$_POST['qty']); $qty=($_POST['qty']); $x=$db->query("SELECT * FROM druginv WHERE invid=$userid"); $y=$db->fetch_row($x); if (strlen($qty) > 4) { print "Invalid entry muppet"; $h->endpage(); exit; } if ($qty > $y['drugqty']) { print "Stupid!!! You can't carry this many drugs"; $h->endpage(); exit; } if ($_GET['ID'] ==1) { $db->query("UPDATE users SET money=money-$price WHERE userid=$userid"); $db->query("UPDATE druginv SET drug1=drug1+$qty WHERE invid=$userid"); $db->query("UPDATE druginv SET drugqty=drugqty-$qty WHERE invid=$userid"); $db->query("UPDATE druginv SET buy1=buy1+$price WHERE invid=$userid"); print "You bought {$_POST['qty']} {$itemd['drugname']} for \$$price"; } if ($_GET['ID'] ==2) { $db->query("UPDATE users SET money=money-$price WHERE userid=$userid"); $db->query("UPDATE druginv SET drug2=drug2+$qty WHERE invid=$userid"); $db->query("UPDATE druginv SET drugqty=drugqty-$qty WHERE invid=$userid"); $db->query("UPDATE druginv SET buy2=buy2+$price WHERE invid=$userid"); print "You bought {$_POST['qty']} {$itemd['drugname']} for \$$price"; } if ($_GET['ID'] ==3) { $db->query("UPDATE users SET money=money-$price WHERE userid=$userid"); $db->query("UPDATE druginv SET drug3=drug3+$qty WHERE invid=$userid"); $db->query("UPDATE druginv SET drugqty=drugqty-$qty WHERE invid=$userid"); $db->query("UPDATE druginv SET buy3=buy3+$price WHERE invid=$userid"); print "You bought {$_POST['qty']} {$itemd['drugname']} for \$$price"; } if ($_GET['ID'] ==4) { $db->query("UPDATE users SET money=money-$price WHERE userid=$userid"); $db->query("UPDATE druginv SET drug4=drug4+$qty WHERE invid=$userid"); $db->query("UPDATE druginv SET drugqty=drugqty-$qty WHERE invid=$userid"); $db->query("UPDATE druginv SET buy4=buy4+$price WHERE invid=$userid"); print "You bought {$_POST['qty']} {$itemd['drugname']} for \$$price"; } if ($_GET['ID'] ==5) { $db->query("UPDATE users SET money=money-$price WHERE userid=$userid"); $db->query("UPDATE druginv SET drug5=drug5+$qty WHERE invid=$userid"); $db->query("UPDATE druginv SET drugqty=drugqty-$qty WHERE invid=$userid"); $db->query("UPDATE druginv SET buy5=buy5+$price WHERE invid=$userid"); print "You bought {$_POST['qty']} {$itemd['drugname']} for \$$price"; } if ($_GET['ID'] ==6) { $db->query("UPDATE users SET money=money-$price WHERE userid=$userid"); $db->query("UPDATE druginv SET drug6=drug6+$qty WHERE invid=$userid"); $db->query("UPDATE druginv SET drugqty=drugqty-$qty WHERE invid=$userid"); $db->query("UPDATE druginv SET buy6=buy6+$price WHERE invid=$userid"); print "You bought {$_POST['qty']} {$itemd['drugname']} for \$$price"; } if ($_GET['ID'] ==7) { $db->query("UPDATE users SET money=money-$price WHERE userid=$userid"); $db->query("UPDATE druginv SET drug7=drug7+$qty WHERE invid=$userid"); $db->query("UPDATE druginv SET drugqty=drugqty-$qty WHERE invid=$userid"); $db->query("UPDATE druginv SET buy7=buy7+$price WHERE invid=$userid"); print "You bought {$_POST['qty']} {$itemd['drugname']} for \$$price"; } if ($_GET['ID'] ==8) { $db->query("UPDATE users SET money=money-$price WHERE userid=$userid"); $db->query("UPDATE druginv SET drug8=drug8+$qty WHERE invid=$userid"); $db->query("UPDATE druginv SET drugqty=drugqty-$qty WHERE invid=$userid"); $db->query("UPDATE druginv SET buy8=buy8+$price WHERE invid=$userid"); print "You bought {$_POST['qty']} {$itemd['drugname']} for \$$price"; } } } $h->endpage(); ?> Create a file called druginv.php <?php include "globals.php"; print"<h3>Your Drug Inventory</h3>"; $q=$db->query("SELECT * FROM druginv where invid=$userid"); $r=$db->fetch_row($q); $used=1000-$r['drugqty']; $format = number_format($r['drugqty']); $format1 = number_format($used); print " <table width=50% cellspacing=1 class='table'><tr><th colspan='3'>Your Drug Pouch</th></tr> <tr><th>Total Capacity</th><th>Space Used</th><th>Free Space</th></tr> <tr><td>1,000</td><td>$format1<td>$format</td></tr></table> "; print " <table width=95% cellspacing=1 class='table'><tr><th>Drug Name</th><th>Amount Owned</th><th>Total Spent</th><th>Total Earnt</th><th>Total Profit</th><th>Sell Quantity</th><th>Action</th></tr>"; $formatted1 = number_format($r['buy1']); $formatted2 = number_format($r['sell1']); print"<tr> <td>Space Dust</td><td>{$r['drug1']}</td><td>\$$formatted1</td><td>$$formatted2</td>"; $total=$r['sell1'] - $r['buy1']; $formatted3 = number_format($total); print"<td>$$formatted3</td> <td><form action='drugsell.php?ID=1' method='post'>Qty: <input type='text' name='qty' size='4' value='{$r['drug1']}' maxlength='4' /><td><input type='submit' value='Sell' /></td></form></td> </tr>"; $formatted1 = number_format($r['buy2']); $formatted2 = number_format($r['sell2']); print"<tr> <td>Crackle</td><td>{$r['drug2']}</td><td>\$$formatted1</td><td>$$formatted2</td>"; $total=$r['sell2'] - $r['buy2']; $formatted3 = number_format($total); print"<td>$$formatted3</td> <td><form action='drugsell.php?ID=2' method='post'>Qty: <input type='text' name='qty' size='4' value='{$r['drug2']}' maxlength='4' /><td><input type='submit' value='Sell' /></td></form></td> </tr>"; $formatted1 = number_format($r['buy3']); $formatted2 = number_format($r['sell3']); print"<tr> <td>Galactic Ganja</td><td>{$r['drug3']}</td><td>\$$formatted1</td><td>$$formatted2</td>"; $total=$r['sell3'] - $r['buy3']; $formatted3 = number_format($total); print"<td>$$formatted3</td> <td><form action='drugsell.php?ID=3' method='post'>Qty: <input type='text' name='qty' size='4' value='{$r['drug3']}' maxlength='4' /><td><input type='submit' value='Sell' /></td></form></td> </tr>"; $formatted1 = number_format($r['buy4']); $formatted2 = number_format($r['sell4']); print"<tr> <td>Wiz</td><td>{$r['drug4']}</td><td>\$$formatted1</td><td>$$formatted2</td>"; $total=$r['sell4'] - $r['buy4']; $formatted3 = number_format($total); print"<td>$$formatted3</td> <td><form action='drugsell.php?ID=4' method='post'>Qty: <input type='text' name='qty' size='4' value='{$r['drug4']}' maxlength='4' /><td><input type='submit' value='Sell' /></td></form></td> </tr>"; $formatted1 = number_format($r['buy5']); $formatted2 = number_format($r['sell5']); print"<tr> <td>Star Smack</td><td>{$r['drug5']}</td><td>\$$formatted1</td><td>$$formatted2</td>"; $total=$r['sell5'] - $r['buy5']; $formatted3 = number_format($total); print"<td>$$formatted3</td> <td><form action='drugsell.php?ID=5' method='post'>Qty: <input type='text' name='qty' size='4' value='{$r['drug5']}' maxlength='4' /><td><input type='submit' value='Sell' /></td></form></td> </tr>"; $formatted1 = number_format($r['buy6']); $formatted2 = number_format($r['sell6']); print"<tr> <td>Uranus Uppers</td><td>{$r['drug6']}</td><td>\$$formatted1</td><td>$$formatted2</td>"; $total=$r['sell6'] - $r['buy6']; $formatted3 = number_format($total); print"<td>$$formatted3</td> <td><form action='drugsell.php?ID=6' method='post'>Qty: <input type='text' name='qty' size='4' value='{$r['drug6']}' maxlength='4' /><td><input type='submit' value='Sell' /></td></form></td> </tr>"; $formatted1 = number_format($r['buy7']); $formatted2 = number_format($r['sell7']); print"<tr> <td>Krakanite</td><td>{$r['drug7']}</td><td>\$$formatted1</td><td>$$formatted2</td>"; $total=$r['sell7'] - $r['buy7']; $formatted3 = number_format($total); print"<td>$$formatted3</td> <td><form action='drugsell.php?ID=7' method='post'>Qty: <input type='text' name='qty' size='4' value='{$r['drug7']}' maxlength='4' /><td><input type='submit' value='Sell' /></td></form></td> </tr>"; $formatted1 = number_format($r['buy8']); $formatted2 = number_format($r['sell8']); print"<tr> <td>Moon Mushrooms</td><td>{$r['drug8']}</td><td>\$$formatted1</td><td>$$formatted2</td>"; $total=$r['sell8'] - $r['buy8']; $formatted3 = number_format($total); print"<td>$$formatted3</td> <td><form action='drugsell.php?ID=8' method='post'>Qty: <input type='text' name='qty' size='4' value='{$r['drug8']}' maxlength='4' /><td><input type='submit' value='Sell' /></td></form></td> </tr>"; print"</table>"; $h->endpage(); ?> Create a file called drugmarket.php <?php include "globals.php"; $d=$db->query("SELECT * FROM druginv where invid={$ir['userid']}"); $t=$db->fetch_row($d); print " <h3>The Drug Deal</h3>"; $used=1000-$t['drugqty']; $format = number_format($t['drugqty']); $format1 = number_format($used); print " <table width=50% cellspacing=1 class='table'><tr><th colspan='3'>Your Drug Pouch</th></tr> <tr><th>Total Capacity</th><th>Space Used</th><th>Free Space</th></tr> <tr><td>1,000</td><td>$format1<td>$format</td></tr><tr><td colspan='3'>[url='druginv.php']<font color='red'>[b]Click here to check your Drug Inventory[/b]</font>[/url]</td></tr></table> "; print"<font color='red'>[size="1"](remember prices fluctuate daily)[/size]</font> <table width=95% cellspacing=1 class='table'> <tr><th>Drug Name</th><th>Current Price</th><th>Lowest Recorded Price</th><th>Highest Recorded Price</th><th>Buy Quantity</th><th>Action</th></tr>"; $q=$db->query("SELECT * FROM drugs"); while($r=$db->fetch_row($q)) { print"<tr><td>{$r['drugname']}</td><td>\${$r['price']} each</td><td>\${$r['lowprice']} each</td><td>\${$r['highprice']} each</td><td><form action='drugbuy.php?ID={$r['drugid']}' method='post'>Qty: <input type='text' name='qty' size='4' value='0' maxlength='4' /><td><input type='submit' value='Buy' /></td></form></td></tr>"; } print"</table>"; $h->endpage(); ?> Create a file called drugsell.php <?php include "globals.php"; $_GET['ID']= abs((int) $_GET['ID']); $_POST['qty']= abs((int) $_POST['qty']); if(!$_GET['ID'] || !$_POST['qty']) { print "Invalid use of file"; } else if($_POST['qty'] <= 0) { print "You have been added to the delete list for trying to cheat the game."; } else { $q=$db->query("SELECT * FROM druginv WHERE invid=$userid"); $r=$db->fetch_row($q); if(mysql_num_rows($q) == 0) { print "Stop Trying to Cheat"; } else { if ($_GET['ID'] ==1) { $x=$db->query("SELECT * FROM drugs WHERE drugid=1"); $y=$db->fetch_row($x); $price=($y['price']*$_POST['qty']); $qty=($_POST['qty']); if (strlen($qty) > 4) { print "Invalid entry muppet"; $h->endpage(); exit; } if($_POST['qty'] > $r['drug1']) { print "Don't be Stupid you don't have that many."; } else { $db->query("UPDATE users SET money=money+$price WHERE userid=$userid"); $db->query("UPDATE druginv SET drug1=drug1-$qty WHERE invid=$userid"); $db->query("UPDATE druginv SET drugqty=drugqty+$qty WHERE invid=$userid"); $db->query("UPDATE druginv SET sell1=sell1+$price WHERE invid=$userid"); print "You sold {$_POST['qty']} {$y['drugname']} for \$$price"; } } if ($_GET['ID'] ==2) { $x=$db->query("SELECT * FROM drugs WHERE drugid=2"); $y=$db->fetch_row($x); $price=($y['price']*$_POST['qty']); $qty=($_POST['qty']); if($_POST['qty'] > $r['drug2']) { print "Don't be Stupid you don't have that many."; } else { $db->query("UPDATE users SET money=money+$price WHERE userid=$userid"); $db->query("UPDATE druginv SET drug2=drug2-$qty WHERE invid=$userid"); $db->query("UPDATE druginv SET drugqty=drugqty+$qty WHERE invid=$userid"); $db->query("UPDATE druginv SET sell2=sell2+$price WHERE invid=$userid"); print "You sold {$_POST['qty']} {$y['drugname']} for \$$price"; } } if ($_GET['ID'] ==3) { $x=$db->query("SELECT * FROM drugs WHERE drugid=3"); $y=$db->fetch_row($x); $price=($y['price']*$_POST['qty']); $qty=($_POST['qty']); if($_POST['qty'] > $r['drug3']) { print "Don't be Stupid you don't have that many."; } else { $db->query("UPDATE users SET money=money+$price WHERE userid=$userid"); $db->query("UPDATE druginv SET drug3=drug3-$qty WHERE invid=$userid"); $db->query("UPDATE druginv SET drugqty=drugqty+$qty WHERE invid=$userid"); $db->query("UPDATE druginv SET sell3=sell3+$price WHERE invid=$userid"); print "You sold {$_POST['qty']} {$y['drugname']} for \$$price"; } } if ($_GET['ID'] ==4) { $x=$db->query("SELECT * FROM drugs WHERE drugid=4"); $y=$db->fetch_row($x); $price=($y['price']*$_POST['qty']); $qty=($_POST['qty']); if($_POST['qty'] > $r['drug4']) { print "Don't be Stupid you don't have that many."; } else { $db->query("UPDATE users SET money=money+$price WHERE userid=$userid"); $db->query("UPDATE druginv SET drug4=drug4-$qty WHERE invid=$userid"); $db->query("UPDATE druginv SET drugqty=drugqty+$qty WHERE invid=$userid"); $db->query("UPDATE druginv SET sell4=sell4+$price WHERE invid=$userid"); print "You sold {$_POST['qty']} {$y['drugname']} for \$$price"; } } if ($_GET['ID'] ==5) { $x=$db->query("SELECT * FROM drugs WHERE drugid=5"); $y=$db->fetch_row($x); $price=($y['price']*$_POST['qty']); $qty=($_POST['qty']); if($_POST['qty'] > $r['drug5']) { print "Don't be Stupid you don't have that many."; } else { $db->query("UPDATE users SET money=money+$price WHERE userid=$userid"); $db->query("UPDATE druginv SET drug5=drug5-$qty WHERE invid=$userid"); $db->query("UPDATE druginv SET drugqty=drugqty+$qty WHERE invid=$userid"); $db->query("UPDATE druginv SET sell5=sell5+$price WHERE invid=$userid"); print "You sold {$_POST['qty']} {$y['drugname']} for \$$price"; } } if ($_GET['ID'] ==6) { $x=$db->query("SELECT * FROM drugs WHERE drugid=6"); $y=$db->fetch_row($x); $price=($y['price']*$_POST['qty']); $qty=($_POST['qty']); if($_POST['qty'] > $r['drug6']) { print "Don't be Stupid you don't have that many."; } else { $db->query("UPDATE users SET money=money+$price WHERE userid=$userid"); $db->query("UPDATE druginv SET drug6=drug6-$qty WHERE invid=$userid"); $db->query("UPDATE druginv SET drugqty=drugqty+$qty WHERE invid=$userid"); $db->query("UPDATE druginv SET sell6=sell6+$price WHERE invid=$userid"); print "You sold {$_POST['qty']} {$y['drugname']} for \$$price"; } } if ($_GET['ID'] ==7) { $x=$db->query("SELECT * FROM drugs WHERE drugid=7"); $y=$db->fetch_row($x); $price=($y['price']*$_POST['qty']); $qty=($_POST['qty']); if($_POST['qty'] > $r['drug7']) { print "Don't be Stupid you don't have that many."; } else { $db->query("UPDATE users SET money=money+$price WHERE userid=$userid"); $db->query("UPDATE druginv SET drug7=drug7-$qty WHERE invid=$userid"); $db->query("UPDATE druginv SET drugqty=drugqty+$qty WHERE invid=$userid"); $db->query("UPDATE druginv SET sell7=sell7+$price WHERE invid=$userid"); print "You sold {$_POST['qty']} {$y['drugname']} for \$$price"; } } if ($_GET['ID'] ==8) { $x=$db->query("SELECT * FROM drugs WHERE drugid=8"); $y=$db->fetch_row($x); $price=($y['price']*$_POST['qty']); $qty=($_POST['qty']); if($_POST['qty'] > $r['drug8']) { print "Don't be Stupid you don't have that many."; } else { $db->query("UPDATE users SET money=money+$price WHERE userid=$userid"); $db->query("UPDATE druginv SET drug8=drug8-$qty WHERE invid=$userid"); $db->query("UPDATE druginv SET drugqty=drugqty+$qty WHERE invid=$userid"); $db->query("UPDATE druginv SET sell8=sell8+$price WHERE invid=$userid"); print "You sold {$_POST['qty']} {$y['drugname']} for \$$price"; } } } } $h->endpage(); ?>
  9. Re: Searching Also bought this very nice mod ;) Reload very helpful with questions too :)
  10. Re: FREE V2 NEW GAME STATS PAGE I've painted my game name out of the screenshot as not sure whether advertising your site in anyway is allowed on here ;) But coding puts your game name in automatically anyway ;) Its not a massive mod but is a much better game stats page than the mccodes default one ;)
  11. Re: FREE V2 NEW GAME STATS PAGE Screen shot for you :-D
  12. I've revamped the Game Stats page made it alot less cluttered and it now has the number of users in the last 15 minutes, 1 hour and 24 hours... Plus a record ever total of the previous 3... SQL   CREATE TABLE IF NOT EXISTS `records` ( `recID` int(11) NOT NULL DEFAULT 1, `rec24` int(11) NOT NULL DEFAULT 1, `rec60` int(11) NOT NULL DEFAULT 1, `rec15` int(11) NOT NULL DEFAULT 1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;   REPLACE STATS.PHP WITH THIS   <?php include "globals.php"; $q=$db->query("SELECT userid FROM users"); $membs=$db->num_rows($q); $q=$db->query("SELECT userid FROM users WHERE bankmoney>-1"); $banks=$db->num_rows($q); $q=$db->query("SELECT userid FROM users WHERE gender='Male'"); $male=$db->num_rows($q); $q=$db->query("SELECT userid FROM users WHERE gender='Female'"); $fem=$db->num_rows($q); $total=0; $q=$db->query("SELECT money FROM users"); while($r=$db->fetch_row($q)) { $total+=$r['money']; } $avg=(int) ($total/$membs); $totalb=0; $q=$db->query("SELECT bankmoney FROM users WHERE bankmoney>-1"); while($r=$db->fetch_row($q)) { $totalb+=$r['bankmoney']; } $avgb=(int) ($totalb/$banks); $totalc=0; $q=$db->query("SELECT crystals FROM users"); while($r=$db->fetch_row($q)) { $totalc+=$r['crystals']; } $totali=0; $q=$db->query("SELECT inv_qty FROM inventory"); while($r=$db->fetch_row($q)) { $totali+=$r['inv_qty']; } $avgc=(int) ($totalc/$membs); $q=$db->query("SELECT mail_id FROM mail"); $mail=$db->num_rows($q); $q=$db->query("SELECT evID FROM events"); $events=$db->num_rows($q); $q=mysql_query("SELECT * FROM records WHERE recid=1",$c); $v=mysql_fetch_array($q); $q=mysql_query("SELECT username FROM users WHERE laston>unix_timestamp()-300*300 ORDER BY laston DESC",$c); $twsev=mysql_num_rows($q); $q=mysql_query("SELECT username FROM users WHERE laston>unix_timestamp()-60*60 ORDER BY laston DESC",$c); $lasthr=mysql_num_rows($q); $q=mysql_query("SELECT username,userid,laston FROM users WHERE laston>unix_timestamp()-15*60 ORDER BY laston DESC",$c); $fifteen=mysql_num_rows($q); if ($v['rec15']<$fifteen) {mysql_query("UPDATE records SET rec15=$fifteen WHERE recid=1",$c);} if ($v['rec24']<$twsev) {mysql_query("UPDATE records SET rec24=$twsev WHERE recid=1",$c);} if ($v['rec60']<$lasthr) {mysql_query("UPDATE records SET rec60=$lasthr WHERE recid=1",$c);} print "<h3>Mafia Hoodz Statistics</h3> You step into the Statistics Department and login to the service. You see some stats that interest you. <table width=75% cellspacing=1 class='table' border='1' bordercolor='#636363'> <tr> <th colspan=2>Users</th></tr> <tr><td colspan=2> There are currently <font color='red'>$membs</font> {$set['game_name']} players, <font color='green'>$male</font> males and <font color='green'>$fem</font> females.</td> </tr> <tr> <th colspan=2>Users Bank Statistics</th></tr> <tr><td colspan=2>Amount of players with bank accounts: <font color='red'>$banks</font></td> </tr> <tr><td colspan=2>Amount of cash in banks: <font color='red'>\$".money_formatter($totalb,"").". </font></td> </tr> <tr><td colspan=2>The average player has in their bank accnt: <font color='red'>\$".money_formatter($avgb,"").". </font></td> </tr> <tr><th>Users Money</th><th>Users Crystals</th></tr> <tr><td>Amount of cash in circulation: <font color='red'>\$".money_formatter($total,"").". </font></td> <td>Amount of crystals in circulation: <font color='red'>".money_formatter($totalc,"").". </font></td></tr> <tr><td>The average player has: <font color='red'>\$".money_formatter($avg,"").". </font></td> <td>The average player has: <font color='red'>".money_formatter($avgc,"")." </font>crystals.</td></tr> <tr> <th>Mails/Events</th><th>Items</th></tr><tr><td> <font color='red'>".money_formatter($mail,"")."</font> mails and <font color='red'>".money_formatter($events,"")." </font>events have been sent.</td> <td> There are currently <font color='red'>".money_formatter($totali,"")." </font>items in circulation.</td> </tr> <tr><th>Users Online Statistics</th><th>Users Online All Time Records</th></tr> <tr><td>Within the last 15 minutes: <font color='red'>$fifteen</font></td><td>15 Minutes Record: <font color='red'>{$v['rec15']}</font></td></tr> <tr><td>Within the last hour: <font color='red'>$lasthr </font></td><td>1 Hour Record: <font color='red'>{$v['rec60']}</font></td></tr> <tr><td>Within the last 24 hours: <font color='red'>$twsev</font></td><td>1 Day Record: <font color='red'>{$v['rec24']}</font></td></tr> </table>"; $h->endpage(); ?>   And enjoy :)
  13. Re: Free 2 - Roulette hi nyna No if they bet on both red and black now say $100 on each they will profit by $50 if they bet $100 on red and win they win $200 ($300 if you include the betted amount) if they bet $100 on red and lose the lose $100 So i think it needs to be that if they bet $100 on red and win the win $100 ($200 if you include betted amount)
  14. Re: Free 2 - Roulette Sorry nyna still problems with it... If they bet $1000 on red and black they gain $500 If they just bet on red and win they win $2000 and gain $2000 (<<< i think this should be a gain of $1000) If they just bet on red and lose they lose $1000 (<<< this is fine)
  15. Re: Free 2 - Roulette Thank Nyna really appreciate you releasing this for free and giving support with it :)
  16. Re: Free 2 - Roulette Sorry another slight problem that has fixed them being able to win if the cover both bets say red and black now it takes money first... but i think the winning amount needs changing as they only win the amount they betted... ie bet $500 it takes $500 they win pays out $500 so if they win they gain 0
  17. Re: Free 2 - Roulette Tested on all possible combinations and works a treat thanks Nyna :)
  18. Re: Please help with staff names hi no it doesn't work :( my code for the admin coloured names i thought should work but doesn't and its really doing my head in... The code to change forum name to red for donators is already there so i can't understand why the code i have added doesn't work...
  19. Re: Free 2 - Gym Thanks Nyna... I am learning but knew nothing 3 weeks ago so still getting my head round some bits ;) Sorry for seeming thick :(
  20. Re: Free 2 - Gym Maybe a slight hiccup... For the ranking's it seems to be taking into account the NPC's stats as well would it be possible to exclude the NPC's stats :)
  21. Re: Free 2 - Gym Wow now this is really nice... The hardcore statters hate training because of the annoying dropdown box :) This is perfect thanks again
  22. Re: Free 2 - Roulette love it added it already :-D Thank you
  23. I'm trying to get my staff names a different colour in the forums... I've managed it everywhere else but like hell i can work it out for forums... i've found this (2 instances of this code) $u=$ir['username']; if($ir['ul_color']) { $uname="<font color='{$ir['ul_color']}'>"; if($ir['ul_isbold']) { $uname.=""; } $uname.=$ir['username']; if($ir['ul_isbold']) { $uname.=""; } $uname.="</font>"; $u=$uname; } else if($ir['donatordays']) { $u = "<font color=red>{$ir['username']}</font>"; } and added else if($ir['user_level'] ==2) { $u = "<font color=red>{$ir['username']}</font>"; } But that doesnt work :( If anyone could solve this would be very grateful... Please dont do too complicated answer as only just learning ;)
  24. Re: BBcode not working thanks for help its now fixed it was some security i had added that was stopping bbcode being used :)
  25. Got a problem with BBcode not working in forums or profile sig... they keep getting this error ERROR! - An invalid entry has been made if this error consists contact id 1
×
×
  • Create New...