
Newbie
Members-
Posts
289 -
Joined
-
Last visited
-
Days Won
3
Content Type
Profiles
Forums
Events
Everything posted by Newbie
-
Thanks kyle i was looking over the code last night and i noticed it was pointless so will end up recoding it also got few ideas for updates and started adding random cash for level groups but have not got around to testing it yet been working all week
-
i am getting back into coding and going to be doing more to this and some of my other modification out there thanks for the idea if anyone else has any post them up and ill see what i can do
-
try change line 158 to code tag is messed up <li><a href='staff_logs.php?action=commentlogs'class="link1">Comment Log</a></li>
-
oRPG Creator Updates: A Text Game Maker for non-programmers
Newbie replied to Sim's topic in Game Projects
looks good well done got any demos up? -
it looks good i like it just not to sure on the red what is your prices for psd or a psd coded into html/css?
-
i think he means you need 2 mccodes v2 licenses if you paid for ravens script off his site doesn't really count as its a mccodes engine v2 with a different layout which i have seen people say is stolen too
-
so whats gona happen with grpg?
-
if you still need work done i can help
-
nice thanks for this
-
open seedbuy.php and look for free_result(); and delete that out as i use version 2.0b
-
contact your host tell them no errors are showing up not all hosts have it activated they should activate it
-
i will give it a try tommorow but from what you have posted its the same thing i tried
-
it just says query error when i try to add the shop using staff menu it worked when i did this but only inserted the info that was already in $s=$db->query("SELECT * FROM `growshop`"); while ($r = $db->fetch_row($s)) { $gri=$r['item_name']; $gsp=$r['item_price']; $gss=$r['stock']; $db->query("UPDATE TABLE `growshop` VALUES('', '$gri', '$gsp', '$gss'"); echo "$gsi has been added to the growshop }
-
so i attempted the staff file to add a item to the grow shop (failed) <?php require_once("sglobals.php"); switch($_GET['action']) { case "newgrowitem": newitem_form(); break; case "newgrowitemsub": new_item_submit(); break; default: echo "<br /> Script requires a action<br /> <a href='index.php'><input type='submit' value='Go Back'></a>"; break; } function newitem_form() { global $db,$ir,$c,$h; print "<h3>Adding a item to GrowShop</h3> <form action='staff_hydro.php?action=newgrowitemsub' method='post'> Item Name: <input type='text' name='gsi' value='' /><br /> Item Price: <input type='text' name='gsp' value='' /><br /> Stock: <input type='text' name='gss' value='' /><br /> <input type='submit' value='Create Shop' /></form>"; } function new_item_submit() { global $db,$ir,$c,$h; if(!isset($_POST['gsi']) || !isset($_POST['gsp'])) { print "You missed a field, go back and try again.<br /> <a href='staff_hydro.php?action=newgrowitem'>> Back</a>"; } else { $gsi=$_POST['gsi']; $gsp=$_POST['gsp']; $gss=$_POST['gss']; $db->query("INSERT INTO growshop VALUES('',{$_POST['gsi']},'$gsp','$gss')"); print "The $gsi item was successfully added to the growshop."; stafflog_add("Added item $gsi to growshop"); } } $h->endpage(); ?> there is something up with the query :( any help would be greatfull
-
ok i managed to add the buy any qty op updated overwrite old seedbank.php with new one and add seedbuy.php to your main directory and your done Thanks for the help kyle
-
alright cool thanks kyle ill take a look later when got some time and try sort that and the error you spotted
-
1. Nope i didnt thanks for pointing that out. My location number 3 is America i did this because i was planning on adding in a bit for users to get busted if they dont have a medical card which only place i know of which does such a thing in real life is america in some states 3. not quite sure how to do this i imaging it would be sumthing like in the shops you select amount and buy it ill look into it and see what i can do 4. i am not to good at staff files but ill give it a go thanks for your comment steve
-
EDIT: V1 connertion
-
haha never thought of that done now
-
yep there is something up with the images here not showing ill try get a better screenshot
-
UPDATED 22/01/2014 ok small update if you use growsetup below this messgage and insert the new database table then it will insert there and you will need to add small bit of code to cron day CREATE TABLE `drugsonthego` ( `id` int(10) NOT NULL auto_increment, `userid` int(10) NOT NULL default '0', `timeleft` bigint(20) NOT NULL default '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ; then use new growsetup below growsetup.php <?php require_once("globals.php"); switch($_GET['action']) { case "start": start_grow(); break; case "info": info(); break; default: index(); break; } function index() { global $db, $ir,$c,$userid,$h; echo "<center> <table class='table' width='75%'> <th><center>Grow Set Up</th> <tr><td><i><center>Here you can set up your own grow and make profit from the plants</i></td> </tr></table> <table class='table' width='25%'> <td><a href='growsetup.php?action=info'><input type='submit' value='Check Info'></a></td><td><a href='growsetup.php?action=start'><input type='submit' value='Start Growing'></a></td></table>"; } function info() { global $db, $ir,$c,$userid,$h; echo "<center> <table class='table' width='50%'> <td><center>Your Seeds: {$ir['seeds']}</td><tr> <td><center>Ounces: {$ir['ounces']}</td><tr> <td><center><a href='growsetup.php'><input type='submit' value='Go Back'></a></td></tr></table>"; } function start_grow() { global $db, $ir,$c,$userid,$h; if ($ir['growing'] == 1) // Change number to max number of plants { echo "<font color=red>Max of 1 Plant<font> <table class='table' width='14%'> <td><center><a href='growsetup.php'><input type='submit' value='Go Back'></a></td></table>"; $h->endpage(); exit; } if ($ir['seeds'] == 0 || $ir['hydrokit'] == 0) { echo "<center> <font color=red>No seeds or equipment</font> <table class='table' width='14%'> <td><center><a href='growsetup.php'><input type='submit' value='Go Back'></a></td></table>"; $h->endpage(); exit; } if ($ir['seeds'] >= 1 && $ir['hydrokit'] == 1) { $growtime = rand(3,7); echo " <b>You plant your cannabis Seed and wait for it to grow.</b>"; $db->query("INSERT INTO `drugsonthego` (`userid`,`timeleft` ) "."VALUES ('{$ir['userid']}', '".$growtime."')"); } } $h->endpage(); ?> and last the cron info now open up your daily cron and put this in it $res = $db->query("SELECT `timeleft` FROM `drugsonthego` WHERE `userid` = '$userid'"); while($row = $db->fetch_row($res)) { if($row['timeleft'] > 0 && $row['userid'] == $ir['userid']) { $db->query("UPDATE `drugsonthego` SET `timeleft` = `timeleft` - 1 WHERE `timeleft` > 0 AND `userid` = '$userid'"); } if($row['timeleft'] == 0 && $ir['seeds'] > 0 && $ir['hydrokit'] == 1) { $payout = rand(1,100); $db->query("UPDATE `users` SET `ounces` = `ounces` + $payout WHERE `id` = '$userid'"); event_send($row['userid], "You have completed your grow you have been awarded {$ounces} of weed for your hard work."); $db->query("DELETE FROM `drugsonthego` WHERE `timeleft` = 0"); } } this is untested so any bugs or whatever post here and ill take a look Here is my Grow Weed Mod Files > seedbank.php > growsetup.php > growshop.php > medical.php SQL > Seed Bank > Grow Shop > 4 tables in users ----------------------------------------- Info Users can buy a hydroponics setup and seeds which will give them access to growing some weed unfortunately i ran into some bumps during the writing of this modification so had to rewrite some of the files when a user sets up a grow the payout is instant (until i can get it changed) random of 1-100 ounces easily changed i have tested and not found any errors so if you find any post here and ill see what i can do. Database files first updated 22.01.14 ALTER TABLE `users` ADD `medical` int(11) NOT NULL DEFAULT '0', ADD `hydrokit` int(11) NOT NULL DEFAULT '0', ADD `seeds` int(11) NOT NULL DEFAULT '0', ADD `ounces` int(11) NOT NULL DEFAULT '0'; CREATE TABLE IF NOT EXISTS `growshop` ( `shopID` int(11) NOT NULL AUTO_INCREMENT, `item_name` text NOT NULL, `item_price` int(11) NOT NULL DEFAULT '0', `stock` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`shopID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; INSERT INTO `growshop` (`shopID`, `item_name`, `item_price`, `stock`) VALUES (1, 'Complete Grow Kit', 25000, 792); Change the 792 to anything you want stock to be i extracted it from my table so its updated the random stock number for that day CREATE TABLE IF NOT EXISTS `seedbank` ( `sID` int(11) NOT NULL AUTO_INCREMENT, `sCOST` int(11) NOT NULL DEFAULT '0', `sNAME` text NOT NULL, `sPIC` text NOT NULL, `sAMOUNT` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`sID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; INSERT INTO `seedbank` (`sID`, `sCOST`, `sNAME`, `sPIC`, `sAMOUNT`) VALUES (1, 1000, 'Female Skunk', 'http://female-seeds.co.uk/content/products/404/white-label-female-seeds-skunk-1-m-663.jpg', 1), (2, 2500, 'Female White Widow', 'http://www.headsite.com/ekmps/shops/hstrading/images/white-widow-feminised-seeds-seedsman-feminised-299-p.jpg', 5); seedbank.php <?php require_once("globals.php"); switch($_GET['action']) { default: index(); break; } function index() { global $db, $ir,$c,$userid,$h; echo "<br /><center> <table class='table' width='75%'> <th>Seed Bank</th> <tr><td><center><i>Welcome to the seed bank</i></td></tr></table><br />"; echo " <table width=75% cellspacing=1 class='table'> <tr style='background:gray'> <th>Seed Name</th> <th>Picture</th> <th>Price</th> <th>Amount of Seeds</th> <th>Buy</th></tr>"; $s=$db->query("SELECT * FROM seedbank LEFT JOIN users u ON u.userid=sNAME ORDER BY sID ASC"); while($r=$db->fetch_row($s)) { $buy_link = "<a href='seedbank.php?action=buy&ID={$r['sID']}'><input type='submit' value='Buy Seed's'></a>"; print "\n<tr> <td><center>{$r['sNAME']}</td> <td><center><img border='0' src='{$r['sPIC']}'width='75' height='75' /></td> <td><center>\${$r['sCOST']}</td> <td><form action='seedbuy.php?ID={$r['sID']}' method='post'> Qty: <input type='text' name='amount' value='1' /><br /></td> <td><center><input type='submit' value='Buy' /></form></td></tr>"; } print "</table>"; } $h->endpage(); ?> seedbuy.php <?php require_once("globals.php"); $_GET['ID'] = (isset($_GET['ID']) && is_numeric($_GET['ID'])) ? abs(intval($_GET['ID'])) : ''; $_POST['amount'] = (isset($_POST['amount']) && is_numeric($_POST['amount'])) ? abs(intval($_POST['amount'])) : ''; if (empty($_GET['ID']) OR empty($_POST['amount'])) { echo 'Invalid use of file'; } else { $q = $db->query("SELECT `sID`, `sCOST`, `sNAME`, `sPIC`, `sAMOUNT` FROM `seedbank` WHERE `sID` = {$_GET['ID']}"); if ($db->num_rows($q) == 0) { echo 'Invalid Seed ID'; } else { $itemd = $db->fetch_row($q); if ($ir['money'] < ($itemd['sCOST'] * $_POST['amount'])) { echo 'You don\'t have enough money to buy ' . $_POST['amount'] . ' ' . $itemd['sNAME'] . '! You need $' . $itemd['sCOST'] * $_POST['amount'] . '<br />> <a href="index.php">Go Home</a>'; die($h->endpage()); } $price = ($itemd['sCOST'] * $_POST['amount']); $amount = ($_POST['amount']); $db->query("UPDATE `users` SET `money` = `money` - $price, `seeds` = `seeds` + $amount WHERE `userid` = $userid"); echo 'You bought ' . $_POST['amount'] . ' ' . $itemd['sNAME'] . ' ' . (($_POST['amount'] > 1) ? 's' : '') . ' for ' . money_formatter($price) . '<br />> <a href="index.php">Go home</a>'; } $db->free_result($q); } $h->endpage(); ?> medical.php <?php require_once("globals.php"); switch($_GET['action']) { case "buy": buy_card(); break; default: index(); break; } function index() { global $db, $ir,$c,$userid,$h; echo "<br /><center> <table class='table' width='100%'> <th>Medical Center</th> <tr> <td><center>So you want a medical card the costs of this card is $100,000</td> <tr> <td><center><a href='medical.php?action=buy'><input type='submit' value='Buy Medical Card?'></a></td> </tr></table>"; } function buy_card() { global $db, $ir,$c,$userid,$h; if ($ir['medical'] == 1) { echo "<br /><center><font color=red>You already own a medical card</font><br /> <a href='index.php'><input type='submit' value='Go home'></a>"; $h->endpage(); exit; } $cost = number_format("100000"); $cost1 = "100000"; if ($ir['money'] < $cost) { echo "<font color=red>You dont have enough money for the medical card</font><br /> <b>You need \$$cost</b><br /> <a href='bank.php'><input type='submit' value='Go to Bank?'></a><br /> <a href='index.php'><input type='submit' value='Go Home?'></a>"; } else { echo "You have paid <font color=green>\$$cost</font> for a medical card<br /> <a href='index.php'><input type='submit' value='Go Home'></a>"; $db->query("UPDATE `users` SET money=money-'$cost1',medical=1 WHERE userid=$userid"); } } $h->endpage(); ?> growshop.php <?php require_once("globals.php"); switch($_GET['action']) { case "buy": buy_kit(); break; default: index(); break; } function index() { global $db, $ir,$c,$userid,$h; echo "<h2>Grow Shop</h2> <i>We sell complete Kits for hydroponics growing</i><br /> <i>The kit includes<br /> > [1] 60x60x160cm Grow Tent.<br /> > [1] 600w HPS Light with reflector & Ballast<br /> > [1] Carbon Filter & ducting<br />"; $s=$db->query("SELECT * FROM `growshop`"); while($r=$db->fetch_row($s)) { echo "<center> <br /><table class='table' width='75%'> <th><img border='0' src='http://kitbagshop.org/images/NEW1.2kit.jpg' alt='Hydroponics Kit' width='500' height='250' /></th> <tr> <td><center>".$r['item_name']."</td> <tr> <td><center>\$".number_format($r['item_price'])."</td> <tr> <td><center>".$r['stock']." in stock</td> <tr> <td><center><a href='growshop.php?action=buy'><input type='submit' value='Buy kit'></a></td> </tr></table>"; } } function buy_kit() { global $db, $ir,$c,$userid,$h; $s=$db->query("SELECT * FROM `growshop`"); while($r=$db->fetch_row($s)) { if($r['stock'] == 0) { echo "<font color=red>There is no stock left</font><br /> <a href='growshop.php'><input type='submit' value='Go Back'></a>"; $h->endpage(); exit; } } $cost = number_format("25000"); $cost2 = "25000"; if($ir['money'] < $cost1) { echo "<br /><font color=red>You dont have enough money you need \$$cost</font><br /> <a href='growshop.php'><input type='submit' value='Go Back'></a>"; } else { echo "<b>You have paid \$$cost for the hydroponics kit</b><br /> <a href='index.php'><input type='submit' value='Go Home'>"; $db->query("UPDATE `users` SET money=money-'$cost2', hydrokit=hydrokit+1 WHERE userid=$userid"); $db->query("UPDATE `growshop` SET stock=stock-1"); } } $h->endpage(); ?> growsetup.php <?php require_once("globals.php"); switch($_GET['action']) { case "start": start_grow(); break; case "info": info(); break; default: index(); break; } function index() { global $db, $ir,$c,$userid,$h; echo "<br /><center> <table class='table' width='75%'> <th><center>Grow Set Up</th> <tr><td><i><center>Here you can set up your own grow and make profit from the plants</i></td> </tr></table><br /> <table class='table' width='25%'> <td><a href='growsetup.php?action=info'><input type='submit' value='Check Info'></a></td><td><a href='growsetup.php?action=start'><input type='submit' value='Start Growing'></a></td></table>"; } function info() { global $db, $ir,$c,$userid,$h; echo "<br /><center> <table class='table' width='50%'> <td><center>Your Seeds: {$ir['seeds']}</td><tr> <td><center>Ounces: {$ir['ounces']}</td><tr> <td><center><a href='growsetup.php'><input type='submit' value='Go Back'></a></td></tr></table>"; } function start_grow() { global $db, $ir,$c,$userid,$h; if ($ir['growing'] == 1) // Change number to max number of plants { echo "<font color=red>Max of 1 Plant<font><br /> <table class='table' width='14%'> <td><center><a href='growsetup.php'><input type='submit' value='Go Back'></a></td></table>"; $h->endpage(); exit; } if ($ir['seeds'] == 0 || $ir['hydrokit'] == 0) { echo "<br /><center> <font color=red>No seeds or equipment</font> <table class='table' width='14%'> <td><center><a href='growsetup.php'><input type='submit' value='Go Back'></a></td></table>"; $h->endpage(); exit; } if ($ir['seeds'] >= 1 && $ir['hydrokit'] == 1) { $random = rand(1,100); echo " <b>You plant your cannabis Seed and wait for it to grow.</b><br /> After 3 months its ready to harvest you made {$random} ounces"; $db->query("UPDATE `users` SET ounces=ounces+'$random', seeds=seeds-1 WHERE userid=$userid"); } } $h->endpage(); ?>
-
EDIT: I have redone the seed bank Added a database table for seeds price amount of seeds profit picture once i work out the paying out ill release it Steve
-
Hello all just wanted to ask if anyone could lend me a hand iv spent the last 4 hours creating a modification for mccodes v2 (4am now) was wondering if anyone could help me out with a cron which will pay them once there growing days hit 0 and not get paid if there days are already at 0 ill give you some of the info for the mod Grow Shop > Sells a hydroponics kit (required for growing) > Random Stock (changes every day if stock is at 0) 100% complete and tested Seed Bank > Buy female cannabis Seed (required for growing) > No stock (might add once iv had some sleep) 100% complete and tested Medical Center > Buy a medical card which will give you risk free growing 100% complete and tested Grow Set Up > Check info ( amount of seeds/days left till grow is finnished) 99% complete and tested (accept paying out) 3 new feilds in users table any help will be greatfull oh almost forgot this is going to be free mod Steve
-
from looking at the code i screwed it up i am going to fix this up when get a chance
-
Edit: took a look at the screenshot and mine is totaly out of place from yours iam missing all the links and the staff info bit doesnt show either could this have something to do with my css file?