Jump to content
MakeWebGames

Faz`

Members
  • Posts

    652
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Faz`

  1. Re: 3 Word Game was mouldy so
  2. Re: [mccode v2] Bodyguard Mod Lol, they were well made. You don't always have to plan, I did for this mod. But for other things I simply do it as I go along. I tend to think up better ideas that way.
  3. Re: [mccode v2] Bodyguard Mod   You say "you people" as if you're the only person that makes a plan of their mod before they do it? How do you know I didn't plan this out? I simply made them for donators. If you don't like it then alter it yourself. I put this up for people that might be looking for something like this.
  4. Re: Rise Of Lycans Instead of acting like babies and directing hate towards each other why don't you discuss it and try to come to a conclusion in a CIVILISED manner!
  5. Re: [mccode v2] Bodyguard Mod I see where you're coming from. I simply made them items so they could be traded.
  6. Re: 3 Word Game which had cockroaches
  7. This is a very simple mod. It simply protects someone from ALL attacks for 5, 10 or 15 minutes. The time can be easily edited, a great donator item. Also good for noobs who are constantly getting attacked. Run this SQL: ALTER TABLE `users` ADD `bgtime` INT(11) NOT NULL DEFAULT '0';   Open up attack.php Find: else if($odata['hospital']) { print "This player is in hospital. [url='index.php']> Back[/url]"; $h->endpage(); $_SESSION['attacking']=0; $ir['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; } Underneath it add: else if($odata['bgtime'] > 0) { print "As you try to attack this person you see a beefy bodyguard appear from the background. You shit your pants and run off. [url='index.php']> Back[/url]"; $h->endpage(); exit; }   Next, open up header.php, find the bit where it displays the voting links, underneath it add: if($ir['bgtime'] > 0) { print "You are protected from all attacks for {$ir['bgtime']} minute(s)"; }   Ok, now you will need to make 3 items. Bodyguard 1, 2 and 3 is what I've named them on my game. The first effect is on, however it will do nothing so simple click on the circle "Yes" when making all 3. Now open up itemuse.php. Find: if($r['effect1_on']) { Underneath it add: if($r['itmid']==60) { mysql_query(sprintf("UPDATE `users` SET `bgtime` = 5 WHERE `userid` = ('%u')", abs(@intval($userid)))) or die(mysql_error()); } elseif($r['itmid']==61) { mysql_query(sprintf("UPDATE `users` SET `bgtime` = 10 WHERE `userid` = ('%u')", abs(@intval($userid)))) or die(mysql_error()); } elseif($r['itmid']==62) { mysql_query(sprintf("UPDATE `users` SET `bgtime` = 15 WHERE `userid` = ('%u')", abs(@intval($userid)))) or die(mysql_error()); }   Now open up cron_minute.php. Add: $db->query("UPDATE users SET bgtime = bgtime - 1 WHERE bgtime > 0");   That should be it. Enjoy the mod, its simple I know, so please no-one reply telling me how easy this is and anyone could have made it. Thank you.
  8. Re: Starting new Game Engine (massive features) - Need feedback   Couldn't have put it better.
  9. Re: Cpanel File Manager V2 from game You would probably put an if statement somewhere then. if($ir['userid']>1) { die("blah");}
  10. Re: check these out Or, go into your cPanel, there might be a redirect set up.
  11. Re: [mccode v2] Tag Mod (Complete) Oh yeah, I thought I'd made an error somewhere :| Thanks for that, will make it easier for a for new people.
  12. Re: [mccodes v2] Taser Mod Yeah, I had this problem. Change it to $this->endpage(); exit; It worked for me.
  13. Re: [mccode v2] Tag Mod (Complete) Ok, well I was talking to BlueDevil23, he taught me a bit about security. So he is a secure version of the Tag Trader, simply replace the current one with this.   <?php include "globals.php"; /*----------------------------------------- | Made by Notorious F.A.Z | | For the Criminal Existence Community | | Do not sell, nor claim as your own work | | -----------------------------------------*/ print <<<EOF1 <style type="text/css"> tradelist li { list-style: none; } .pertag { padding: 20px 0 10px 0; } .error { color: red; padding-bottom: 20px; } .success { color: green; } </style> EOF1; $_GET['spend'] = (isset($_GET['spend']) && is_string($_GET['spend']) ? strtolower(trim($_GET['spend'])) : ""); if(!$_GET['spend']) { print <<<EOF2 <h2>Welcome to the HD Tag Trader</h2> <h4>You have [b]{$ir['HDTags']}[/b] HD Tags.</h4> <h4 style="padding-bottom:20px;">What would you like to spend your Tags on?</h4> <ul id="tradelist"> [*][url='tagtrader.php?spend=strength']Strength - {$set['tt_strengthpertag']} Strength Per Tag[/url] [*][url='tagtrader.php?spend=agility']Agility - {$set['tt_agilitypertag']} Agility Per Tag[/url] [*][url='tagtrader.php?spend=guard']Guard - {$set['tt_guardpertag']} Guard Per Tag[/url] [*][url='tagtrader.php?spend=labour']Labour - {$set['tt_labourpertag']} Labour Per Tag[/url] [*][url='tagtrader.php?spend=IQ']IQ - {$set['tt_iqpertag']} IQ per Tag[/url] [*][url='tagtrader.php?spend=crystals']Crystals - {$set['tt_cryspertag']} Crystal(s) per Tag[/url] [*][url='tagtrader.php?spend=money']Money - \${$set['tt_moneypertag']} per Tag[/url] [/list] EOF2; } elseif($_GET['spend'] == 'strength') { print <<<EOF3 <h4>Type in the amount of Tags you want to swap for Strength.</h4> <h4>You have [b]{$ir['HDTags']}[/b] Tags.</h4> <span class="pertag">One Tag = {$set['tt_strengthpertag']} Strength.</span> <form action='tagtrader.php?spend=strength2' method='post'> <input type='text' name='HDTags' /> <input type='submit' value='Swap' /> </form> EOF3; } elseif($_GET['spend'] == 'strength2') { $_POST['HDTags']= abs(@intval($_POST['HDTags'])); if($_POST['HDTags'] <= 0 || $_POST['HDTags'] > $ir['HDTags']) { echo "<h3 class='error'>Error, you either do not have enough tags or did not fill out the form.</h3>"; echo "[url='tagtrader.php?spend=strength']Back[/url]"; } else { $strengthgain = $_POST['HDTags'] * $set['tt_strengthpertag']; mysql_query(sprintf("UPDATE `users` SET `HDTags` = `HDTags` - ('%d') WHERE `userid` = ('%u')", abs(@intval($_POST['HDTags'])), abs(@intval($userid)))) or die(mysql_error()); mysql_query(sprintf("UPDATE `userstats` SET `strength` = `strength` + ('%d') WHERE `userid` = ('%u')", abs(@intval($strengthgain)), abs(@intval($userid)))) or die(mysql_error()); echo sprintf("<h3 class='success'>You traded %d Tags for %d Strength.</h3>", abs(@intval($_POST['HDTags'])), abs(@intval($strengthgain))); } } elseif($_GET['spend'] == 'agility') { print <<<EOF4 <h4>Type in the amount of Tags you want to swap for Agility.</h4> <h4>You have [b]{$ir['HDTags']}[/b] Tags.</h4> <span class="pertag">One Tag = {$set['tt_agilitypertag']} Agility.</span> <form action='tagtrader.php?spend=agility2' method='post'> <input type='text' name='HDTags' /> <input type='submit' value='Swap' /> </form> EOF4; } elseif($_GET['spend'] == 'agility2') { if($_POST['HDTags'] <= 0 || $_POST['HDTags'] > $ir['HDTags']) { echo "<h3 class='error'>Error, you either do not have enough tags or did not fill out the form.</h3>"; echo "[url='tagtrader.php?spend=agility']Back[/url]"; } else { $agilitygain = $_POST['HDTags']*$set['tt_agilitypertag']; mysql_query(sprintf("UPDATE `users` SET `HDTags` = `HDTags` - ('%d') WHERE `userid` = ('%u')", abs(@intval($_POST['HDTags'])), abs(@intval($userid)))) or die(mysql_query()); mysql_query(sprintf("UPDATE `userstats` SET `agility` = `agility` + ('%d') WHERE `userid` = ('%u')", abs(@intval($agilitygain)), abs(@intval($userid)))) or die(mysql_error()); echo sprintf("<h3 class='success'> You trade %d Tags for %d Agility.</h3>", abs(@intval($_POST['HDTags'])), abs(@intval($agilitygain))); } } elseif($_GET['spend'] == 'guard') { print <<<EOF5 <h4>Type in the amount of Tags you want to swap for Guard.</h4> <h4>You have [b]{$ir['HDTags']}[/b] Tags.</h4> <span class="pertag">One Tag = {$set['tt_guardpertag']} Guard.</span> <form action='tagtrader.php?spend=guard2' method='post'> <input type='text' name='HDTags' /> <input type='submit' value='Swap' /> </form> EOF5; } elseif($_GET['spend'] == 'guard2') { if($_POST['HDTags'] <= 0 || $_POST['HDTags'] > $ir['HDTags']) { echo "<h3 class='error'>Error, you either do not have enough tags or did not fill out the form.</h3>"; echo "[url='tagtrader.php?spend=guard']Back[/url]"; } else { $guardgain = $_POST['HDTags']*$set['tt_guardpertag']; mysql_query(sprintf("UPDATE `users` SET `HDTags` - ('%d') WHERE `userid` = ('%u')", abs(@intval($_POST['HDTags'])), abs(@intval($userid)))) or die(mysql_error()); mysql_query(sprintf("UPDATE `userstats` SET `guard` = `guard` + ('%d') WHERE `userid` = ('%u')", abs(@intval($guardgain)), abs(@intval($userid)))) or die(mysql_error()); echo sprintf("<h3 class='success'> You traded %d Tags for %d Guard.</h3>", abs(@intval($_POST['HDTags'])), abs(@intval($guardgain))); } } elseif($_GET['spend'] == 'labour') { print <<<EOF6 <h4>Type in the amount of Tags you want to swap for Labour.</h4> <h4>You have [b]{$ir['HDTags']}[/b] Tags.</h4> <span class="pertag">One Tag = {$set['tt_labourpertag']} Labour.</span> <form action='tagtrader.php?spend=labour2' method='post'> <input type='text' name='HDTags' /> <input type='submit' value='Swap' /> </form> EOF6; } elseif($_GET['spend'] == 'labour2') { if($_POST['HDTags'] <= 0 || $_POST['HDTags'] > $ir['HDTags']) { echo "<h3 class='error'>Error, you either do not have enough tags or did not fill out the form.</h3>"; echo "[url='tagtrader.php?spend=labour']Back[/url]"; } else { $labourgain = $_POST['HDTags']*$set['tt_labourpertag']; mysql_query(sprintf("UPDATE `users` SET `HDTags` = `HDTags` - ('%d') WHERE `userid` = ('%u')", abs(@intval($_POST['HDTags'])), abs(@intval($userid)))) or die(mysql_error()); mysql_query(sprintf("UPDATE `userstats` SET `labour` = `labour` + ('%d') WHERE `userid` = ('%u')", abs(@intval($labourgain)), abs(@intval($userid)))) or die(mysql_error()); echo sprintf("<h3 class='success'> You traded %d Tags for %d Labour.</h3>", abs(@intval($_POST['HDTags'])), abs(@intval($labourgain))); } } elseif($_GET['spend'] == 'IQ') { print <<<EOF7 <h4>Type in the amount of Tags you want to swap for IQ.</h4> <h4>You have [b]{$ir['HDTags']}[/b] Tags.</h4> <span class="pertag">One Tag = {$set['tt_IQpertag']} IQ.</span> <form action='tagtrader.php?spend=IQ2' method='post'> <input type='text' name='HDTags' /> <input type='submit' value='Swap' /> </form> EOF7; } elseif($_GET['spend'] == 'IQ2') { if($_POST['HDTags'] <= 0 || $_POST['HDTags'] > $ir['HDTags']) { echo "<h3 class='error'>Error, you either do not have enough tags or did not fill out the form.</h3>"; echo "[url='tagtrader.php?spend=IQ']Back[/url]"; } else { $iqgain = $_POST['HDTags']*$set['tt_IQpertag']; mysql_query(sprintf("UPDATE `users` SET `HDTags` = `HDTags` - ('%d') WHERE `userid` = ('%u')", abs(@intval($_POST['HDTags'])), abs(@intval($userid)))) or die(mysql_query()); mysql_query(sprintf("UPDATE `userstats` SET `iq` = `iq` + ('%d') WHERE `userid` = ('%u')", abs(@intval($iqgain)), abs(@intval($userid)))) or die(mysql_error()); echo sprintf("<h3 class='success'> You traded %d Tags for %d IQ.</h3>", abs(@intval($_POST['HDTags'])), abs(@intval($iqgain))); } } elseif($_GET['spend'] == 'money') { print <<<EOF8 <h4>Type in the amount of Tags you want to swap for money.</h4> <h4>You have [b]{$ir['HDTags']}[/b] Tags.</h4> <span class="pertag">One Tag = \${$set['tt_moneypertag']} .</span> <form action='tagtrader.php?spend=money2' method='post'> <input type='text' name='HDTags' /> <input type='submit' value='Swap' /> </form> EOF8; } elseif($_GET['spend'] == 'money2') { if($_POST['HDTags'] <= 0 || $_POST['HDTags'] > $ir['HDTags']) { echo "<h3 class='error'>Error, you either do not have enough tags or did not fill out the form.</h3>"; echo "[url='tagtrader.php?spend=money']Back[/url]"; } else { $moneygain = $_POST['HDTags']*$set['tt_moneypertag']; mysql_query(sprintf("UPDATE `users` SET `HDTags` = `HDTags` - ('%d') WHERE `userid` = ('%u')", abs(@intval($_POST['HDTags'])), abs(@intval($userid)))) or die(mysql_query()); mysql_query(sprintf("UPDATE `users` SET `money` = `money` + ('%d') WHERE `userid` = ('%u')", abs(@intval($moneygain)), abs(@intval($userid)))) or die(mysql_error()); echo sprintf("<h3 class='success'> You traded %d Tags for \$%d.</h3>", abs(@intval($_POST['HDTags'])), abs(@intval($moneygain))); } } elseif($_GET['spend'] == 'crystals') { print <<<EOF9 <h4>Type in the amount of Tags you want to swap for crystals.</h4> <h4>You have [b]{$ir['HDTags']}[/b] Tags.</h4> <span class="pertag">One Tag = {$set['tt_cryspertag']} Crystal(s).</span> <form action='tagtrader.php?spend=crystals2' method='post'> <input type='text' name='HDTags' /> <input type='submit' value='Swap' /> </form> EOF9; } elseif($_GET['spend'] == 'crystals2') { if($_POST['HDTags'] <= 0 || $_POST['HDTags'] > $ir['HDTags']) { echo "<h3 class='error'>Error, you either do not have enough tags or did not fill out the form.</h3>"; echo "[url='tagtrader.php?spend=crystals']Back[/url]"; } else { $crysgain = $_POST['HDTags']*$set['tt_cryspertag']; mysql_query(sprintf("UPDATE `users` SET `HDTags` = `HDTags` - ('%d') WHERE `userid` = ('%u')", abs(@intval($_POST['HDTags'])), abs(@intval($userid)))) or die(mysql_query()); mysql_query(sprintf("UPDATE `users` SET `crystals` = `crystals` + ('%d') WHERE `userid` = ('%u')", abs(@intval($crysgain)), abs(@intval($userid)))) or die(mysql_error()); echo sprintf("<h3 class='success'> You traded %d Tags for %d Crystal(s).</h3>", abs(@intval($_POST['HDTags'])), abs(@intval($crysgain))); } } $h->endpage(); ?>
  14. Re: How to find cron info?   I didn't mean to sound like an idiot, if that's the way I came across. Sorry if I did offend you in any way.
  15. Re: Just an idea (Bodyguard Mod) Alright cool thanks. I will go about making it now :mrgreen:
  16. I was just thinking of this, and I understand this has been made before. But there would be a donator item, called bodyguard. There would bodyguard 1, 2 and 3. 1 protects you for 5 mins, 2 for 10 etc. I hear its already been made before, and was wondering if I should make it and put it up for free. Would it be ok for me to do this? Or if someone is offering it as a paid mod would I be making the wrong decision?
  17. Re: How to find cron info? No, as Magictallguy explained, open up config.php. The cron code will be in there. Follow the steps he gave you. He couldn't have explained it better. When you install the game it clearly says "Keep these crons safe" or something.
  18. Re: check these out LMFAO! Whoever did that is an absolute legend! Its bad I know, I just can't help but laugh lol.
  19. Faz`

    Heroes

    I know this has been a bit dead for a while, but I just can't seem to get enough of Heroes! Its absolutely great, its really getting more and more interesting every week! Anyone fans of this great series? Oh, and I have to say my favourite characters by far are Sylar and Hiro Nakamura.
  20. Re: [mccode v2] Tag Mod (Complete)   Thanks _SaMz_. I try, at least I think I do. Luckily I have a few awesome people to help me out when I am in difficulty. I suppose I'm learning, I'm not as good as some people, but I try. Thanks anyway for that comment.
  21. Re: check these out Are you saying you did all that work yourself?
  22. Re: [mccode v2] Tag Mod (Complete) Yeah, people could always use yours and change it a bit :P
  23. Re: [mccode v2] Tag Mod (Complete) Now make a file called tagtrader.php and add this code to it. <?php include "globals.php"; // Simply some CSS to make it look better. print <<<EOF1 <style type="text/css"> #tradelist li { list-style-type: none; padding-left: 5px; line-height: 2em; } .pertag { padding: 20px 0 10px 0; } .error { color: red; padding-bottom: 20px; } .success { color: green; } </style> EOF1; if(!isset($_GET['spend'])) { print <<<EOF2 <h2>Welcome to the HD Tag Trader</h2> <h4>You have [b]{$ir['HDTags']}[/b] HD Tags.</h4> <h4 style="padding-bottom:20px;">What would you like to spend your Tags on?</h4> <ul id="tradelist"> [*][url='tagtrader.php?spend=strength']Strength - {$set['tt_strengthpertag']} Strength Per Tag[/url] [*][url='tagtrader.php?spend=agility']Agility - {$set['tt_agilitypertag']} Agility Per Tag[/url] [*][url='tagtrader.php?spend=guard']Guard - {$set['tt_guardpertag']} Guard Per Tag[/url] [*][url='tagtrader.php?spend=labour']Labour - {$set['tt_labourpertag']} Labour Per Tag[/url] [*][url='tagtrader.php?spend=IQ']IQ - {$set['tt_IQpertag']} IQ per Tag[/url] [*][url='tagtrader.php?spend=crystals']Crystals - {$set['tt_cryspertag']} Crystal(s) per Tag[/url] [*][url='tagtrader.php?spend=money']Money - \${$set['tt_moneypertag']} per Tag[/url] [/list] EOF2; } elseif($_GET['spend'] == 'strength') { print <<<EOF3 <h4>Type in the amount of Tags you want to swap for Strength.</h4> <h4>You have [b]{$ir['HDTags']}[/b] Tags.</h4> <span class="pertag">One Tag = {$set['tt_strengthpertag']} Strength.</span> <form action='tagtrader.php?spend=strength2' method='post'> <input type='text' name='HDTags' /> <input type='submit' value='Swap' /> </form> EOF3; } elseif($_GET['spend'] == 'strength2') { if($_POST['HDTags'] <= 0 || $_POST['HDTags'] > $ir['HDTags']) { echo "<span class='error'>Error, you either do not have enough tags or did not fill out the form.</span>"; echo "[url='tagtrader.php?spend=strength']Back[/url]"; } else { $strengthgain = $_POST['HDTags']*$set['tt_strengthpertag']; $db->query("UPDATE users SET HDTags=HDTags-{$_POST['HDTags']} WHERE userid=$userid"); $db->query("UPDATE userstats SET strength=strength+$strengthgain WHERE userid=$userid"); echo "<span class='success'>You traded {$_POST['HDTags']} Tags for $strengthgain Strength."; } } elseif($_GET['spend'] == 'agility') { print <<<EOF4 <h4>Type in the amount of Tags you want to swap for Agility.</h4> <h4>You have [b]{$ir['HDTags']}[/b] Tags.</h4> <span class="pertag">One Tag = {$set['tt_agilitypertag']} Agility.</span> <form action='tagtrader.php?spend=agility2' method='post'> <input type='text' name='HDTags' /> <input type='submit' value='Swap' /> </form> EOF4; } elseif($_GET['spend'] == 'agility2') { if($_POST['HDTags'] <= 0 || $_POST['HDTags'] > $ir['HDTags']) { echo "<span class='error'>Error, you either do not have enough tags or did not fill out the form.</span>"; echo "[url='tagtrader.php?spend=agility']Back[/url]"; } else { $agilitygain = $_POST['HDTags']*$set['tt_agilitypertag']; $db->query("UPDATE users SET HDTags=HDTags-{$_POST['HDTags']} WHERE userid=$userid"); $db->query("UPDATE userstats SET agility=agility+$agilitygain WHERE userid=$userid"); echo "<span class='success'>You traded {$_POST['HDTags']} Tags for $agiltiygain Agility."; } } elseif($_GET['spend'] == 'guard') { print <<<EOF5 <h4>Type in the amount of Tags you want to swap for Guard.</h4> <h4>You have [b]{$ir['HDTags']}[/b] Tags.</h4> <span class="pertag">One Tag = {$set['tt_guardpertag']} Guard.</span> <form action='tagtrader.php?spend=guard2' method='post'> <input type='text' name='HDTags' /> <input type='submit' value='Swap' /> </form> EOF5; } elseif($_GET['spend'] == 'guard2') { if($_POST['HDTags'] <= 0 || $_POST['HDTags'] > $ir['HDTags']) { echo "<span class='error'>Error, you either do not have enough tags or did not fill out the form.</span>"; echo "[url='tagtrader.php?spend=guard']Back[/url]"; } else { $guardgain = $_POST['HDTags']*$set['tt_guardpertag']; $db->query("UPDATE users SET HDTags=HDTags-{$_POST['HDTags']} WHERE userid=$userid"); $db->query("UPDATE userstats SET guard=guard+$guardgain WHERE userid=$userid"); echo "<span class='success'>You traded {$_POST['HDTags']} Tags for $guardgain Guard."; } } elseif($_GET['spend'] == 'labour') { print <<<EOF6 <h4>Type in the amount of Tags you want to swap for Labour.</h4> <h4>You have [b]{$ir['HDTags']}[/b] Tags.</h4> <span class="pertag">One Tag = {$set['tt_labourpertag']} Labour.</span> <form action='tagtrader.php?spend=labour2' method='post'> <input type='text' name='HDTags' /> <input type='submit' value='Swap' /> </form> EOF6; } elseif($_GET['spend'] == 'labour2') { if($_POST['HDTags'] <= 0 || $_POST['HDTags'] > $ir['HDTags']) { echo "<span class='error'>Error, you either do not have enough tags or did not fill out the form.</span>"; echo "[url='tagtrader.php?spend=labour']Back[/url]"; } else { $labourgain = $_POST['HDTags']*$set['tt_labourpertag']; $db->query("UPDATE users SET HDTags=HDTags-{$_POST['HDTags']} WHERE userid=$userid"); $db->query("UPDATE userstats SET labour=labour+$labourgain WHERE userid=$userid"); echo "<span class='success'>You traded {$_POST['HDTags']} Tags for $labourgain Labour."; } } elseif($_GET['spend'] == 'IQ') { print <<<EOF7 <h4>Type in the amount of Tags you want to swap for IQ.</h4> <h4>You have [b]{$ir['HDTags']}[/b] Tags.</h4> <span class="pertag">One Tag = {$set['tt_IQpertag']} IQ.</span> <form action='tagtrader.php?spend=IQ2' method='post'> <input type='text' name='HDTags' /> <input type='submit' value='Swap' /> </form> EOF7; } elseif($_GET['spend'] == 'IQ2') { if($_POST['HDTags'] <= 0 || $_POST['HDTags'] > $ir['HDTags']) { echo "<span class='error'>Error, you either do not have enough tags or did not fill out the form.</span>"; echo "[url='tagtrader.php?spend=IQ']Back[/url]"; } else { $iqgain = $_POST['HDTags']*$set['tt_IQpertag']; $db->query("UPDATE users SET HDTags=HDTags-{$_POST['HDTags']} WHERE userid=$userid"); $db->query("UPDATE userstats SET iq=iq+$iqgain WHERE userid=$userid"); echo "<span class='success'>You traded {$_POST['HDTags']} Tags for $iqgain IQ."; } } elseif($_GET['spend'] == 'money') { print <<<EOF8 <h4>Type in the amount of Tags you want to swap for money.</h4> <h4>You have [b]{$ir['HDTags']}[/b] Tags.</h4> <span class="pertag">One Tag = \${$set['tt_moneypertag']} .</span> <form action='tagtrader.php?spend=money2' method='post'> <input type='text' name='HDTags' /> <input type='submit' value='Swap' /> </form> EOF8; } elseif($_GET['spend'] == 'money2') { if($_POST['HDTags'] <= 0 || $_POST['HDTags'] > $ir['HDTags']) { echo "<span class='error'>Error, you either do not have enough tags or did not fill out the form.</span>"; echo "[url='tagtrader.php?spend=money']Back[/url]"; } else { $moneygain = $_POST['HDTags']*$set['tt_moneypertag']; $db->query("UPDATE users SET HDTags=HDTags-{$_POST['HDTags']} WHERE userid=$userid"); $db->query("UPDATE users SET money=money+$moneygain WHERE userid=$userid"); echo "<span class='success'>You traded {$_POST['HDTags']} Tags for \$$moneygain."; } } elseif($_GET['spend'] == 'crystals') { print <<<EOF9 <h4>Type in the amount of Tags you want to swap for crystals.</h4> <h4>You have [b]{$ir['HDTags']}[/b] Tags.</h4> <span class="pertag">One Tag = {$set['tt_cryspertag']} Crystal(s).</span> <form action='tagtrader.php?spend=crystals2' method='post'> <input type='text' name='HDTags' /> <input type='submit' value='Swap' /> </form> EOF9; } elseif($_GET['spend'] == 'crystals2') { if($_POST['HDTags'] <= 0 || $_POST['HDTags'] > $ir['HDTags']) { echo "<span class='error'>Error, you either do not have enough tags or did not fill out the form.</span>"; echo "[url='tagtrader.php?spend=crystals']Back[/url]"; } else { $crysgain = $_POST['HDTags']*$set['tt_cryspertag']; $db->query("UPDATE users SET HDTags=HDTags-{$_POST['HDTags']} WHERE userid=$userid"); $db->query("UPDATE users SET crystals=crystals+$crysgain WHERE userid=$userid"); echo "<span class='success'>You traded {$_POST['HDTags']} Tags for $crysgain Crystal(s)."; } } $h->endpage(); ?>   Now make one called tagmarket.php and add this <?php include "globals.php"; if ($ir['hospital'] > 0 || $ir['jail'] > 0) { die("You cannot view this page while you are in hospital / jail."); } print "<h3>Tag Market</h3>"; switch($_GET['action']) { case "buy": tag_buy(); break; case "remove": tag_remove(); break; case "add": tag_add(); break; default: tmarket_index(); break; } function tmarket_index() { global $db,$ir,$c,$userid,$h; print "[url='tagmarket.php?action=add']> Add A Listing[/url] Viewing all listings... <table width=75% cellspacing=1 class='table'> <tr style='background:gray'> <th>Adder</th> <th>Qty</th> <th>Price each</th> <th>Price total</th> <th>Links</th> </tr>"; $q=$db->query("SELECT tm.*, u.* FROM tagmarket tm LEFT JOIN users u ON u.userid=tm.tmADDER ORDER BY tmPRICE/tmQTY ASC"); while($r=$db->fetch_row($q)) { if($r['tmADDER'] == $userid) { $link = "[url='tagmarket.php?action=remove&ID={$r[']Remove[/url]"; } else { $link = "[url='tagmarket.php?action=buy&ID={$r[']Buy[/url]"; } $each= (int) $r['tmPRICE'] / $r['tmQTY']; print "\n<tr> <td>[url='viewuser.php?u={$r[']{$r['username']}[/url] [{$r['userid']}]</td> <td>{$r['tmQTY']}</td> <td> \$" . number_format($each)."</td> <td>\$".number_format($r['tmPRICE'])."</td> <td>[$link]</td> </tr>"; } print "</table>"; } function tag_remove() { global $db,$ir,$c,$userid,$h; $q=$db->query("SELECT * FROM tagmarket WHERE tmID={$_GET['ID']} AND tmADDER=$userid"); if(!$db->num_rows($q)) { print "Error, either these tags do not exist, or you are not the owner. [url='tagmarket.php']> Back[/url]"; $h->endpage(); exit; } $r=$db->fetch_row($q); $remove = sprintf("UPDATE users SET HDTags = HDTags - '%u' WHERE userid = '%u' ", ($r['tmQTY']), ($userid)); mysql_query($remove); $db->query("UPDATE users SET HDTags=HDTags+{$r['tmQTY']} where userid=$userid"); $db->query("DELETE FROM tagmarket WHERE tmID={$_GET['ID']}"); print "Tags removed from market! [url='tagmarket.php']> Back[/url]"; } function tag_buy() { global $db,$ir,$c,$userid,$h; $q=$db->query("SELECT * FROM tagmarket cm WHERE tmID={$_GET['ID']}"); if(!$db->num_rows($q)) { print "Error, either these Tags do not exist, or they have already been bought. [url='tagmarket.php']> Back[/url]"; $h->endpage(); exit; } $r=$db->fetch_row($q); if($r['tmPRICE'] > $ir['money']) { print "Error, you do not have the funds to buy these Tags. [url='tagmarket.php']> Back[/url]"; $h->endpage(); exit; } $db->query("UPDATE users SET HDTags=HDTags+{$r['tmQTY']} where userid=$userid"); $db->query("DELETE FROM tagmarket WHERE tmID={$_GET['ID']}"); $db->query("UPDATE users SET money=money-{$r['tmPRICE']} where userid=$userid"); $db->query("UPDATE users SET money=money+{$r['tmPRICE']} where userid={$r['tmADDER']}"); $bought = sprintf("UPDATE users SET HDTags = HDTags - '%u' WHERE userid = '%u' ", ($r['tmQTY']), ($r['tmADDER'])); mysql_query($bought); event_add($r['tmADDER'],"[url='viewuser.php?u=$userid']{$ir['username']}[/url] bought your {$r['tmQTY']} Tags from the market for \$".number_format($r['tmPRICE']).".",$c); print "You bought the {$r['tmQTY']} Tags from the market for \$".number_format($r['tmPRICE'])."."; } function tag_add() { global $db,$ir,$c,$userid,$h; $_POST['amnt'] = abs((int) $_POST['amnt']); $_POST['price'] = abs((int) $_POST['price']); if($_POST['amnt']) { if($_POST['amnt'] > $ir['HDTags']) { die ("You are trying to add more Tags to the market than you have."); } if($_POST['amnt'] + $ir['cry'] > 1000) //Change the 10 to what you want. { echo "You can not have more than 1000 Tags on market at a time [url='tagmarket.php']> Back[/url]"; $h->endpage(); exit; } $check = sprintf("SELECT tmID FROM tagmarket WHERE tmADDER = '%u' ", ($userid)); $docheck = mysql_query($check); if(mysql_num_rows($docheck) >= 2) { echo "You can only have 2 differnt post at a time. [url='tagmarket.php']> Go Back[/url]"; $h->endpage(); exit; } $tp=$_POST['amnt']*$_POST['price']; $db->query("INSERT INTO tagmarket VALUES('',{$_POST['amnt']},$userid,$tp)"); $db->query("UPDATE users SET HDTags=HDTags-{$_POST['amnt']} WHERE userid=$userid"); $adding = sprintf("UPDATE users SET cry = cry + '%u' WHERE userid = '%u' ", ($_POST['amnt']), ($userid)); mysql_query($adding); print "Tags added to market! [url='tagmarket.php']> Back[/url]"; } else { print "[b]Adding a listing...[/b] You have [b]{$ir['HDTags']}[/b] crystal(s) that you can add to the market.<form action='tagmarket.php?action=add' method='post'><table width=50% border=2><tr> <td>Tags:</td> <td><input type='text' name='amnt' value='{$ir['HDTags']}' /></td></tr><tr> <td>Price Each:</td> <td><input type='text' name='price' value='200' /></td></tr><tr> <td colspan=2 align=center><input type='submit' value='Add To Market' /></tr></table></form>"; } } $h->endpage(); ?>   Now open up header.php and underneath the voting links, add: $tag=mt_rand(1,1000000); if ($tag==1000 or $tag==7500 or $tag==25000 or $tag==100000 or $tag==250000 or $tag==500000 or $tag==750000 or $tag==1000000) { mysql_query ("UPDATE users SET HDTags=HDTags+1 WHERE userid={$ir['userid']}"); print "<h3>You stumble across a HDTag! You pick it up and carry on with what you were doing.</h3>"; }   Thats it, credits to BlueDevil23 who taught me loads whilst in the process of making this, such as how to write proper HTML etc. Its not as easy as you think :P.Thanks to Templar also for helping me out with an error also. Thank you and hope you enjoy the mod
  24. Ok I've finally got it finished. You may have seen from another topic I made that I posted info about it. It is a tag mod, you are playing the game and you randomly get a tag. You can trade tags for different things and also sell them on a market.I hope you enjoy it. I couldn't do the tag market from scratch, sorry. So I took the crystal market and changed the values and stuff. Its not secure, I tell you that now. I'm currently reading up on security and will learn how to secure queries etc. Once I have done a secure market, I'll post it. Run this SQL: UPDATE `users` ADD `HDTags` BIGINT(50) NOT NULL default '0';   I am not sure how to write the SQL for this one, but go into your database. There are features there that allow you to create rows. Its pretty simple.. In the table `settings` create 7 rows. tt_strengthpertag tt_agilitypertag tt_moneypertag tt_cryspertag tt_guardpertag tt_labourpertag tt_IQpertag. Now open up staff.php. Find: Money per crystal: <input type='text' name='ct_moneypercrys' value='{$set['ct_moneypercrys']}' />   Underneath it add: Strength per Tag: <input type='text' name='tt_strengthpertag' value='{$set['tt_strengthpertag']}' /> Agility per Tag: <input type='text' name='tt_agilitypertag' value='{$set['tt_agilitypertag']}' /> Guard per Tag: <input type='text' name='tt_guardpertag' value='{$set['tt_guardpertag']}' /> Labour per Tag: <input type='text' name='tt_labourpertag' value='{$set['tt_labourpertag']}' /> IQ per Tag: <input type='text' name='tt_IQpertag' value='{$set['tt_IQpertag']}' /> Crystal(s) per Tag: <input type='text' name='tt_cryspertag' value='{$set['tt_cryspertag']}' /> Money per Tag: <input type='text' name='tt_moneypertag' value='{$set['tt_moneypertag']}' /> That allows you to set the price and values gained at the tag trader. The tag market SQL: CREATE TABLE `tagmarket` ( `tmID` int(11) NOT NULL AUTO_INCREMENT, `tmQTY` int(11) NOT NULL default '0', `tmADDER` int(11) NOT NULL default '0', `tmPRICE` int(11) NOT NULL default '0' )
  25. Re: Fearless-Dojo   LMAO!
×
×
  • Create New...