
MDK666
Members-
Posts
268 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by MDK666
-
Re: [mccode v2] Fishing Mod to change the exp rate and money rate do this mysql_query("UPDATE users SET fishing_aloud=fishing_aloud-1 WHERE userid=$userid",$c); $rand_fish = rand(1,5000); $rand_money = rand(1000,10000); $rand_exp = rand(1,100); and change it with this mysql_query("UPDATE users SET fishing_aloud=fishing_aloud-1 WHERE userid=$userid",$c); $rand_fish = rand(1,5); $rand_money = rand(10,1000); $rand_exp = rand(1,30);
-
Re: [mccodes v2] arcade i just added this incase someone wants to play still but doesnt want to be bored waiting for energy to refill and etc.
-
Re: [mccodes v2] arcade wow umm i cant post my link to download the file i mean wth its 7mbs of info, oh well ill guess ill do a couple posts of the files.. well since they wont let you download it we will have to do this the hard way, ---------------------------------------------- edit to fit your needs make a file called arcade.php <?php include "globals.php"; ?> <HTML> <BODY> <center> <table width='350' border='0' cellspacing='0' cellpadding='4'> <tr><td class='row2' width='100%' > <div class="tableborder" style="padding: 0px;"> <table border="0" cellpadding="1" cellspacing="1" width="100%"> <tr> <td class="row2" style="padding: 8px 8px 8px; width: 100%"> <legend> <div class="tableborder" style="padding: 0px;"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <td class="row2" style="padding: 8px 8px 8px; width: 100%"> <center>[i]<font size=5>Welcome to the Dark-Arcade</font>[/i]</center> <center>[ Games in Arcade Total: [b]9[/b]</align> | New Games In Arcade : [b]9[/b] ]</center> <center>[ Latest Game(s) added: Spiderman. ]</center> </td> </tr> </table> </div> </legend> <table> <hr> <table border=0 width=100%><td width=10%> [img=games/images/spiderman.gif]<td width=10%>[b]SpiderMan[/b]<FORM> <INPUT type="button" value="Play Game" onClick="window.open('games/spiderman.php','Spiderman','width=600,height=600')"> </form><td width=17%>SpiderMan</td></table> <hr> <hr> <table border=0 width=100%><td width=10%> [img=games/images/streetfighter.gif]<td width=10%>[b]Street Fighter[/b]<FORM> <INPUT type="button" value="Play Game" onClick="window.open('games/streetfighter.php','streetfighter','width=600,height=600')"> </form><td width=17%>Street Fighter</td></table> <hr> <hr> <table border=0 width=100%><td width=10%> [img=games/images/earthling.gif]<td width=10%>[b]Earthling[/b]<FORM> <INPUT type="button" value="Play Game" onClick="window.open('games/earthling.php','earthling','width=600,height=600')"> </form><td width=17%>Earthling</td></table> <hr> <hr> <table border=0 width=100%><td width=10%> [img=games/images/none.gif]<td width=10%>[b]Tactical Assassin 2[/b]<FORM> <INPUT type="button" value="Play Game" onClick="window.open('games/tacticalassassin2.php','tactical assassin 2','width=600,height=600')"> </form><td width=17%>Tactical Assassin 2</td></table> <hr> <hr> <table border=0 width=100%><td width=10%> [img=games/images/auto.gif]<td width=10%>[b]Auto Raceing[/b]<FORM> <INPUT type="button" value="Play Game" onClick="window.open('games/auto.php','auto raceing','width=600,height=600')"> </form><td width=17%>Auto Raceing</td></table> <hr> <hr> <table border=0 width=100%><td width=10%> [img=games/images/elk.gif]<td width=10%>[b]ELK[/b]<FORM> <INPUT type="button" value="Play Game" onClick="window.open('games/elk.php','elk','width=600,height=600')"> </form><td width=17%>ELK</td></table> <hr> <hr> <table border=0 width=100%><td width=10%> [img=games/images/profish.gif]<td width=10%>[b]Pro Fishing[/b]<FORM> <INPUT type="button" value="Play Game" onClick="window.open('games/profish.php','tactical assassin 2','width=600,height=600')"> </form><td width=17%>Pro Fishing</td></table> <hr> <hr> <table border=0 width=100%><td width=10%> [img=games/images/moneystrip.gif]<td width=10%>[b]Strip Poker[/b]<FORM> <INPUT type="button" value="Play Game" onClick="window.open('games/moneystrip.php','tactical assassin 2','width=600,height=600')"> </form><td width=17%>Strip Poker</td></table> <hr> <hr> <table border=0 width=100%><td width=10%> [img=games/images/og.gif]<td width=10%>[b]Oragasm[/b]<FORM> <INPUT type="button" value="Play Game" onClick="window.open('games/og.php','tactical assassin 2','width=600,height=600')"> </form><td width=17%>Oragasm</td></table> <hr> </td> </tr> </table></table> <center><a href=http://ww.the-dark-hosting.com>The-Dark-Hosting.com</a>2008</center> </BODY> </HTML> make a file for each game that you have and call it the gamesname.php like on mine i have game called oragasim but the file name is called og.php. make sure to have a folder called games and in the folder make another folder called images <html> <embed src="/games/auto.swf" width='600' height='600' align="center" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed> </html>
-
Re: [mccodes v2] arcade try it again i just finished uploading it sry about that its kinda a big file
-
This i will point out in the begining before i post or even add a download link to this arcade, YOU MUST.... i repeat YOU MUST.... leave my copyright link in the file and/or put something at the top of the files linking to my site. all you have to do is download the zip, upload arcade.php to your root directory, then add the folder games to your root directory, then edit your main menu or explore with a link to arcade. thats all there is to add it into your game.. now on creating new games you must look in arcade theres <-------Start Game --------> <-------End Game----------> those are meaning the game script starts you need to add one of those to the file everytime you add a game, also on makeing the game work if you look in the games folder youll see a .swf file and a .php file the .swf is the game, and the .php is what grabs the plays the game. so to say how it works it looks like this Arcade Calls -----> /games/gamename.php Calls ------> /games/game.swf Link Removed - Offsite content Please post your code here. This it to protect you as CE will have a record of the data.
-
Re: [mccode v2] Farming so has anyone figured out why the functions arent working at all and that all there is is like 1 sentance that shows on each function about upgradeing
-
Re: [mccode v2] Farming part 2 function animals() { global $ir,$c,$userid; } if ($farminfo[barnlevel]>0) { print "[b]Sarah:[/b] Hi! This is the animals shop. Here you can find the animals that you can use to get you lots of money! You buy these animals, then you feed them and eventually you'll start making money back from their produce. Cool huh? But if you leave them unattended with no assistants, they'll die! [b]Sarah:[/b] So what would you like? "; $arraypick = mysql_query("select * from farm_anim_listdb"); } print "<table><tr><td>[b]Animal name[/b]</td><td>[b]Animal Price[/b]</td><td>[b]Needs[/b]</td><td>[b]Produces[/b]</td><td>[b]Amount Left[/b]</td><td>[b]Buy[/b]</td></tr>"; while ($display = mysql_query($arraypick)) { print "<tr><td>$display[animalname]</td><td><center>'.number_format($display[cost]).'</center></td><td>$display[assist_need] assistants $display[food_need] food $display[water_need] water</td><td><center>$display[prod_amount] $display[prod_name]</center></td><td><center>$display[instock]</center></td><td><center>[url='farm.php?action=animals&step=buyanimal&id=$display[id]']Buy[/url]</center></td></tr>"; } print "</table> "; if ($step == "buyanimal") { $animload = mysql_query("select * from farm_anim_listdb where id='$id'"); $anim = mysql_query($animload); $cropcheck = mysql_query("select * from farm_cropdb where owner=$userid'"); $cropnum = mysql_query($cropcheck)+1; $animload = mysql_query("select * from farm_animdb where owner=$userid'"); $animnum = mysql_query($animload)*10; $total = $animnum+$cropnum; } if ($total > ($farminfo[plots]*10)) { print "You do not have enough space to contain this animal."; } elseif (($userid[money]) < $anim[cost]) { print "You cannot afford this."; } else { print "[b]Sarah:[/b] I'll send that animal right over!"; $rem_money = mysql_query("Update user set money=money-$anim[cost] where userid=$userid'"); $add_crop = mysql_query("Insert into farm_animdb (id,owner,animalname,cost,matureage,prod_name,prod_amount,assist_need,food_need,water_need) values ('',$userid','$anim[animalname]','$anim[cost]','$anim[matureage]','$anim[prod_name]','$anim[prod_amount]','$anim[assist_need]','$anim[food_need]','$anim[water_need]')"); $red_stock = mysql_query("update farm_anim_listdb set instock=instock-1 where id='$anim[id]'"); } function farm() { global $ir,$c,$userid; } $arraypick = mysql_query("select * from farm_crop_listdb"); print "You make your way to your dusty, damp old farm. You gaze over your $farminfo[plots] acres of land and head towards your barn. "; print "[b]Crops:[/b] "; print "<table><tr><td>[b]Crop Picture[/b]</td><td>[b]Crop Name[/b]</td><td>[b]Amount[/b]</td><td>[b]Options[/b]</td></tr>"; while ($display = mysql_fetch_array($arraypick)) { $amount = mysql_query("select * from farm_cropdb where cropname='$display[cropname]' AND owner='$playerinfo[id]'"); $amount2 = mysql_num_rows($amount); if ($amount2) { print "<tr><td><img src=\"image/farm/$display[pic].gif\" border=0></td><td>$display[cropname]</td><td><center>$amount2</center></td><td><center><a href=farm.php?action=viewcrop&name=".str_replace(" ","%20",$display[cropname]).">View</a></center></td></tr>"; } } print "</table>"; print " "; $animpick = mysql_query("select * from farm_anim_listdb"); print "[b]Animals:[/b] "; print "<table><tr><td>[b]Animal Name[/b]</td><td>[b]Amount[/b]</td><td>[b]Options[/b]</td></tr>"; while ($display = mysql_fetch_array($animpick)) { $amount = mysql_query("select * from farm_animdb where animalname='$display[animalname]' AND owner='$playerinfo[id]'"); $amount2 = mysql_num_rows($amount); if ($amount2){ print "<tr><td>$display[animalname]</td><td><center>$amount2</center></td><td><center><a href=farm.php?action=viewanimal&name=".str_replace(" ","%20",$display[animalname]).">View</a></center></td></tr>"; } } print "</table>"; print " "; print "[b]Equipment:[/b] "; if ($farminfo[waterpump] > 0){print "Water pump ($farminfo[waterpump]) ";} if ($farminfo[foodmach] > 0){print "Food machine ($farminfo[foodmach]) ";} print " "; print "[b]Resources:[/b] "; print "Food: $farminfo[food] "; print "Water: $farminfo[water] "; function viewcrop() { $croppick = mysql_query("select * from farm_cropdb where cropname='$name' AND owner='$playerinfo[id]'"); $arraypick = mysql_query("select * from farm_crop_listdb where cropname='$name'"); $cropcheck = mysql_fetch_array($arraypick); $cropcheck2 = mysql_num_rows($croppick); if (!$cropcheck) { print "This crop does not exist."; } elseif ($cropcheck2 == 0) { print "You do not have any of this crop!"; } else { print "<table><tr><td>[b]Age[/b]</td><td>[b]Options[/b]</td><td>[b]Crop evaluation[/b]</td></tr>"; while ($cropget = mysql_fetch_array($croppick)) { if (!$x) { print "[b]<u>Viewing crop ".$cropget[cropname]."[/b]</u> "; $x++; } /* if ($cropget[age]==0) { $advice = "There has been no growth yet."; } if ($cropget[age]>0 && $cropget[age]<3) { $advice = "This crop is now visible."; } if ($cropget[age]>2 && $cropget[age]<5) { $advice = "This crop is still growing."; } if ($cropget[age]>4 && $cropget[age]<10) { $advice = "This crop looks edible."; } if ($cropget[age]>9 && $cropget[age]<20) { $advice = "This crop looks perfect."; } */ print "<tr><td><center>$cropget[age]</center></td><td><center><a href=farm.php?action=sellcrop&id=$cropget[id]>Sell</a></center></td><td>$advice</td></tr>"; } print "</table>"; print " <form action=farm.php method=post><input type=hidden name=action value=sellall><input type=hidden name=crop value=\"$name\">[b]Sell all ".$name."'s at <select name=age size=1> <option value=1>1</option> <option value=2>2</option> <option value=3>3</option> <option value=4>4</option> <option value=5>5</option> <option value=6>6</option> <option value=7>7</option> <option value=8>8</option> <option value=9>9</option> <option value=10>10</option> <option value=11>11</option> <option value=12>12</option> <option value=13>13</option> <option value=14>14</option> <option value=15>15</option> <option value=16>16</option> <option value=17>17</option> <option value=18>18</option> <option value=19>19</option> <option value=20>20</option> <option value=21>21</option> <option value=22>22</option> <option value=23>23</option> <option value=24>24</option> <option value=25>25</option> <option value=26>26</option> <option value=27>27</option> <option value=28>28</option> <option value=29>29</option> <option value=30>30</option> </select> days old. <input type=submit value=Confirm></form>"; } } function sellall() { print "All $crop's at $age days old sold."; print " [b]Summary:[/b] "; $arraypick = mysql_query("select * from farm_crop_listdb where cropname='$crop'"); $cropcheck = mysql_fetch_array($arraypick); $crops = mysql_query("select * from farm_cropdb where cropname='$crop' AND age='$age' and owner='$playerinfo[id]'"); while ($display = mysql_fetch_array($crops)) { $cropnum++; if ($cropcheck[ripeage] != $display[age]) { $nonripe++; $totalmade=$totalmade+($cropcheck[buyvalue]/2); } else { $ripe++; $totalmade=$totalmade+$cropcheck[sellvalue]; } $rem = mysql_query("delete from farm_cropdb where id='$display[id]'"); } print "[b]Total crops sold:[/b] $cropnum [b]Total ripe:[/b] $ripe [b]Total unripe:[/b] $nonripe [b]Total money for selling:[/b] $totalmade "; $end = mysql_query("update users set money=money+$totalmade where userid='$userid'"); } function sellcrop() { $croppick = mysql_query("select * from farm_cropdb where id='$id' && owner='$userid'"); $cropget = mysql_fetch_array($croppick); $arraypick = mysql_query("select * from farm_crop_listdb where cropname='$cropget[cropname]'"); $cropcheck = mysql_fetch_array($arraypick); if (!$cropget) { print "This crop does not exist."; } else { print $cropget[cropname]." sold."; if ($cropcheck[ripeage] != $cropget[age]) { print " This crop is not worth anything in that condition. I'm afraid all I can give you is half what you paid."; $rem_crop= mysql_query("delete from farm_cropdb where id='$id'"); $newmoney = $userid[money]+($cropcheck[buyvalue]/2); $add_money= mysql_query("update users set money='$newmoney' where userid='$userid'"); } else { print " This crop is perfect!"; $rem_crop= mysql_query("delete from farm_cropdb where id='$id'"); $newmoney = $userid[money]+$cropcheck[sellvalue]; $add_money= mysql_query("update users set money='$newmoney' where userid='$userid'"); } } } function land() { print "Purchasing more land for your barn will allow you to use more plants at one time. 1 Acre can hold 10 plots. Each plant takes 1 plot. Land costs 5000 money each. You may only have 5 land max per level of barn under current laws. Amount to purchase:<form action=farm.php method=post><input type=text name=amount size=2><input type=hidden name=action value=land><input type=submit value=Purchase></form> "; if ($amount) { $check = $amount+$farminfo[plots]; $cost = $amount*5000; if(($check > 50) || ($check>($farminfo[barnlevel]*5))) { print "You cannot have that many plots!"; } elseif($amount<0) { print "This bug has been patched."; } elseif($cost > $userid[money]) { print "You cannot afford it!"; } else { $newmoney = $userid[money]-$cost; $newplots = $farminfo[plots]+$amount; Mysql_query("Update farmdb set plots='$newplots' where owner='$userid'"); Mysql_query("Update users set money='$newmoney' where userid='$userid'"); } } } $h->endpage; ?> [code]
-
Re: [mccode v2] Farming ok everyone heres a updated working one, the only problem im haveing now is this Upgrading your barn is easy. As your barn gets bigger, it can process and handle more land.The next updgrade to your barn will cost . It will be to level . Agree? Yes and its on every part for some reason also the tables dont show up. <?php include("globals.php"); global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); switch($_GET['action']) { case 'barnfi' : barnfi(); break; case 'barnbou' : barnbou(); break; case 'upgrade': upgrade(); break; case 'produce': produce(); break; case 'animals': animals(); break; case 'farm': farm(); break; case 'viewcrop': viewcrop(); break; case 'sellcrop' : sellcrop(); break; case 'sellall': sellall(); break; case 'land': land(); break; default: index(); } function index() { global $ir,$c,$userid; print " Welcome to the the city outskirts. Farming ain't just for old losers. Out here we live off the land, and make our own living rather than battling. What would you like to do? "; if ($farminfo[barnlevel] == 0 ) { print "[url='farm.php?action=barnfi']Buy a barn[/url] "; } elseif ($farminfo[barnlevel] != 10) { print "[url='farm.php?action=upgrade']Upgrade barn[/url] "; } if ($farminfo[plots] < 50) { print "[url='farm.php?action=land']Purchase Additional Land[/url] "; } print "[url='farm.php?action=animals']Buy livestock[/url] "; print "[url='farm.php?action=produce']Seed Store[/url] "; print "Hire assistants "; //print "[url='farm.php?action=hire']Hire equipment[/url] "; print "[url='farm.php?action=farm']Visit Farm[/url] "; } function barnfi() { global $ir,$c,$userid; print " Registration for farmland and the cost of the initial barn will be 1000 gold. Would you like to buy it? <a href='farm.php?action=barnbou>Yes</a>"; } function barnbou() { global $ir,$c,$userid; if ($ir['money']<'1000') { print " <center>You can't afford it!</center>"; } print " Here's your license and the keys to your [url='farm.php?action=farm']farm[/url]!"; mysql_query("Update users set money=money-1000 where userid=$userid"); mysql_query("Insert into farmdb (id,owner) values ('',$userid')"); } function upgrade() { global $ir,$c,$userid; } if ($farminfo[barnlevel] == 1) { $cost = 10000; $next = 2; } if ($farminfo[barnlevel] == 2) { $cost = 50000; $next = 3; } if ($farminfo[barnlevel] == 3) { $cost = 150000; $next = 4; } if ($farminfo[barnlevel] == 4) { $cost = 500000; $next = 5; } if ($farminfo[barnlevel] == 5) { $cost = 1000000; $next = 6; } if ($farminfo[barnlevel] == 6) { $cost = 2000000; $next = 7; } if ($farminfo[barnlevel] == 7) { $cost = 5000000; $next = 8; } if ($farminfo[barnlevel] == 8) { $cost = 10000000; $next = 9; } if ($farminfo[barnlevel] == 9) { $cost = 50000000; $next = 10; } print "Upgrading your barn is easy. As your barn gets bigger, it can process and handle more land."; print "The next updgrade to your barn will cost $cost. It will be to level $next. Agree? [url='farm.php?action=upgrade&action2=yes']Yes[/url] "; if ($action2) If ($userid[money] < $cost) { print "You can't afford that!"; } else { $newmoney = $userid[money]-$cost; echo "Barn successfully upgraded."; mysql_query("Update farmdb set barnlevel='$next' where owner=$userid'"); mysql_query("Update users set money='$newmoney' where userid=$userid'"); } function produce() { global $ir,$c,$userid; } if ($farminfo[barnlevel]>0) { print "[b]Billy-bob:[/b] Welcome to the seed store. Here you can find the seeds which other farmers delivered to me in exchange for some quick money. You plant these seeds on your land and let 'um grow until you can harvest and sell. But if you leave them too long, they'll dry up and die. [b]Billy-bob:[/b] So what would you like? "; $arraypick = mysql_query("select * from farm_crop_listdb"); print "<table><tr><td>[b]Crop Picture[/b]</td><td>[b]Crop Name[/b]</td><td>[b]Crop Price[/b]</td><td>[b]Max Sell value[/b]</td><td>[b]Amount Left[/b]</td><td>[b]Buy amount[/b]</td></tr>"; } while ($display = mysql_query($arraypick)) { print "<tr><td><img src=\'image/farm/$display[pic].gif\' border=0></td><td>$display[cropname]</td><td><center>".number_format($display[buyvalue])."</center></td><td><center>".number_format($display[sellvalue])."</center></td><td><center>".number_format($display[instock])."</center></td><td><center>[url='farm.php?action=produce&step=buycrop&id=$display[id]&amount=1']Buy One[/url] [url='farm.php?action=produce&step=buycrop&id=$display[id]&amount=10']Buy Ten[/url] [url='farm.php?action=produce&step=buycrop&id=$display[id]&amount=50']Buy Fifty[/url]</center></td></tr>"; } print "</table> "; if ($step == "buycrop") if($amount ==1) { $cropload = mysql_query("select * from farm_crop_listdb where id='$id'"); $crop = mysql_fetch_array($cropload); $cropcheck = mysql_query("select * from farm_cropdb where owner=$userid'"); $cropnum = mysql_num_rows($cropcheck)+1; // $animload = mysql_query("select * from farm_animdb where owner=$userid"); //$animnum = mysql_num_rows($animload)*10; $total = $animnum+$cropnum; if ($total > ($farminfo[plots]*10)) print "You do not have enough space to plot this."; } elseif (($userid[money]) < $crop[buyvalue]) { print "You cannot afford this."; } else { print "Seed bought and planted."; } $rem_money = mysql_query("Update users set money=money-$crop[buyvalue] where id=$userid'"); $add_crop = mysql_query("Insert into farm_cropdb (id,owner,cropname,sellvalue) values ('',$userid','$crop[cropname]','$crop[sellvalue]')"); $red_stock = mysql_query("update farm_crop_listdb set instock=instock-1 where id='$crop[id]'"); if($amount ==10){ $cropload = mysql_query("select * from farm_crop_listdb where id='$id'"); $crop = mysql_query($cropload); $cropcheck = mysql_query("select * from farm_cropdb where owner=$userid'"); $cropnum = mysql_num_rows($cropcheck)+11; // $animload = mysql_query("select * from farm_animdb where owner=$userid"); //$animnum = mysql_num_rows($animload)*10; $total = $animnum+$cropnum; if ($total > ($farminfo[plots]*10)) print "You do not have enough space to plot this."; } elseif (($userid[money]) < $crop[buyvalue]*10) { print "You cannot afford this."; } else { $i = 1; while ($i <= 10) $i++; $tam = $i - 1; print "Seed bought and planted. "; $rem_money = mysql_query("Update users set money=money-$crop[buyvalue] where id=$userid'"); $add_crop = mysql_query("Insert into farm_cropdb (id,owner,cropname,sellvalue) values ('',$userid','$crop[cropname]','$crop[sellvalue]')"); $red_stock = mysql_query("update farm_crop_listdb set instock=instock-1 where id='$crop[id]'"); // end while } print "Total planted: $tam "; { if($amount == 50) $cropload = mysql_query("select * from farm_crop_listdb where id='$id'"); $crop = mysql_query($cropload); $cropcheck = mysql_query("select * from farm_cropdb where owner=$userid'"); $cropnum = mysql_query($cropcheck)+51; // $animload = mysql_query("select * from farm_animdb where owner=$userid"); //$animnum = mysql_num_rows($animload)*10; $total = $animnum+$cropnum; $barninfo1 = mysql_query("Select * from farmdb where owner=$userid'"); $farminfo = mysql_query($barninfo1); if ($total > ($farminfo[plots]*10)) { print "You do not have enough space to plot this."; } elseif (($userid[money]) < ($crop[buyvalue]*50)) { print "You do not have enough space to plot this."; } else { $i = 1; while ($i <= 50) $i++; $tam = $i - 1; print "Seed bought and planted. "; $rem_money = mysql_query("Update users set money=money-$crop[buyvalue] where userid=$userid'"); $add_crop = mysql_query("Insert into farm_cropdb (id,owner,cropname,sellvalue) values ('',$userid','$crop[cropname]','$crop[sellvalue]')"); $red_stock = mysql_query("update farm_crop_listdb set instock=instock-1 where id='$crop[id]'"); } print "Total planted: $tam "; }
-
Re: [mccode v2] Farming nope it starts at function upgrade :-) i know this is because i ripped them out each at a time then recoded it but i cant get the functions to work if i do.
-
Re: [mccode v2] Farming sql CREATE TABLE IF NOT EXISTS `farmdb` ( `id` int(7) NOT NULL auto_increment, `owner` int(6) NOT NULL default '0', `barnlevel` int(2) NOT NULL default '1', `plots` int(3) NOT NULL default '5', `plotage` int(3) NOT NULL default '0', `assists` int(3) NOT NULL default '5', `water` int(5) NOT NULL default '0', `food` int(5) NOT NULL default '0', `waterpump` int(4) NOT NULL default '0', `foodmach` int(4) NOT NULL default '0', PRIMARY KEY (`id`), KEY `owner` (`owner`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; INSERT INTO `farmdb` (`id`, `owner`, `barnlevel`, `plots`, `plotage`, `assists`, `water`, `food`, `waterpump`, `foodmach`) VALUES (1, 1, 1, 5, 0, 5, 0, 0, 0, 0); CREATE TABLE IF NOT EXISTS `farm_animdb` ( `id` int(9) NOT NULL auto_increment, `owner` int(6) NOT NULL default '0', `animalname` varchar(20) NOT NULL default '', `matureage` int(3) NOT NULL default '0', `age` int(3) NOT NULL default '0', `cost` int(7) NOT NULL default '0', `prod_name` varchar(20) NOT NULL default '', `prod_amount` int(2) NOT NULL default '0', `assist_need` int(3) NOT NULL default '0', `food_need` int(3) NOT NULL default '0', `water_need` int(3) NOT NULL default '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; CREATE TABLE IF NOT EXISTS `farm_anim_listdb` ( `id` int(9) NOT NULL auto_increment, `animalname` varchar(20) NOT NULL default '', `matureage` int(3) NOT NULL default '0', `cost` int(7) NOT NULL default '0', `prod_name` varchar(20) NOT NULL default '', `prod_amount` int(2) NOT NULL default '0', `assist_need` int(3) NOT NULL default '0', `food_need` int(3) NOT NULL default '0', `water_need` int(3) NOT NULL default '0', `instock` int(5) NOT NULL default '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ; INSERT INTO `farm_anim_listdb` (`id`, `animalname`, `matureage`, `cost`, `prod_name`, `prod_amount`, `assist_need`, `food_need`, `water_need`, `instock`) VALUES (1, 'Cow', 15, 10000, 'Milk', 5, 1, 1, 1, 49), (2, 'Astelite', 10, 30000, 'Black Ice', 10, 3, 1, 0, 91), (3, 'Giant Morebor', 40, 100000, 'Skin Plate', 10, 5, 10, 3, 90); CREATE TABLE IF NOT EXISTS `farm_cropdb` ( `id` int(6) NOT NULL auto_increment, `owner` int(6) NOT NULL default '0', `cropname` varchar(20) NOT NULL default '0', `age` int(3) NOT NULL default '0', `sellvalue` int(10) NOT NULL default '0', `nectadded` int(3) NOT NULL default '0', `plot` int(10) NOT NULL default '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ; INSERT INTO `farm_cropdb` (`id`, `owner`, `cropname`, `age`, `sellvalue`, `nectadded`, `plot`) VALUES (1, 1, 'Carrot', 0, 1000, 0, 0), (2, 1, 'Pea', 0, 1250, 0, 0), (3, 1, 'Cabbage', 0, 1400, 0, 0); CREATE TABLE IF NOT EXISTS `farm_crop_listdb` ( `id` int(6) NOT NULL auto_increment, `cropname` varchar(20) NOT NULL default '0', `ripeage` int(3) NOT NULL default '0', `spoilage` int(3) NOT NULL default '0', `sellvalue` int(10) NOT NULL default '0', `buyvalue` int(10) NOT NULL default '0', `instock` int(10) NOT NULL default '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ; INSERT INTO `farm_crop_listdb` (`id`, `cropname`, `ripeage`, `spoilage`, `sellvalue`, `buyvalue`, `instock`) VALUES (1, 'Carrot', 5, 7, 1000, 500, -7097), (2, 'Pea', 6, 7, 1250, 600, 7663), (3, 'Cabbage', 6, 8, 1400, 650, 6483), (4, 'Potato', 5, 6, 1500, 1000, 9080), (5, 'Tomato', 9, 11, 2500, 1250, 9794), (6, 'Cucumber', 10, 11, 2750, 1300, 8767), (7, 'Blackfire Sprout', 15, 18, 4000, 1500, 6216), (8, 'Dragonglade Grass', 20, 21, 5000, 2300, 6725);
-
Re: [mccode v2] Farming part 2 function land() { global $ir,$c,$userid; { print "Purchasing more land for your barn will allow you to use more plants at one time. 1 Acre can hold 10 plots. Each plant takes 1 plot. Land costs 5000 gold each. You may only have 5 land max per level of barn under current laws. Amount to purchase:<form action=farm.php method=post><input type=text name=amount size=2><input type=hidden name=action value=land><input type=submit value=Purchase></form> "; if ($amount) { $check = $amount+$farminfo[plots]; $cost = $amount*5000; if(($check > 50) || ($check>($farminfo[barnlevel]*5))) { print "You cannot have that many plots!"; } elseif($amount<0) { print "This bug has been patched."; } elseif($cost > $userid[money]) { print "You cannot afford it!"; } else { $newmoney = $userid[money]-$cost; $newplots = $farminfo[plots]+$amount; mysql_query("Update farmdb set plots='$newplots' where owner=$userid'"); mysql_query("Update users set money='$newmoney' where userid=$userid'"); } php?><?php include("globals.php"); global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); switch($_GET['action']) { case 'barnfi' : barnfi(); break; case 'barnbou' : barnbou(); break; case 'hire' : hire(); break; case 'upgrade': upgrade(); break; case 'land': land(); break; case 'produce': produce(); break; case 'farm': farm(); break; default: index(); } function index() { global $ir,$c,$userid; print " Welcome to the the city outskirts. Farming ain't just for old losers. Out here we live off the land, and make our own living rather than battling. What would you like to do? "; if ($farminfo[barnlevel] == 0 ) { print "<a href=farm.php?action=barnfi>Buy a barn</a> "; } elseif ($farminfo[barnlevel] != 10) { print "<a href=farming.php?action=upgrade>Upgrade barn</a> "; } if ($farminfo[plots] < 50) { print "<a href=farming.php?action=land>Purchase Additional Land</a> "; } print "<a href=farming.php?action=animals>Buy livestock</a> "; print "<a href=farming.php?action=produce>Seed Store</a> "; print "Hire assistants "; print "<a href=farming.php?action=hire>Hire equipment</a> "; print "<a href=farming.php?action=farm>Visit Farm</a> "; } function barnfi() { global $ir,$c,$userid; print " Registration for farmland and the cost of the initial barn will be 1000 gold. Would you like to buy it? <a href=farm.php?action=barnbou>Yes</a>"; } function barnbou() { global $ir,$c,$userid; if ($ir['money']<'1000'){ print " <center>You can't afford it!</center>"; } print " Here's your license and the keys to your <a href=farm.php?action=farm>farm</a>!"; mysql_query("Update users set money=money-1000 where userid=$userid"); mysql_query("Insert into farmdb (id,owner) values ('',$userid')"); } function upgrade() { global $ir,$c,$userid; if ($farminfo[barnlevel] == 1) { $cost = 10000; $next = 2; } if ($farminfo[barnlevel] == 2) { $cost = 50000; $next = 3; } if ($farminfo[barnlevel] == 3) { $cost = 150000; $next = 4; } if ($farminfo[barnlevel] == 4) { $cost = 500000; $next = 5; } if ($farminfo[barnlevel] == 5) { $cost = 1000000; $next = 6; } if ($farminfo[barnlevel] == 6) { $cost = 2000000; $next = 7; } if ($farminfo[barnlevel] == 7) { $cost = 5000000; $next = 8; } if ($farminfo[barnlevel] == 8) { $cost = 10000000; $next = 9; } if ($farminfo[barnlevel] == 9) { $cost = 50000000; $next = 10; } print "Upgrading your barn is easy. As your barn gets bigger, it can process and handle more land."; print "The next updgrade to your barn will cost $cost. It will be to level $next. Agree? <a href=farm.php?action=upgrade&action2=yes>Yes</a> "; if ($action2) { If ($userid[money] < $cost) { print "You can't afford that!"; } else { $newmoney = $userid[money]-$cost; echo "Barn successfully upgraded."; mysql_query("Update farmdb set barnlevel='$next' where owner=$userid'"); mysql_query("Update users set money='$newmoney' where userid=$userid'"); } function produce() { global $ir,$c,$userid; if ($farminfo[barnlevel]>0) { print "[b]Billy-bob:[/b] Welcome to the seed store. Here you can find the seeds which other farmers delivered to me in exchange for some quick money. You plant these seeds on your land and let 'um grow until you can harvest and sell. But if you leave them too long, they'll dry up and die. [b]Billy-bob:[/b] So what would you like? "; $arraypick = mysql_query("select * from farm_crop_listdb"); print "<table><tr><td>[b]Crop Picture[/b]</td><td>[b]Crop Name[/b]</td><td>[b]Crop Price[/b]</td><td>[b]Max Sell value[/b]</td><td>[b]Amount Left[/b]</td><td>[b]Buy amount[/b]</td></tr>"; while ($display = mysql_fetch_array($arraypick)) { print "<tr><td><img src=\"image/farm/$display[pic].gif\" border=0></td><td>$display[cropname]</td><td><center>".number_format($display[buyvalue])."</center></td><td><center>".number_format($display[sellvalue])."</center></td><td><center>".number_format($display[instock])."</center></td><td><center><a href=farming.php?action=produce&step=buycrop&id=$display[id]&amount=1>Buy One</a> <a href=farming.php?action=produce&step=buycrop&id=$display[id]&amount=10>Buy Ten</a> <a href=farming.php?action=produce&step=buycrop&id=$display[id]&amount=50>Buy Fifty</a></center></td></tr>"; } print "</table> "; if ($step == "buycrop") { if($amount ==1) { $cropload = mysql_query("select * from farm_crop_listdb where id='$id'"); $crop = mysql_fetch_array($cropload); $cropcheck = mysql_query("select * from farm_cropdb where owner=$userid'"); $cropnum = mysql_num_rows($cropcheck)+1; // $animload = mysql_query("select * from farm_animdb where owner=$userid"); //$animnum = mysql_num_rows($animload)*10; $total = $animnum+$cropnum; if ($total > ($farminfo[plots]*10)) { print "You do not have enough space to plot this."; } elseif (($userid[money]) < $crop[buyvalue]) { print "You cannot afford this."; } else { print "Seed bought and planted."; $rem_money = mysql_query("Update users set money=money-$crop[buyvalue] where id=$userid'"); $add_crop = mysql_query("Insert into farm_cropdb (id,owner,cropname,sellvalue) values ('',$userid','$crop[cropname]','$crop[sellvalue]')"); $red_stock = mysql_query("update farm_crop_listdb set instock=instock-1 where id='$crop[id]'"); } //end else seed bought } // end amount = 1 if($amount ==10){ $cropload = mysql_query("select * from farm_crop_listdb where id='$id'"); $crop = mysql_fetch_array($cropload); $cropcheck = mysql_query("select * from farm_cropdb where owner=$userid'"); $cropnum = mysql_num_rows($cropcheck)+11; // $animload = mysql_query("select * from farm_animdb where owner=$userid"); //$animnum = mysql_num_rows($animload)*10; $total = $animnum+$cropnum; if ($total > ($farminfo[plots]*10)) { print "You do not have enough space to plot this."; } elseif (($userid[money]) < $crop[buyvalue]*10) { print "You cannot afford this."; } else { $i = 1; while ($i <= 10) { $i++; $tam = $i - 1; print "Seed bought and planted. "; $rem_money = mysql_query("Update users set money=money-$crop[buyvalue] where id=$userid'"); $add_crop = mysql_query("Insert into farm_cropdb (id,owner,cropname,sellvalue) values ('',$userid','$crop[cropname]','$crop[sellvalue]')"); $red_stock = mysql_query("update farm_crop_listdb set instock=instock-1 where id='$crop[id]'"); } // end while print "Total planted: $tam "; } //end else seed bought } // end amount = 10 if($amount == 50){ $cropload = mysql_query("select * from farm_crop_listdb where id='$id'"); $crop = mysql_fetch_array($cropload); $cropcheck = mysql_query("select * from farm_cropdb where owner=$userid'"); $cropnum = mysql_num_rows($cropcheck)+51; // $animload = mysql_query("select * from farm_animdb where owner=$userid"); //$animnum = mysql_num_rows($animload)*10; $total = $animnum+$cropnum; $barninfo1 = mysql_query("Select * from farmdb where owner=$userid'"); $farminfo = mysql_fetch_array($barninfo1); if ($total > ($farminfo[plots]*10)) { print "You do not have enough space to plot this."; } elseif (($userid[money]) < ($crop[buyvalue]*50)) { print "You cannot afford this."; } else { $i = 1; while ($i <= 50) { $i++; $tam = $i - 1; print "Seed bought and planted. "; $rem_money = mysql_query("Update users set money=money-$crop[buyvalue] where userid=$userid'"); $add_crop = mysql_query("Insert into farm_cropdb (id,owner,cropname,sellvalue) values ('',$userid','$crop[cropname]','$crop[sellvalue]')"); $red_stock = mysql_query("update farm_crop_listdb set instock=instock-1 where id='$crop[id]'"); } print "Total planted: $tam "; } function animals() { global $ir,$c,$userid; if ($farminfo[barnlevel]>0) { print "[b]Sarah:[/b] Hi! This is the animals shop. Here you can find the animals that you can use to get you lots of money! You buy these animals, then you feed them and eventually you'll start making money back from their produce. Cool huh? But if you leave them unattended with no assistants, they'll die! [b]Sarah:[/b] So what would you like? "; $arraypick = mysql_query("select * from farm_anim_listdb"); print "<table><tr><td>[b]Animal name[/b]</td><td>[b]Animal Price[/b]</td><td>[b]Needs[/b]</td><td>[b]Produces[/b]</td><td>[b]Amount Left[/b]</td><td>[b]Buy[/b]</td></tr>"; while ($display = mysql_fetch_array($arraypick)) { print "<tr><td>$display[animalname]</td><td><center>".number_format($display[cost])."</center></td><td>$display[assist_need] assistants $display[food_need] food $display[water_need] water</td><td><center>$display[prod_amount] $display[prod_name]</center></td><td><center>$display[instock]</center></td><td><center><a href=farming.php?action=animals&step=buyanimal&id=$display[id]>Buy</a></center></td></tr>"; } print "</table> "; if ($step == "buyanimal") { $animload = mysql_query("select * from farm_anim_listdb where id='$id'"); $anim = mysql_fetch_array($animload); $cropcheck = mysql_query("select * from farm_cropdb where owner=$userid'"); $cropnum = mysql_num_rows($cropcheck)+1; $animload = mysql_query("select * from farm_animdb where owner=$userid'"); $animnum = mysql_num_rows($animload)*10; $total = $animnum+$cropnum; if ($total > ($farminfo[plots]*10)) { print "You do not have enough space to contain this animal."; } elseif (($userid[money]) < $anim[cost]) { print "You cannot afford this."; } else { print "[b]Sarah:[/b] I'll send that animal right over!"; $rem_money = mysql_query("Update user set money=money-$anim[cost] where userid=$userid'"); $add_crop = mysql_query("Insert into farm_animdb (id,owner,animalname,cost,matureage,prod_name,prod_amount,assist_need,food_need,water_need) values ('',$userid','$anim[animalname]','$anim[cost]','$anim[matureage]','$anim[prod_name]','$anim[prod_amount]','$anim[assist_need]','$anim[food_need]','$anim[water_need]')"); $red_stock = mysql_query("update farm_anim_listdb set instock=instock-1 where id='$anim[id]'"); } function farm() { global $ir,$c,$userid; $arraypick = mysql_query("select * from farm_crop_listdb"); print "You make your way to your dusty, damp old farm. You gaze over your $farminfo[plots] acres of land and head towards your barn. "; print "[b]Crops:[/b] "; print "<table><tr><td>[b]Crop Picture[/b]</td><td>[b]Crop Name[/b]</td><td>[b]Amount[/b]</td><td>[b]Options[/b]</td></tr>"; while ($display = mysql_fetch_array($arraypick)) { $amount = mysql_query("select * from farm_cropdb where cropname='$display[cropname]' AND owner=$userid'"); $amount2 = mysql_num_rows($amount); if ($amount2){ print "<tr><td><img src=\"image/farm/$display[pic].gif\" border=0></td><td>$display[cropname]</td><td><center>$amount2</center></td><td><center><a href=farming.php?action=viewcrop&name=".str_replace(" ","%20",$display[cropname]).">View</a></center></td></tr>"; } } print "</table>"; print " "; $animpick = mysql_query("select * from farm_anim_listdb"); print "[b]Animals:[/b] "; print "<table><tr><td>[b]Animal Name[/b]</td><td>[b]Amount[/b]</td><td>[b]Options[/b]</td></tr>"; while ($display = mysql_fetch_array($animpick)) { $amount = mysql_query("select * from farm_animdb where animalname='$display[animalname]' AND owner=$userid'"); $amount2 = mysql_num_rows($amount); if ($amount2) { print "<tr><td>$display[animalname]</td><td><center>$amount2</center></td><td><center><a href=farming.php?action=viewanimal&name=".str_replace(" ","%20",$display[animalname]).">View</a></center></td></tr>"; } } print "</table>"; print " "; print "[b]Equipment:[/b] "; if ($farminfo[waterpump] > 0){print "Water pump ($farminfo[waterpump]) ";} if ($farminfo[foodmach] > 0){print "Food machine ($farminfo[foodmach]) ";} print " "; print "[b]Resources:[/b] "; print "Food: $farminfo[food] "; print "Water: $farminfo[water] "; } function viewcrop() { global $ir,$c,$userid; { $croppick = mysql_query("select * from farm_cropdb where cropname='$name' AND owner=$userid'"); $arraypick = mysql_query("select * from farm_crop_listdb where cropname='$name'"); $cropcheck = mysql_fetch_array($arraypick); $cropcheck2 = mysql_num_rows($croppick); if (!$cropcheck) { echo "This crop does not exist."; } elseif ($cropcheck2 == 0) { echo "You do not have any of this crop!"; } else { echo "<table><tr><td>[b]Age[/b]</td><td>[b]Options[/b]</td><td>[b]Crop evaluation[/b]</td></tr>"; while ($cropget = mysql_fetch_array($croppick)) { if (!$x) { echo "[b]<u>Viewing crop ".$cropget[cropname]."[/b]</u> "; $x++; } /* if ($cropget[age]==0) { $advice = "There has been no growth yet."; } if ($cropget[age]>0 && $cropget[age]<3) { $advice = "This crop is now visible."; } if ($cropget[age]>2 && $cropget[age]<5) { $advice = "This crop is still growing."; } if ($cropget[age]>4 && $cropget[age]<10) { $advice = "This crop looks edible."; } if ($cropget[age]>9 && $cropget[age]<20) { $advice = "This crop looks perfect."; } */ echo "<tr><td><center>$cropget[age]</center></td><td><center><a href=farming.php?action=sellcrop&id=$cropget[id]>Sell</a></center></td><td>$advice</td></tr>"; } echo "</table>"; echo " <form action=farming.php method=post><input type=hidden name=action value=sellall><input type=hidden name=crop value=\"$name\">[b]Sell all ".$name."'s at <select name=age size=1> <option value=1>1</option> <option value=2>2</option> <option value=3>3</option> <option value=4>4</option> <option value=5>5</option> <option value=6>6</option> <option value=7>7</option> <option value=8>8</option> <option value=9>9</option> <option value=10>10</option> <option value=11>11</option> <option value=12>12</option> <option value=13>13</option> <option value=14>14</option> <option value=15>15</option> <option value=16>16</option> <option value=17>17</option> <option value=18>18</option> <option value=19>19</option> <option value=20>20</option> <option value=21>21</option> <option value=22>22</option> <option value=23>23</option> <option value=24>24</option> <option value=25>25</option> <option value=26>26</option> <option value=27>27</option> <option value=28>28</option> <option value=29>29</option> <option value=30>30</option> </select> days old. <input type=submit value=Confirm></form>"; } } function sellall() { global $ir,$c,$userid; { echo "All $crop's at $age days old sold."; echo " [b]Summary:[/b] "; $arraypick = mysql_query("select * from farm_crop_listdb where cropname='$crop'"); $cropcheck = mysql_fetch_array($arraypick); $crops = mysql_query("select * from farm_cropdb where cropname='$crop' AND age='$age' and owner=$userid'"); while ($display = mysql_fetch_array($crops)) { $cropnum++; if ($cropcheck[ripeage] != $display[age]) { $nonripe++; $totalmade=$totalmade+($cropcheck[buyvalue]/2); } else { $ripe++; $totalmade=$totalmade+$cropcheck[sellvalue]; } $rem = mysql_query("delete from farm_cropdb where id='$display[id]'"); } echo "[b]Total crops sold:[/b] $cropnum [b]Total ripe:[/b] $ripe [b]Total unripe:[/b] $nonripe [b]Total gold for selling:[/b] $totalmade "; mysql_query("update users set money=money+$totalmade where userid=$userid'"); } function land() { global $ir,$c,$userid; { echo "Purchasing more land for your barn will allow you to use more plants at one time. 1 Acre can hold 10 plots. Each plant takes 1 plot. Land costs 5000 gold each. You may only have 5 land max per level of barn under current laws. Amount to purchase:<form action=farm.php method=post><input type=text name=amount size=2><input type=hidden name=action value=land><input type=submit value=Purchase></form> "; if ($amount) { $check = $amount+$farminfo[plots]; $cost = $amount*5000; if(($check > 50) || ($check>($farminfo[barnlevel]*5))) { echo "You cannot have that many plots!"; } elseif($amount<0) { echo "This bug has been patched."; } elseif($cost > $userid[gold]) { echo "You cannot afford it!"; } else { $newmoney = $userid[money]-$cost; $newplots = $farminfo[plots]+$amount; mysql_query("Update farmdb set plots='$newplots' where owner=$userid'"); mysql_query("Update users set money='$newmoney' where userid=$userid'"); } ?>
-
if you can fix this then you can use it as long as the updated version gets posted on here, i keep getting a unexpected end on the script. hmmm it seems that this file is to long to be 1 file so ill make 2 parts just add them together and there you go. <?php include("globals.php"); global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); switch($_GET['action']) { case 'barnfi' : barnfi(); break; case 'barnbou' : barnbou(); break; case 'upgrade': upgrade(); break; case 'produce': produce(); break; case 'animals': animals(); break; case 'farm': farm(); break; case 'viewcrop': viewcrop(); break; case 'sellall': sellall(); break; case 'land': land(); break; default: index(); } function index() { global $ir,$c,$userid; print " Welcome to the the city outskirts. Farming ain't just for old losers. Out here we live off the land, and make our own living rather than battling. What would you like to do? "; if ($farminfo[barnlevel] == 0 ) { print "[url='farm.php?action=barnfi']Buy a barn[/url] "; } elseif ($farminfo[barnlevel] != 10) { print "[url='farm.php?action=upgrade']Upgrade barn[/url] "; } if ($farminfo[plots] < 50) { print "[url='farm.php?action=land']Purchase Additional Land[/url] "; } print "[url='farm.php?action=animals']Buy livestock[/url] "; print "[url='farm.php?action=produce']Seed Store[/url] "; print "Hire assistants "; //print "[url='farm.php?action=hire']Hire equipment[/url] "; print "[url='farm.php?action=farm']Visit Farm[/url] "; } function barnfi() { global $ir,$c,$userid; print " Registration for farmland and the cost of the initial barn will be 1000 gold. Would you like to buy it? <a href='farm.php?action=barnbou>Yes</a>"; } function barnbou() { global $ir,$c,$userid; if ($ir['money']<'1000'){ print " <center>You can't afford it!</center>"; } print " Here's your license and the keys to your [url='farm.php?action=farm']farm[/url]!"; mysql_query("Update users set money=money-1000 where userid=$userid"); mysql_query("Insert into farmdb (id,owner) values ('',$userid')"); } function upgrade() { global $ir,$c,$userid; if ($farminfo[barnlevel] == 1) { $cost = 10000; $next = 2; } if ($farminfo[barnlevel] == 2) { $cost = 50000; $next = 3; } if ($farminfo[barnlevel] == 3) { $cost = 150000; $next = 4; } if ($farminfo[barnlevel] == 4) { $cost = 500000; $next = 5; } if ($farminfo[barnlevel] == 5) { $cost = 1000000; $next = 6; } if ($farminfo[barnlevel] == 6) { $cost = 2000000; $next = 7; } if ($farminfo[barnlevel] == 7) { $cost = 5000000; $next = 8; } if ($farminfo[barnlevel] == 8) { $cost = 10000000; $next = 9; } if ($farminfo[barnlevel] == 9) { $cost = 50000000; $next = 10; } print "Upgrading your barn is easy. As your barn gets bigger, it can process and handle more land."; print "The next updgrade to your barn will cost $cost. It will be to level $next. Agree? [url='farm.php?action=upgrade&action2=yes']Yes[/url] "; if ($action2) { If ($userid[money] < $cost) { print "You can't afford that!"; } else { $newmoney = $userid[money]-$cost; echo "Barn successfully upgraded."; mysql_query("Update farmdb set barnlevel='$next' where owner=$userid'"); mysql_query("Update users set money='$newmoney' where userid=$userid'"); } function produce() { global $ir,$c,$userid; if ($farminfo[barnlevel]>0) { print "[b]Billy-bob:[/b] Welcome to the seed store. Here you can find the seeds which other farmers delivered to me in exchange for some quick money. You plant these seeds on your land and let 'um grow until you can harvest and sell. But if you leave them too long, they'll dry up and die. [b]Billy-bob:[/b] So what would you like? "; $arraypick = mysql_query("select * from farm_crop_listdb"); print "<table><tr><td>[b]Crop Picture[/b]</td><td>[b]Crop Name[/b]</td><td>[b]Crop Price[/b]</td><td>[b]Max Sell value[/b]</td><td>[b]Amount Left[/b]</td><td>[b]Buy amount[/b]</td></tr>"; while ($display = mysql_fetch_array($arraypick)) { print "<tr><td><img src=\'image/farm/$display[pic].gif\' border=0></td><td>$display[cropname]</td><td><center>".number_format($display[buyvalue])."</center></td><td><center>".number_format($display[sellvalue])."</center></td><td><center>".number_format($display[instock])."</center></td><td><center>[url='farm.php?action=produce&step=buycrop&id=$display[id]&amount=1']Buy One[/url] [url='farm.php?action=produce&step=buycrop&id=$display[id]&amount=10']Buy Ten[/url] [url='farm.php?action=produce&step=buycrop&id=$display[id]&amount=50']Buy Fifty[/url]</center></td></tr>"; } print "</table> "; if ($step == "buycrop") { if($amount ==1) { $cropload = mysql_query("select * from farm_crop_listdb where id='$id'"); $crop = mysql_fetch_array($cropload); $cropcheck = mysql_query("select * from farm_cropdb where owner=$userid'"); $cropnum = mysql_num_rows($cropcheck)+1; // $animload = mysql_query("select * from farm_animdb where owner=$userid"); //$animnum = mysql_num_rows($animload)*10; $total = $animnum+$cropnum; if ($total > ($farminfo[plots]*10)) { print "You do not have enough space to plot this."; } elseif (($userid[money]) < $crop[buyvalue]) { print "You cannot afford this."; } else { print "Seed bought and planted."; $rem_money = mysql_query("Update users set money=money-$crop[buyvalue] where id=$userid'"); $add_crop = mysql_query("Insert into farm_cropdb (id,owner,cropname,sellvalue) values ('',$userid','$crop[cropname]','$crop[sellvalue]')"); $red_stock = mysql_query("update farm_crop_listdb set instock=instock-1 where id='$crop[id]'"); } //end else seed bought } // end amount = 1 if($amount ==10){ $cropload = mysql_query("select * from farm_crop_listdb where id='$id'"); $crop = mysql_fetch_array($cropload); $cropcheck = mysql_query("select * from farm_cropdb where owner=$userid'"); $cropnum = mysql_num_rows($cropcheck)+11; // $animload = mysql_query("select * from farm_animdb where owner=$userid"); //$animnum = mysql_num_rows($animload)*10; $total = $animnum+$cropnum; if ($total > ($farminfo[plots]*10)) { print "You do not have enough space to plot this."; } elseif (($userid[money]) < $crop[buyvalue]*10) { print "You cannot afford this."; } else { $i = 1; while ($i <= 10) { $i++; $tam = $i - 1; print "Seed bought and planted. "; $rem_money = mysql_query("Update users set money=money-$crop[buyvalue] where id=$userid'"); $add_crop = mysql_query("Insert into farm_cropdb (id,owner,cropname,sellvalue) values ('',$userid','$crop[cropname]','$crop[sellvalue]')"); $red_stock = mysql_query("update farm_crop_listdb set instock=instock-1 where id='$crop[id]'"); } // end while print "Total planted: $tam "; } //end else seed bought } // end amount = 10 if($amount == 50){ $cropload = mysql_query("select * from farm_crop_listdb where id='$id'"); $crop = mysql_fetch_array($cropload); $cropcheck = mysql_query("select * from farm_cropdb where owner=$userid'"); $cropnum = mysql_num_rows($cropcheck)+51; // $animload = mysql_query("select * from farm_animdb where owner=$userid"); //$animnum = mysql_num_rows($animload)*10; $total = $animnum+$cropnum; $barninfo1 = mysql_query("Select * from farmdb where owner=$userid'"); $farminfo = mysql_fetch_array($barninfo1); if ($total > ($farminfo[plots]*10)) { print "You do not have enough space to plot this."; } elseif (($userid[money]) < ($crop[buyvalue]*50)) { print "You cannot afford this."; } else { $i = 1; while ($i <= 50) { $i++; $tam = $i - 1; print "Seed bought and planted. "; $rem_money = mysql_query("Update users set money=money-$crop[buyvalue] where userid=$userid'"); $add_crop = mysql_query("Insert into farm_cropdb (id,owner,cropname,sellvalue) values ('',$userid','$crop[cropname]','$crop[sellvalue]')"); $red_stock = mysql_query("update farm_crop_listdb set instock=instock-1 where id='$crop[id]'"); } print "Total planted: $tam "; } function animals() { global $ir,$c,$userid; if ($farminfo[barnlevel]>0) { print "[b]Sarah:[/b] Hi! This is the animals shop. Here you can find the animals that you can use to get you lots of money! You buy these animals, then you feed them and eventually you'll start making money back from their produce. Cool huh? But if you leave them unattended with no assistants, they'll die! [b]Sarah:[/b] So what would you like? "; $arraypick = mysql_query("select * from farm_anim_listdb"); print "<table><tr><td>[b]Animal name[/b]</td><td>[b]Animal Price[/b]</td><td>[b]Needs[/b]</td><td>[b]Produces[/b]</td><td>[b]Amount Left[/b]</td><td>[b]Buy[/b]</td></tr>"; while ($display = mysql_fetch_array($arraypick)) { print "<tr><td>$display[animalname]</td><td><center>'.number_format($display[cost]).'</center></td><td>$display[assist_need] assistants $display[food_need] food $display[water_need] water</td><td><center>$display[prod_amount] $display[prod_name]</center></td><td><center>$display[instock]</center></td><td><center>[url='farm.php?action=animals&step=buyanimal&id=$display[id]']Buy[/url]</center></td></tr>"; } print "</table> "; if ($step == "buyanimal") { $animload = mysql_query("select * from farm_anim_listdb where id='$id'"); $anim = mysql_fetch_array($animload); $cropcheck = mysql_query("select * from farm_cropdb where owner=$userid'"); $cropnum = mysql_num_rows($cropcheck)+1; $animload = mysql_query("select * from farm_animdb where owner=$userid'"); $animnum = mysql_num_rows($animload)*10; $total = $animnum+$cropnum; if ($total > ($farminfo[plots]*10)) { print "You do not have enough space to contain this animal."; } elseif (($userid[money]) < $anim[cost]) { print "You cannot afford this."; } else { print "[b]Sarah:[/b] I'll send that animal right over!"; $rem_money = mysql_query("Update user set money=money-$anim[cost] where userid=$userid'"); $add_crop = mysql_query("Insert into farm_animdb (id,owner,animalname,cost,matureage,prod_name,prod_amount,assist_need,food_need,water_need) values ('',$userid','$anim[animalname]','$anim[cost]','$anim[matureage]','$anim[prod_name]','$anim[prod_amount]','$anim[assist_need]','$anim[food_need]','$anim[water_need]')"); $red_stock = mysql_query("update farm_anim_listdb set instock=instock-1 where id='$anim[id]'"); } function farm() { global $ir,$c,$userid; $arraypick = mysql_query("select * from farm_crop_listdb"); print "You make your way to your dusty, damp old farm. You gaze over your $farminfo[plots] acres of land and head towards your barn. "; print "[b]Crops:[/b] "; print "<table><tr><td>[b]Crop Picture[/b]</td><td>[b]Crop Name[/b]</td><td>[b]Amount[/b]</td><td>[b]Options[/b]</td></tr>"; while ($display = mysql_fetch_array($arraypick)) { $amount = mysql_query("select * from farm_cropdb where cropname='$display[cropname]' AND owner=$userid'"); $amount2 = mysql_num_rows($amount); if ($amount2){ print "<tr><td><img src=\'image/farm/$display[pic].gif\' border=0></td><td>$display[cropname]</td><td><center>$amount2</center></td><td><center>[url='farm.php?action=viewcrop&name=']View[/url]</center></td></tr>"; } } print "</table>"; print " "; $animpick = mysql_query("select * from farm_anim_listdb"); print "[b]Animals:[/b] "; print "<table><tr><td>[b]Animal Name[/b]</td><td>[b]Amount[/b]</td><td>[b]Options[/b]</td></tr>"; while ($display = mysql_fetch_array($animpick)) { $amount = mysql_query("select * from farm_animdb where animalname='$display[animalname]' AND owner=$userid'"); $amount2 = mysql_num_rows($amount); if ($amount2) { print "<tr><td>$display[animalname]</td><td><center>$amount2</center></td><td><center>[url='farm.php?action=viewanimal&name=']View[/url]</center></td></tr>"; } } print "</table>"; print " "; print "[b]Equipment:[/b] "; if ($farminfo[waterpump] > 0){print "Water pump ($farminfo[waterpump]) ";} if ($farminfo[foodmach] > 0){print "Food machine ($farminfo[foodmach]) ";} print " "; print "[b]Resources:[/b] "; print "Food: $farminfo[food] "; print "Water: $farminfo[water] "; } function viewcrop() { global $ir,$c,$userid; { $croppick = mysql_query("select * from farm_cropdb where cropname='$name' AND owner=$userid'"); $arraypick = mysql_query("select * from farm_crop_listdb where cropname='$name'"); $cropcheck = mysql_fetch_array($arraypick); $cropcheck2 = mysql_num_rows($croppick); if (!$cropcheck) { print "This crop does not exist."; } elseif ($cropcheck2 == 0) { print "You do not have any of this crop!"; } else { print "<table><tr><td>[b]Age[/b]</td><td>[b]Options[/b]</td><td>[b]Crop evaluation[/b]</td></tr>"; while ($cropget = mysql_fetch_array($croppick)) { if (!$x) { print "[b]<u>Viewing crop ".$cropget[cropname]."[/b]</u> "; $x++; } /* if ($cropget[age]==0) { $advice = "There has been no growth yet."; } if ($cropget[age]>0 && $cropget[age]<3) { $advice = "This crop is now visible."; } if ($cropget[age]>2 && $cropget[age]<5) { $advice = "This crop is still growing."; } if ($cropget[age]>4 && $cropget[age]<10) { $advice = "This crop looks edible."; } if ($cropget[age]>9 && $cropget[age]<20) { $advice = "This crop looks perfect."; } */ print "<tr><td><center>$cropget[age]</center></td><td><center>[url='farm.php?action=sellcrop&id=$cropget[id]']Sell[/url]</center></td><td>$advice</td></tr>"; } print "</table>"; print " <form action=farm.php method=post><input type=hidden name=action value=sellall><input type=hidden name=crop value=\'$name\'>[b]Sell all '.$name.'\'s at <select name=age size=1> <option value=1>1</option> <option value=2>2</option> <option value=3>3</option> <option value=4>4</option> <option value=5>5</option> <option value=6>6</option> <option value=7>7</option> <option value=8>8</option> <option value=9>9</option> <option value=10>10</option> <option value=11>11</option> <option value=12>12</option> <option value=13>13</option> <option value=14>14</option> <option value=15>15</option> <option value=16>16</option> <option value=17>17</option> <option value=18>18</option> <option value=19>19</option> <option value=20>20</option> <option value=21>21</option> <option value=22>22</option> <option value=23>23</option> <option value=24>24</option> <option value=25>25</option> <option value=26>26</option> <option value=27>27</option> <option value=28>28</option> <option value=29>29</option> <option value=30>30</option> </select> days old. <input type=submit value=Confirm></form>"; } function sellall() { global $ir,$c,$userid; { print "All $crop's at $age days old sold."; print " [b]Summary:[/b] "; $arraypick = mysql_query("select * from farm_crop_listdb where cropname='$crop'"); $cropcheck = mysql_fetch_array($arraypick); $crops = mysql_query("select * from farm_cropdb where cropname='$crop' AND age='$age' and owner=$userid'"); while ($display = mysql_fetch_array($crops)) { $cropnum++; if ($cropcheck[ripeage] != $display[age]) { $nonripe++; $totalmade=$totalmade+($cropcheck[buyvalue]/2); } else { $ripe++; $totalmade=$totalmade+$cropcheck[sellvalue]; } $rem = mysql_query("delete from farm_cropdb where id='$display[id]'"); } print "[b]Total crops sold:[/b] $cropnum [b]Total ripe:[/b] $ripe [b]Total unripe:[/b] $nonripe [b]Total money for selling:[/b] $totalmade "; $end = mysql_query("update users set money=money+$totalmade where userid=$userid'"); } function sellcrop() { $croppick = mysql_query("select * from farm_cropdb where id='$id' && owner='$playerinfo[id]'"); $cropget = mysql_fetch_array($croppick); $arraypick = mysql_query("select * from farm_crop_listdb where cropname='$cropget[cropname]'"); $cropcheck = mysql_fetch_array($arraypick); if (!$cropget) { echo "This crop does not exist."; } else { echo $cropget[cropname]." sold."; if ($cropcheck[ripeage] != $cropget[age]) { echo " This crop is not worth anything in that condition. I'm afraid all I can give you is half what you paid."; $rem_crop= mysql_query("delete from farm_cropdb where id='$id'"); $newmoney = $ir[money]+($cropcheck[buyvalue]/2); $add_gold= mysql_query("update users set money='$newmoney' where userid='$userid'"); } else { echo " This crop is perfect!"; $rem_crop= mysql_query("delete from farm_cropdb where id='$id'"); $newmonry = $ir[money]+$cropcheck[sellvalue]; $add_gold= mysql_query("update users set money='$newmoney' where userid='$userid'"); } [code]
-
Re: [mccode v2] Drugs Corner i dont see how you get that error unless your useing a differeant version then 2
-
[mccodes v2] ingame 3 colum template modified
MDK666 replied to MDK666's topic in Free Modifications
Re: [mccodes v2] ingame 3 colum template modified tnks -
Re: [mccode v2] Fishing Mod lol me too im currently working on a new fishing mod, farming mod, and maybe a new inventory mod again :-P
-
[mccodes v2] ingame 3 colum template modified
MDK666 replied to MDK666's topic in Free Modifications
Re: [mccodes v2] ingame 3 colum template modified i could fix it but i dont know ecaxtly did i mean its just a header file thats edited maybe the other guy is right who knows. but im currently working on a new mod so i cant help you at the moment, and thanks shaved i hope your not made that i got to it before you. -
Re: [mccode v2] Fishing Mod so shaved92bravada is there a update yet on the fishing mod? i wouldnt mind knowing where your at with a updated mod :-D
-
[mccodes v2] ingame 3 colum template modified
MDK666 replied to MDK666's topic in Free Modifications
Re: [mccodes v2] ingame 3 colum template modified its a 3 colomn, some of the links from menu are on the left and some on the right, the header also has finding random items, and thats about it. -
[mccodes v2] ingame 3 colum template modified
MDK666 replied to MDK666's topic in Free Modifications
Re: [mccodes v2] ingame 3 colum template modified you can get the images here -
well everyone after playing around with the header for who knows how long its the headers from shavedbravadas first template ill also post a screenshot so u can see it before useing it. im not releaseing my images so ull have to make ur own. other then that this has a right side menu. header.php <?php class headers { function startheaders() { $table = array ( "explore" => "Exploring", "index" => "Home", "inventory" => "Items", "mailbox" => "Checking Mail", "events" => "Checking Events", "gym" => "Training", "gym2" => "Training Donator", "criminal" => "Criminal Grounds", "docrime" => "Doing Crime", "streets" => "Searching Streets", "announcements" => "Checking Announcements", "job" => "At Your Job", "education" => "At School", "hospital" => "At The Hospital", "jail" => "At The Jail", "forums" => "At The Forums", "newspaper" => "Reading Newspaper" ); $key = substr($key = basename($_SERVER['PHP_SELF']), 0, strpos($key, ".")); $page = isset($table[$key]) ? $table[$key] : " "; global $db,$c,$userid,$ir; $back="#5A5A5A"; //Define the background colour of your site here. $enperc=(int) ($ir['energy']/$ir['maxenergy']*100); $wiperc=(int) ($ir['will']/$ir['maxwill']*100); $experc=(int) ( $ir['exp']/$ir['exp_needed']*100); $brperc=(int) ($ir['brave']/$ir['maxbrave']*100); $hpperc=(int) ($ir['hp']/$ir['maxhp']*100); $enopp=100-$enperc; $wiopp=100-$wiperc; $exopp=100-$experc; $bropp=100-$brperc; $hpopp=100-$hpperc; $d=""; $u=$ir['username']; if($ir['donatordays']) { $u = "<font color=red>{$ir['username']}</font>";$d="[img=donator.gif]"; } $gn=""; $fm=money_formatter($ir['money']); $cm=money_formatter($ir['crystals'],''); //-- Finding items query $fia=(int) rand(1,9); $fib=(int) rand(1,9); if($fia == $fib) { $iq=mysql_query("SELECT * FROM items WHERE itmbuyable=1 ORDER BY rand() LIMIT 1",$c); $r=mysql_fetch_array($iq); $item=$r['itmid']; $userid=$ir['userid']; mysql_query("INSERT INTO inventory VALUES ('', $item, $userid, 1)",$c); event_add($userid,"You found a {$r['itmname']} While Walking Around the city.",$c); } echo <<<EOF <!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <html> <head> <title>{$set['game_name']}</title> <style> body { background: #2D2D2D; font-family:Verdana, fantasy; font-size:13px; color: red; scrollbar-base-color: black; scrollbar-arrow-color: red; scrollbar-DarkShadow-Color: black; } a:visited,a:active,a:link { color: white;text-decoration: none; } a:hover { color: red;text-decoration: overline underline;background: none; } table,tr,td { font-family:Palatino Linotype; color: red;font-size: 12px; } .button { font-family:Verdana, fantasy; font-size:13; color:red; background-color: red; } input,textarea,dropdown{ font-family:Verdana, fantasy; font-size:13; color: red; background-color: #000000; border: 1px solid; } textarea,.submit input{ font-family:Verdana, fantasy; font-size:13; color:red; background-color: white; } .table { background-color:#000000; } .table3 { background-color:#000000; } .table td { background-color:#DEDEDE; height:22px; } .table3 td { background-color:#CCCCCC; } td .alt { background-color:#EEEEEE; height:22px; } td .h { background-image:url(tablehgrad.png); background-repeat:repeat-x; font-weight: bold; background-color: #D6D6D6; } .table th { background-image:url(tablehgrad.png); background-repeat:repeat-x; font-weight: bold; background-color: #D6D6D6; } .menu th { font-font-size: 12px; color: red; background-image:url(th.png); background-repeat:repeat-x; font-weight: bold; background-color: #4B4B4B; } .stats td { font-font-size: 12px; color: white; font-weight: bold; } .menu td { font-font-size: 12px; color: white; text-align: center; background-image:url(tdover.png); background-repeat:repeat-x; font-weight: bold; background-color: #4B4B4B; } .menu td:hover{ color: white; background-image:url(td.png); </style> </head><body> <center><table width=1018 border=0 cellpadding=0 cellspacing=0><tr><td background="top1.png" height=223 width=1018> <table width=1000 height="159"><td width=5></td></td> <td align='center' width="688" height='147' valign="top"> <image src='banner.gif'></table> <table width=1000 class='stats'><tr><td width=5></td> <td></td><td>[b]Energy:[/b] {$enperc}% [url='crystaltemple.php?spend=refill'][size="1"]<font color=yellow>[refill]</font>[/size][/url] <img src=bar_left.gif height=5><img src=greenbar.gif width=100 height=5><img src=redbar.gif width=0 height=5><img src=bar_fil_end.gif height=5></td><td></td> <td></td><td>[b]Will:[/b] {$wiperc}% <img src=bar_left.gif height=5><img src=greenbar.gif width=100 height=5><img src=redbar.gif width=0 height=5><img src=bar_fil_end.gif height=5></td><td></td> <td></td><td>[b]Brave:[/b] {$ir['brave']}/{$ir['maxbrave']} <img src=bar_left.gif height=5><img src=greenbar.gif width=100 height=5><img src=redbar.gif width=0 height=5><img src=bar_fil_end.gif height=5></td><td></td> <td></td><td>[b]EXP:[/b] {$experc}% <img src=bar_left.gif height=5><img src=greenbar.gif width=100 height=5><img src=redbar.gif width=0 height=5><img src=bar_fil_end.gif height=5></td><td></td> <td></td><td>[b]Health:[/b] {$hpperc}% <img src=bar_left.gif height=5><img src=greenbar.gif width=100 height=5><img src=redbar.gif width=0 height=5><img src=bar_fil_end.gif height=5></td><td></td> </tr></table></center></td> </tr> <td background='middle1.png'> <table width=100% border=0 cellpadding=0 cellspacing=0> <tr valign="top"><td width=10></td><td width=145> EOF; } function userdata($ir,$lv,$fm,$cm,$dosessh=1) { global $db,$c,$userid, $set; $IP = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; $db->query("UPDATE users SET laston=unix_timestamp(),lastip='$IP' WHERE userid=$userid"); if(!$ir['email']) { global $domain; die ("<body></td><td>Your account may be broken. Please mail help@{$domain} stating your username and player ID.</td><td width=25></td></tr> </table> <tr><td><image src='bottom1.png'></td></tr></table>"); } if($dosessh && ($_SESSION['attacking'] || $ir['attacking'])) { print "You lost all your EXP for running from the fight."; $db->query("UPDATE users SET exp=0,attacking=0 WHERE userid=$userid"); $_SESSION['attacking']=0; } global $staffpage; $bgcolor = '#878787'; print <<<OUT <center> <form name='Tick'> <div id='clock' name='clock'></div> </form> <script> <!-- function show(){ var Digital=new Date() var hours=Digital.getHours() var minutes=Digital.getMinutes() var seconds=Digital.getSeconds() var dn='AM' if (hours>12){ dn='PM' hours=hours-12 } if (hours==0) hours=12 if (minutes<=9) minutes='0'+minutes if (seconds<=9) seconds='0'+seconds document.getElementById('clock').innerHTML =hours+':'+minutes+':' +seconds+' '+dn setTimeout('show()',1000) } show() //--> </script> OUT; if($ir['fedjail']) { $q=$db->query("SELECT * FROM fedjail WHERE fed_userid=$userid"); $r=$db->fetch_row($q); die("</td><td>[b]<font color=red size=+1>You have been put in the {$set['game_name']} Federal Jail for {$r['fed_days']} day(s). Reason: {$r['fed_reason']}</font>[/b]</td><td width=25></td></tr> </table> <tr><td><image src='bottom1.png'></td></tr></table></body></html>"); } if(file_exists('ipbans/'.$IP)) { die("</td><td>[b]<font color=red size=+1>Your IP has been banned from {$set['game_name']}, there is no way around this.</font>[/b]</td><td width=25></td></tr> </table> <tr><td><image src='bottom1.png'></td></tr></table></body></html>"); } } function menuarea() { include "mainmenu.php"; global $ir,$c; $bgcolor = 'red'; print '</td><td width=30></td><td width=775><center>'; if($ir['hospital']) { print "[b]NB:[/b] You are currently in hospital for {$ir['hospital']} minutes. "; } if($ir['jail']) { print "[b]NB:[/b] You are currently in jail for {$ir['jail']} minutes. "; } } function smenuarea() { include "smenu.php"; global $ir,$c; $bgcolor = '#878787'; print '</td><td width=30></td><td width=775><center>'; } function endpage() {print "</td>"; global $db,$c,$userid, $ir; print "<td width=30></td><td width=5></td><td width='165'> "; include "mainmenu2.php"; print "</tr> </table> </html>"; print <<<OUT </td><td width=25></td></tr> </table> <tr><td><image src='bottom1.png'></td></tr></table> OUT; } } ?> mainmenu.php <?php /** * Layout made by: Shaved92bravada Idea came from another post on CE * Rest of code is just standard V2 MCcodes * Made as a free mod so it is not to be sold. */ global $db,$c,$ir, $set; $hc=$set['hospital_count']; $jc=$set['jail_count']; $ec=$ir['new_events']; $mc=$ir['new_mail']; if($ir['hospital']) { print "<table width=145 class=menu><th>Main</th><tr><td> [url='hospital.php']Hospital ($hc)[/url]</td></tr> <tr><td>[url='inventory.php']Inventory[/url]</td></tr>"; } elseif($ir['jail']) { print "<table width=145 class=menu><th>Main</th><tr><td> [url='jail.php']Jail ($jc)[/url]</td></tr> <tr><td>[url='inventory.php']Inventory[/url]</td></tr>"; } else { print "<table width=145 class=menu><th>Main</th><tr><td> [url='index.php']Home[/url]</td></tr> <tr><td>[url='streets.php']Explore Streets<font color='red'><blink>(new)</blink></font>[/url]</td></tr> <tr><td>[url='inventory.php']Inventory[/url]</td></tr>"; } if($ec > 0) { print "<tr><td>[url='events.php']Events ($ec)[/url]</td></tr>"; } else { print "<tr><td>[url='events.php']Events (0)[/url]</td></tr>"; } if($mc > 0) { print "<tr><td>[url='mailbox.php']Mailbox ($mc)<image src='mail.jpg'>[/url]</td></tr>"; } else { print "<tr><td>[url='mailbox.php']Mailbox (0)[/url]</td></tr>"; } if($ir['jail'] and !$ir['hospital']) { print "<tr><td>[url='gym.php']Jail Gym[/url]</td></tr> <tr><td>[url='hospital.php']Hospital ($hc)[/url]</td></tr>"; } else if (!$ir['hospital']) { print "<tr><td>[url='explore.php']Explore[/url]</td></tr> <tr><td>[url='gym.php']Gym[/url]</td></tr> <tr><td>[url='criminal.php']Crimes[/url]</td></tr> <tr><td>[url='job.php']Your Job[/url]</td></tr> <tr><td>[url='education.php']Local School[/url]</td></tr> <tr><td>[url='hospital.php']Hospital ($hc)[/url]</td></tr> <tr><td>[url='jail.php']Jail ($jc)[/url]</td></tr>"; } else { print "<tr><td>[url='jail.php']Jail ($jc)[/url]</td></tr>"; } print "<tr><td>[url='/forums']Forums[/url]</td></tr>"; if($ir['new_announcements']) { print "<tr><td>[url='announcements.php']Announcements ({$ir['new_announcements']})[/url]</td></tr>"; } else { print "<tr><td>[url='announcements.php']Announcements (0)[/url]</td></tr>"; } print " <tr><td>[url='newspaper.php']Newspaper[/url]</td></tr> <tr><td>[url='search.php']Search[/url]</td></tr>"; if(!$ir['jail'] && $ir['gang']) { print "<tr><td>[url='yourgang.php']Your Gang[/url]</td></tr>"; } print "<th>[b]Personal:[/b]</th> <tr><td>[url='preferences.php']Preferences[/url]</td></tr> <tr><td>[url='preport.php']Player Report[/url]</td></tr> <tr><td>[url='breport.php']Bug Report<font color='red'><blink>(new)</blink>[/url]</td></tr> <tr><td>[url='helptutorial.php']Help Tutorial[/url]</td></tr> <tr><td>[url='gamerules.php']Game Rules[/url]</td></tr> <tr><td>[url='viewuser.php?u={$ir[']My Profile[/url]</td></tr> <tr><td>[url='logout.php']Logout[/url]</td></tr> </table>"; ?> mainmenu2.php <?php { print "<table width=145 class=menu><th>Player Stats</th> <center><font color=white><center> <tr><td>[b]Name:[/b] {$ir['username']} $d</td></tr> <tr><td>[b]Donator: {$ir['donatordays']} Days Left </td></tr> <tr><td>[b]Level:[/b] {$ir['level']}</td></tr> <tr><td>[b]Money:[/b] {$fm}</td></tr> <tr><td>[b]Crystals:[/b] {$ir['crystals']}</td></tr> <tr><td>[b]Diamonds:[/b] {$ir['diamonds']}</td></tr> <tr><td>[b]Banked Money:[/b] {$ir['bankmoney']}</td></tr> <tr><td>[b]Banked Crystals:[/b] {$ir['bankcrystals']}</td></tr> <tr><td>[b]Banked Diamonds:[/b] {$ir['bankdiamonds']}</td></tr> <tr><td>[b]TOC Credits:[/b] {$ir['credits']}</td></tr> <tr><td>[b]Turns:[/b] {$ir['turns']}</td></tr> <tr><td>[b]Fishing Turns:[/b] {$ir['fishing_aloud']}</td></tr> <tr><td>[b]Gender:[/b] {$ir['gender']}</td></tr> <tr><td>[b]Race:[/b] {$ir['class']}</td></tr> <tr><td>[b]Happiness:[/b] {$ir['happiness']}</td></tr> <tr><td>[b]Tired:[/b] {$ir['tired']}</td></tr> <tr><td>[b]Allowance:[/b] {$ir['allowence']}</font></td></tr>"; } if($ir['user_level'] > 1) { print "<th>[b]Staff Only:[/b]</th> <tr><td>[url='staff.php']Staff Panel[/url]</td></tr>"; } print "<th>[b]Staff Online:[/b]</th>"; $q=$db->query("SELECT * FROM users WHERE laston>(unix_timestamp()-15*60) AND user_level>1 ORDER BY userid ASC"); while($r=$db->fetch_row($q)) { $la=time()-$r['laston']; $unit="secs"; if($la >= 60) { $la=(int) ($la/60); $unit="mins"; } if($la >= 60) { $la=(int) ($la/60); $unit="hours"; if($la >= 24) { $la=(int) ($la/24); $unit="days"; } } print "<tr><td>[url='viewuser.php?u={$r[']{$r['username']}[/url] ($la $unit)</td></tr>"; } if($ir['donatordays']) print " <th>Donators Only[/b]</th> <tr><td>[url='friendslist.php']Friends List[/url]</td></tr> <tr><td>[url='blacklist.php']Black List[/url]</td></tr><table>"; ?>
-
Re: [mccode v2] Donator and Non-Donator Lottery nice mod +1
-
Re: [mccode v2] Fishing Mod i didnt really mean 8-10 hrs 1-3 is good enough if that, as long as we give each other ideas, and keep in contact then were good to go as long as we do work. we work hard and play harder. staff in the game along with coders and etc get the items to beta test with.
-
Re: game ideas but how does that deal with game ideas by asking if we know what mma stands for i mean he could of listed details or etc.
-
Re: game ideas mma stands for mixed martial arts why?
-
[mccodes v2] Find random items while playing the game...
MDK666 replied to MDK666's topic in Free Modifications
Re: [mccodes v2] Find random items while playing the game... //-- Finding items query $fia=(int) rand(10,99); //change these to what you want $fib=(int) rand(10,99); //change these to what you want if($fia == $fib) { $iq=$db->query("SELECT * FROM items WHERE itmbuyable=1 ORDER BY rand() LIMIT 1",$c); $r=$db->fetch_row($iq); $item=$r['itmid']; $userid=$ir['userid']; $db->query("INSERT INTO inventory VALUES ('', $item, $userid, 1)",$c); event_add($userid,"While Playing The Game You Found A {$r['itmname']} Think Of It As A Present For Playing The Game.",$c); }