Jump to content
MakeWebGames

Maniak

Members
  • Posts

    202
  • Joined

  • Last visited

Everything posted by Maniak

  1. <?php /* ------------------------------------ -- Country Mod -- -- Created by Coly010 -- -- Fixed by Maniak -- -- PLEASE KEEP THIS AS IT IS -- ------------------------------------ */ include_once (DIRNAME(__FILE__) .'/globals.php'); echo "<h3>The Countryside</h3> <p align='left'>Try your best to find random stuff. Remember you might lose things too. Your risk.</p> <p align='left'>[b]Remember... It costs 1 energy to move![/b]</p>"; $_GET['page'] = isset($_GET['page']) && ctype_alpha($_GET['page']) ? trim($_GET['page']) : false; switch($_GET['page']) { case 'north': north(); break; case 'south': south(); break; case 'east': east(); break; case 'west': west(); break; default: country_index(); break; } function country_index() { global $ir, $h; echo "<table><tr><td valign='center' style='border-color:#C3C3C3'>[url='?page=north']<input type='button' style='background-color: black; font: white;' value='North' />[/url]</td><tr> <tr><td valign='center' style='border-color:#C3C3C3'>[url='?page=east']<input type='button' style='background-color: black; font: white;' value='East' />[/url]</td><tr> <tr><td valign='center' style='border-color:#C3C3C3'>[url='?page=south']<input type='button' style='background-color: black; font: white;' value='South' />[/url]</td><tr> <tr><td valign='center' style='border-color:#C3C3C3'>[url='?page=west']<input type='button' style='background-color: black; font: white;' value='West' />[/url]</td><tr></table>"; $h->endpage(); } function north() { global $ir, $db, $h; $chance = rand(1,6); // Edit and add things as you please. $amnt=rand(0,50000); $gained=rand(5,10)*$ir['level']; if($ir['energy'] < 1) { echo "You don't have enough Energy.. Come back in 5!"; } else { echo "You stepped North ".$chance.""; $db->query("UPDATE `users` SET energy=energy-1 WHERE `userid`=".$_SESSION['userid'].""); } if($chance == 1) { echo "You found a Treasure Chest! You open it and find <font color='yellow'>$amnt</font>"; $db->query("UPDATE `users` SET money=money+".$amnt." WHERE `userid`=".$_SESSION['userid'].""); } elseif($chance == 2) { echo "UNLUCKY! You were mugged and lost <font color='yellow'>$amnt</font>"; $db->query("UPDATE `users` SET money=money-{$amnt} WHERE `userid`=".$_SESSION['userid'].""); } elseif($chance == 3) { echo "You were attacked by a cow and lost a lot of things!"; $db->query("UPDATE `users` SET `money`=money-".$ir['money'].", hp=hp-".$ir['hp'].", energy=energy-".$ir['energy']." WHERE userid=".$_SESSION['userid'].""); } elseif($chance == 4) { echo "Nothing here..."; } elseif($chance == 5) { echo "You found a bag whilst walking. The bag contained <font color='cyan'>$gained</font> crystals."; $db->query("UPDATE `users` SET crystals=crystals+".$gained." WHERE `userid`=".$_SESSION['userid'].""); } elseif($chance == 6) { echo "You were attacked by a Sheep and lost <font color='cyan'>$gained</font> crystals."; $db->query("UPDATE `users` SET crystals=crystals-".$gained." WHERE `userid`=".$_SESSION['userid'].""); } } function east() { global $ir, $db, $h; $chance = rand(1,6); // Edit and add things as you please. $amnt=rand(0,50000); $gained=rand(5,10)*$ir['level']; if($ir['energy'] < 1) { echo "You don't have enough Energy.. Come back in 5!"; } else { echo "You stepped East ".$chance.""; $db->query("UPDATE `users` SET energy=energy-1 WHERE `userid`=".$_SESSION['userid'].""); } if($chance == 1) { echo "You found a Treasure Chest! You open it and find <font color='yellow'>$amnt</font>"; $db->query("UPDATE `users` SET money=money+".$amnt." WHERE `userid`=".$_SESSION['userid'].""); } elseif($chance == 2) { echo "UNLUCKY! You were mugged and lost <font color='yellow'>$amnt</font>"; $db->query("UPDATE `users` SET money=money-{$amnt} WHERE `userid`=".$_SESSION['userid'].""); } elseif($chance == 3) { echo "You were attacked by a cow and lost a lot of things!"; $db->query("UPDATE `users` SET `money`=money-".$ir['money'].", hp=hp-".$ir['hp'].", energy=energy-".$ir['energy']." WHERE userid=".$_SESSION['userid'].""); } elseif($chance == 4) { echo "Nothing here..."; } elseif($chance == 5) { echo "You found a bag whilst walking. The bag contained <font color='cyan'>$gained</font> crystals."; $db->query("UPDATE `users` SET crystals=crystals+".$gained." WHERE `userid`=".$_SESSION['userid'].""); } elseif($chance == 6) { echo "You were attacked by a Sheep and lost <font color='cyan'>$gained</font> crystals."; $db->query("UPDATE `users` SET crystals=crystals-".$gained." WHERE `userid`=".$_SESSION['userid'].""); } } function south() { global $ir, $db, $h; $chance = rand(1,6); // Edit and add things as you please. $amnt=rand(0,50000); $gained=rand(5,10)*$ir['level']; if($ir['energy'] < 1) { echo "You don't have enough Energy.. Come back in 5!"; } else { echo "You stepped South ".$chance.""; $db->query("UPDATE `users` SET energy=energy-1 WHERE `userid`=".$_SESSION['userid'].""); } if($chance == 1) { echo "You found a Treasure Chest! You open it and find <font color='yellow'>$amnt</font>"; $db->query("UPDATE `users` SET money=money+".$amnt." WHERE `userid`=".$_SESSION['userid'].""); } elseif($chance == 2) { echo "UNLUCKY! You were mugged and lost <font color='yellow'>$amnt</font>"; $db->query("UPDATE `users` SET money=money-{$amnt} WHERE `userid`=".$_SESSION['userid'].""); } elseif($chance == 3) { echo "You were attacked by a cow and lost a lot of things!"; $db->query("UPDATE `users` SET `money`=money-".$ir['money'].", hp=hp-".$ir['hp'].", energy=energy-".$ir['energy']." WHERE userid=".$_SESSION['userid'].""); } elseif($chance == 4) { echo "Nothing here..."; } elseif($chance == 5) { echo "You found a bag whilst walking. The bag contained <font color='cyan'>$gained</font> crystals."; $db->query("UPDATE `users` SET crystals=crystals+".$gained." WHERE `userid`=".$_SESSION['userid'].""); } elseif($chance == 6) { echo "You were attacked by a Sheep and lost <font color='cyan'>$gained</font> crystals."; $db->query("UPDATE `users` SET crystals=crystals-".$gained." WHERE `userid`=".$_SESSION['userid'].""); } } function west() { global $ir, $db, $h; $chance = rand(1,6); // Edit and add things as you please. $amnt=rand(0,50000); $gained=rand(5,10)*$ir['level']; if($ir['energy'] < 1) { echo "You don't have enough Energy.. Come back in 5!"; } else { echo "You stepped West ".$chance.""; $db->query("UPDATE `users` SET energy=energy-1 WHERE `userid`=".$_SESSION['userid'].""); } if($chance == 1) { echo "You found a Treasure Chest! You open it and find <font color='yellow'>$amnt</font>"; $db->query("UPDATE `users` SET money=money+".$amnt." WHERE `userid`=".$_SESSION['userid'].""); } elseif($chance == 2) { echo "UNLUCKY! You were mugged and lost <font color='yellow'>$amnt</font>"; $db->query("UPDATE `users` SET money=money-{$amnt} WHERE `userid`=".$_SESSION['userid'].""); } elseif($chance == 3) { echo "You were attacked by a cow and lost a lot of things!"; $db->query("UPDATE `users` SET `money`=money-".$ir['money'].", hp=hp-".$ir['hp'].", energy=energy-".$ir['energy']." WHERE userid=".$_SESSION['userid'].""); } elseif($chance == 4) { echo "Nothing here..."; } elseif($chance == 5) { echo "You found a bag whilst walking. The bag contained <font color='cyan'>$gained</font> crystals."; $db->query("UPDATE `users` SET crystals=crystals+".$gained." WHERE `userid`=".$_SESSION['userid'].""); } elseif($chance == 6) { echo "You were attacked by a Sheep and lost <font color='cyan'>$gained</font> crystals."; $db->query("UPDATE `users` SET crystals=crystals-".$gained." WHERE `userid`=".$_SESSION['userid'].""); } } ?> *PHP Tags didn't work* EDIT: This one works; AND I have tested it!
  2. I've gone through and added a few } Still got the error; so I think there is a bit more wrong.. Lol. Give me a bit; and i'll fix and secure it.
  3. Okay, AlabamaHit! Thank you for letting me know XD
  4. Hmm.. You can have the chat between you and the fedded player - in a seperate "private chat"; but I don't think it logs the chat.
  5. Insall a Mibbit chat on your game, and on the page that the Fedded players see; have a link to the chat. Simples :thumbup:
  6. I've updated the 1st post. It was missing the 'Buy' in the Array; and also a } before ?> All should work well now.
  7. switch($_GET['action']) { case 'add': add(); break; case 'Buy': Buy(); break; default: index(); break; } if (!in_array($_GET['action'], array('index', 'add'))) { echo('Invalid Command!'); exit($h->endpage()); }   I'm just about to put it on my XAMPP Server and test it. I did notice that earlier (Equinox updated the script, so it is his fault :P lol).
  8. Thank you for that Equinox; i'll update the post shortly :)
  9. Maniak

    Apple Freebies

    I just looked into this site, by searching Google; and also their T & C.. This looks to be a Scam, and from all your "hard work" to get the referrals needed for such products offered by them; you may not even recieve them! A couple of things from their T & C: (a). Freebiejeebies cannot guarantee the receipt of any product regardless of offers completed or referrals gained. All users are subject to our fraud verification process before they receive any gift and if found to be fraudulent will never receive a gift. You could work your ass off to get the iPod Touch for free, only for them to turn around and say: Sorry, but 6 of your 8 referrals came up fraudulent; and therefore no iPod Touch will be dispached. Even if all of your referrals were legitimate. (b). Freebiejeebies cannot guarantee that you will receive credit for completing an offer. We reserve the right to refuse to credit you for the completion of an offer for a variety of reasons, including, but not limited to, lack of appropriate information, improper sign-up method, improper browser settings, and/or history of manual credits. Again, what was said in Red above. There are MANY more things that I could list; but I really cannot be bothered :huh:. If you would like to find more info about this company; then go look on Google or, at their T & C. [lmgtfy]freebie jeebies[/lmgtfy]
  10. Has anyone installed this Mod yet, as I am wanting to know if there are any bugs within it. It was fine on my XAMPP server, but I did not do thorough testing.
  11. All information in the 1st post.
  12. First off, I do not know why anyone would want this.. But it is something >.< 1. Create new file (dealer.php) and insert: <?php /*---------------------------------------------------------- -- Crystal Dealer -- Please DO NOT alter this section -- This page has been developed by David Armstead (Maniak) -- Contact me @ [email][email protected][/email] ----------------------------------------------------------*/ include_once (DIRNAME(__FILE__) .'/globals.php'); $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? trim($_GET['action']) : 'index'; switch($_GET['action']) { case 'add': add(); break; case 'Buy': Buy(); break; default: index(); break; } if (!in_array($_GET['action'], array('index', 'add', 'Buy'))) { echo('Invalid Command!'); exit($h->endpage()); } function index() { global $db, $ir, $h; $q=$db->query("SELECT * FROM `crydeal` ORDER BY `crystals` ASC"); // Lists the crystal packages in order of crystals. To change to order of price, then change `crystals to `price` echo "<h3>Crystal Dealer</h3>"; if($ir['user_level'] == 2) { echo "<p align='left'>[url='?action=add']Add crystals to the dealer[/url]</p>"; } echo "<p align='left'>Welcome to the crystal Dealer. Here you can buy a set amount of crystals from the game for a set price.</p> <table width='50%' class='table'><tr> <td class='h' width='40%'>Number of Crystals</td> <td class='h' width='40%'>Cost</td> <td class='h' width='10%'></td> </tr>"; if(!$db->num_rows($q)) { echo "<tr><td colspan='3' align = 'center'>No crystals for sale here!</td></tr>"; } else { while ($r=$db->fetch_row($q)) { echo "<tr> <td width='40%'>".number_format($r['crystals'])."</td> <td width='40%'>$".number_format($r['price'])."</td> <td width='10%'><a href='dealer.php?action=Buy&id=".$r['id']."'>[buy]</td> </tr>"; } } echo "</table>"; } function add() { global $db, $ir, $h; if(isset($_POST['submit'])) { if(!isset($_POST['crystals'])) { echo "Amount of crystals cannot be empty!"; exit($h->endpage()); } if(!isset($_POST['price'])) { echo "The price cannot be empty!"; exit($h->endpage()); } else { $db->query("INSERT INTO `crydeal` VALUES(NULL, ".abs(intval($_POST['crystals'])).", ".abs(intval($_POST['price'])).")"); echo "Crystal package added. [url='dealer.php'][View package][/url]"; } } if($ir['user_level'] !=2) { echo "Haha, trying to fool the system?! Just get out of here!"; } else { echo "<form action='?action=add' method='post'> <table width='95%' class='table'> <tr> <td colspan='2' class='h'><center>Add a new package</td> </tr> <tr> <td>Amount of crystals</td> <td><input type='text' name='crystals' length='70'></td> </tr> <tr> <td>Cost (for the package)</td> <td><input type='text' name='price' length='70'></td> </tr> <tr> <td></td> <td align='right'><input type='submit' value='Add package' name='submit' /></td> </tr> </table> </form>"; } } function Buy() { global $h, $ir, $db; if((!isset($_GET['id'])) || !ctype_digit($_GET['id'])) { echo "Invalid use of file"; exit($h->endpage()); } else { $q=$db->query("SELECT * FROM `crydeal` WHERE `id` = ".$_GET['id'].""); if(mysql_num_rows($q) == 0) { echo "Invalid action."; exit($h->endpage()); } else { $cryd=$db->fetch_row($q); if($ir['money'] < $cryd['price']) { echo "You do not have enough Money!"; exit($h->endpage()); } $price=$cryd['price']; $crystals=$cryd['crystals']; echo "You brought ".number_format($cryd['crystals'])." for $".number_format($price).". > [url='explore.php']Back[/url]"; $db->query("UPDATE `users` SET `money` = `money` - ".$price.", `crystals` = `crystals` + ".$crystals." WHERE (`userid` = ".$_SESSION['userid'].")"); } } } ?> Thanks to Equinox from MWG for putting them both into 1 file, and adding/removing certain bits. 2. Add to explore.php (where you want the link to be displayed). [url='dealer.php']Crystal Dealer[/url] 3. Upload this SQL: [mysql]-- -------------------------------------------------------- -- -- Table structure for table `crydeal` -- CREATE TABLE `crydeal` ( `id` int( 11 ) NOT NULL AUTO_INCREMENT, `crystals` int( 11 ) NOT NULL default '0', `price` int( 11 ) NOT NULL default '0', PRIMARY KEY ( `id` ) ) ENGINE = MYISAM DEFAULT CHARSET = latin1; -- --------------------------------------------------------[/mysql] Screen Shots: (some of the images will differ to the actual thing, as I took the Screen Shots before changing it. Also, in the first image; if the player isn't an Admin then the link to add Crystal Packages will not display) Post any bugs found, and I will fix them! NOTE: The new dealer.php hasn't been tested by myself, so I do not know if it works. Edit: It has been tested, and does work.
  13. This one? [mccode v2] 50/50 for money and for crystals
  14. It looks great! Love the design of it :)
  15. These are awesome! Did you get a "Base" image of the different things, as I found it almost impossible to create anything from scratch when I used Illustrator.
  16. Well, instead of asking for a Script, couldn't you just go through the free modifications section, and look for an un-secured mod, secure it and ask someone to check it? Or get a standard MCCodes Script and secure that, then ask if it is okay? Just a suggestion. :thumbsup:
  17. Thanks, i've tried this as well, but it doesn't work :S $mycolor=""; if($ir['user_level'] == 2) { $mycolor="blue"; } if($ir['user_level'] == 1 && $ir['donatordays'] == 0) { $mycolor="orange"; } if($ir['user_level'] == 1 && $ir['donatordays'] > 0) { $mycolor="yellow"; } if($ir['user_level'] == 4) { $mycolor="red"; } if($ir['user_level'] == 3) { $mycolor="green"; } if($ir['user_level'] == 5) { $mycolor="purple"; } And then put <font color=$mycolor>{$ir['username']}</font> where I want th username to be. (I can't remember if that is the exact coding..)
  18. I tried something a long the lines of that, and it messed up the coding when I attacked someone :S
  19. In my header.php how do I make the different User Levels have different colour names? I have tried a few things, but when I do, it either doesn't work; or it Errors coding somewhere else in my Script.
  20. Ignore the last post. I still had to delete a ") at the end of line 52.. But it works! Thanks!!
  21. I had to delete a ") at the end of line 52 to get it to work, the list of cities appears but when I click on the link to go to the city; it doesn't move cities.. It says that the City ID=0.. Sorry for being a pain! And thank you for your help!
  22. It isn't showing the cities, so I cannot test it. I've tried a few things, but the list of cities doesn't show.
  23. AARGH! Why is it displaying the code like that?
  24. I'm having troubles with my Travel System (monorail.php). I have changed it to where each city has a different cost to travel to, and no matter what amount of money the Player has out, it lets them travel. If the Player has less money than the cost to travel to the city then the amount of money goes into negative figures. This is the if code (unfinished atm, but I wanted this solving before I move on):   <?phpinclude "globals.php";$_GET['to'] = abs((int) $_GET['to']);if(!$_GET['to']){echo "<div class='maincontent'><h1>Bus Station</h1><div class='main_text'> Welcome to the Bus Station... Where would you like to travel today? You can travel anywhere your Level allows you to, for a set price!</p>";$q=$db->query("SELECT * FROM cities WHERE cityid != {$ir['location']} AND cityminlevel <= {$ir['level']}");echo " <table width=75% cellspacing=1 align=center><tr><td width=50%>[b]City[/b]</td><td width=30%>[b]Minimum Level[/b]</td><td width=20%>[b]Cost[/b]</td></tr>";while($r=$db->fetch_row($q)){echo "<tr><td>[url='monorail.php?to={$r[']{$r['cityname']}[/url]</td><td>{$r['cityminlevel']}</td><td>\${$r['citycost']}</td></tr>";}echo "</table></p></div></div>";}else{if($ir['money'] < $r['citycost']){echo "You don't have enough money.";}else if( ((int) $_GET['to']) != $_GET['to']){echo "Invalid city ID";}else{$q=$db->query("SELECT * FROM cities WHERE cityid = {$_GET['to']} AND cityminlevel <= {$ir['level']}");if(!$db->num_rows($q)){print "Error, this city either does not exist or you cannot go there.";}else{$r=$db->fetch_row($q);$db->query("UPDATE users SET money=money-{$r['citycost']},location={$_GET['to']} WHERE userid=$userid");echo "Congratulations, you paid \${$r['citycost']} and travelled to {$r['cityname']} on the monorail!";}}}$h->endpage();?>
  25. I have changed my header.php quite a lot, but I was struggling with this as well. What you have to do is: Find: $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=""; global $ir,$c;   Then under that add: $tag = mysql_query('SELECT `gangPREF` AS `tag` FROM `gangs` WHERE `gangID` = '.$ir['gang'].''); $tag = mysql_fetch_assoc($tag); $tag = $tag['tag'];   Then find where your username and ID is, and just add $tag where you want the gang tag to be! Hope this helped.
×
×
  • Create New...