Jump to content
MakeWebGames

War_Hero

Members
  • Posts

    232
  • Joined

  • Last visited

Everything posted by War_Hero

  1. Re: [mccode] Mood Mod Post your preferences.php here so we can take a look at it. Or post line 277 and the surrounding lines, which ever one you fancy. :)
  2. Re: [mccode v2] Ian's Investments Thank you and glad you like it. :)
  3. Re: [mccode v2] Games Centre   Thank you. :-D I try my best to make other users happy. :)
  4. Re: [mccode v2] Games Centre Thank you all for the positive comments. And thank you shaved92bravada for the screen shots. I forgot about them. :-P If you want to request games, please post them with a short description of how to play and I'll see if I can add it, then update the script in my first post. :)
  5. Hi all! I see loads of mods on here that give out money by only clicking on a link. So, I decided to create a fun kind of way to get money by playing different kind of games. Name: Games Centre Description: The user can gain money (the amount can easily be changed) by playing games. The games included are Splat, Stratego and Kerplunk. Each game is different and each game gives out a different amount of money, if they win or make a good move. There's a maximum number of turns that the user has for each game (again, very easy to change this amount). Right, now for installation: Step 1: Run this SQL in PHPMYADMIN ALTER TABLE `users` ADD `splatturns` INT(11) NOT NULL DEFAULT '0', ADD `strategoturns` INT(11) NOT NULL DEFAULT '0', ADD `kerplunkturns` INT(11) NOT NULL DEFAULT '0';   Step 2: Add these crons into cron_day.php or where ever you want: $db->query("UPDATE users SET splatturns = 0"); $db->query("UPDATE users SET strategoturns = 0"); $db->query("UPDATE users SET kerplunkturns = 0");   Step 3: Then create the file called games.php and paste this into it: <?php include "globals.php"; if($ir['jail'] OR $ir['hospital']) { die("<font color = 'red' /><b />You can't access this page when in jail or hospital.[/b]</font>"); } switch($_GET['action']) { case 'splat': splat(); break; case 'splatgo': splat_go(); break; case 'stratego': stratego(); break; case 'strategogo': stratego_go(); break; case 'kerplunk': kerplunk(); break; case 'kerplunkgo': kerplunk_go(); break; case 'kerplunkrisk': kerplunk_risk(); break; default: index(); break; } function index() { global $db,$ir,$userid; print "<h2 />The Games Centre</h2> Welcome to the games centre. Here you can play 3 different games: <font color = 'pink' />Splat, Stratego and Kerplunk</font>. Which game would you like to play? <form action = 'games.php?action=splat' method = 'post' /> <input type = 'submit' value = 'Splat' /> </form> <form action = 'games.php?action=stratego' method = 'post' /> <input type = 'submit' value = 'Stratego' /> </form> <form action = 'games.php?action=kerplunk' method = 'post' /> <input type = 'submit' value = 'Kerplunk' /> </form> Or, if you don't want to play, you can <a href = 'index.php' />go home</a>."; } function splat() { global $db,$ir,$userid; $splatturns = 15; //** Change this to how many Splat turns you want the user to have **// $turnsleft = $splatturns - ($ir['splatturns']); if($ir['splatturns'] == $splatturns) { die("You've already used your turns for Splat. Do you want to <a href = 'games.php' />play another game</a>?"); } else { print "<h2 />Playing Splat</h2> You're currently playing Splat. You currently have $turnsleft turns left. <form action = 'games.php?action=splatgo' method = 'post' /> <input type = 'submit' value = 'Have Your Go' /> </form> <form action = 'games.php' method = 'post' /> <input type = 'submit' value = 'Play Another Game' /> </form>"; } } function splat_go() { global $db,$ir,$userid; $splatturns = 15; //** Change this to how many Splat turns you want the user to have **// $chance = rand(10,400); //** Change these forumalae to suit you **// $splatted = 275; $splatbug = 75; $smallmon = rand(200000,475000); //** Change this to the amount of money you want the user to get if they splat another bug **// $neededturns = 14; //** Change this to the number of turns needed to win the game **// $win1 = 10; $win2 = 45; $winnings = rand(2000000,3500000); //** Change this to the winnings you want the user to be given if they win **// print "<font color = 'blue' />Turns used: {$ir['splatturns']}</font> "; if($ir['splatturns'] == $splatturns) { die("You've already used your turns for Splat. Do you want to <a href = 'games.php' />play another game</a>?"); } elseif($chance >= $splatted) { print "Unfortunetly your bug was splatted. You need to make another bug. Click <a href = 'games.php?action=splatgo' />here</a> to make another bug and have another go. Or click <a href = 'games.php' />here</a> to play another game."; $splatsql1 = sprintf("UPDATE `users` SET `splatturns` = `splatturns` + '%d', `will` = `will` - '%d' WHERE `userid` = ('%u')", 1, 5, $userid); $db->query($splatsql1); } elseif($chance >= $splatbug) { print "You splatted another bug! You got $t".money_formatter($smallmon)." and you're also in the lead! <a href = 'games.php?action=splatgo' />Have another turn?</a> Or <a href = 'games.php' />play another game</a>."; $splatsql2 = sprintf("UPDATE `users` SET `splatturns` = `splatturns` + '%d', `money` = `money` + '%d' WHERE `userid` = ('%u')", 1, $smallmon, $userid); $db->query($splatsql2); } elseif(($ir['splatturns'] == 14) AND ($chance >= $win) AND ($chance <= $win2)) { print "Congratulations! You won the game of Splat! As a winning present, you are given $t".money_formatter($winnings).". Enjoy! Would you like to play another game? <form action = 'games.php' method = 'post' /> <input type = 'submit' value = 'Yes' /> </form> <form action = 'index.php' method = 'post' /> <input type = 'submit' value = 'No' /> </form>"; $splatsql3 = sprintf("UPDATE `users` SET `money` = `money` + '%d', `splatturns` = `splatturns` + '%d' WHERE `userid` = ('%u')", $winnings, 1, $userid); $db->query($splatsql3); } else { print "You take your turn and move forward a few places, but that's it. <a href = 'games.php?action=splatgo' />Have another turn?</a> Or <a href = 'games.php' />play a different game</a>."; $splatsql4 = sprintf("UPDATE `users` SET `splatturns` = `splatturns` + '%d' WHERE `userid` = ('%u')", 1, $userid); $db->query($splatsql4); } } function stratego() { global $db,$ir,$userid; $_POST['guess'] = abs((int) $_POST['guess']); $strategoturns = 5; //** Change this to how many Stratego turns you want the user to have **// print "<font color = 'blue' />Guesses: {$ir['strategoturns']}</font> "; if($ir['strategoturns'] == $strategoturns) { die("You've already used all of your Stratego guesses. What would you like to do? <a href = 'games.php' />Play another game</a> or <a href = 'index.php' /> go home</a>?"); } else { print "<h2 />Playing Stratego</h2> You're currently playing Stratego. The object of this game is to guess where the Flag is. The flag is going to be in a position between 0 and 15. <font color = 'red' />You will only have $strategoturns guesses.</font> <form action = 'games.php?action=strategogo' method = 'post' /> <input type = 'text' value = '' name = 'guess' /> <input type = 'submit' value = 'Have a Guess' /> </form>"; } } function stratego_go() { global $db,$ir,$userid; $_POST['guess'] = abs((int) $_POST['guess']); $strategoturns = 5; //** Change this to how many Stratego turns you want the user to have **// $position = rand(0,15); //** Change these numbers to what you want **// $position2 = $position; $max = 15; //** Change this number to the highest number the user can guess **// $swin = rand(60000000,75000000); //** Change these numbers to what you want the winnings to be **// print "<font color = 'blue' />Guesses: {$ir['strategoturns']}</font> "; if($ir['strategoturns'] == $strategoturns) { die("You've already used all of your Stratego guesses. <a href = 'games.php' />Play another game?</a>"); } elseif($_POST['guess'] < 0) { die("The guess must be positive! <a href = 'games.php?action=stratego' />Try again</a>."); } elseif($_POST['guess'] > $max) { die("The guess must be between 0 and $max. <a href = 'games.php?action=stratego' />Try again</a>."); } elseif($_POST['guess'] == $position2) { print "Congratulations! You found the Flag! You receive $t".money_formatter($swin)." for finding it. Click <a href = 'games.php?action=stratego' />here</a> to guess again."; $strategosql = sprintf("UPDATE `users` SET `money` = `money` + '%d', `strategoturns` = `strategoturns` + '%d' WHERE `userid` = ('%u')", $swin, 1, $userid); $db->query($strategosql); } else { print "Sorry. That is not the area where the Flag is hidden. <a href = 'games.php?action=stratego' />Try again</a> or <a href = 'games.php' />play another game</a>?"; $strategosql2 = sprintf("UPDATE `users` SET `strategoturns` = `strategoturns` + '%d' WHERE `userid` = ('%u')", 1, $userid); $db->query($strategosql2); } } function kerplunk() { global $db,$ir,$userid; $kerplunkturns = 10; //** Change this to how many Kerplunk turns you want the user to have **// print "<font color = 'blue' />Turns Used: {$ir['kerplunkturns']}</font> "; if($ir['kerplunkturns'] == $kerplunkturns) { die("You've already used all of your turns for Kerplunk. <a href = 'games.php' />Play another game</a>?"); } else { print "<h2 />Playing Kerplunk</h2> You're currently playing Kerplunk. What would you like to do? <form action = 'games.php?action=kerplunkgo' method = 'post' /> <input type = 'submit' value = 'Be Safe' /> </form> OR <form action = 'games.php?action=kerplunkrisk' method = 'post' /> <input type = 'submit' value = 'Be Risky' /> </form>"; } } function kerplunk_go() { global $db,$ir,$userid; $kerplunkturns = 10; //** Change this to how many Kerplunk turns you want the user to have **// $kerchance = rand(50,200); //** Change these numbers to suit your liking **// $kerwin = 140; //** Change this number to the number you want to determine the chance of winning **// $kerlose = 50; //** Change this number to the number you want to determine the chance of losing **// $kermon = rand(75000,140000); //** Change these numbers to the amount you want the user to get if they 'win' **// print "<font color = 'blue' />Turns Used: {$ir['kerplunkturns']}</font> "; if($ir['kerplunkturns'] == $kerplunkturns) { die("You've already used all of your turns for Kerplunk. <a href = 'games.php' />Play another game</a>?"); } if($kerchance >= $kerwin) { print "You pulled out a rod with out any marbles falling. You earned $t".money_formatter($kermon)."! <a href = 'games.php?action=kerplunkgo' />Try again</a> or <a href = 'games.php?action=kerplunkrisk' />be risky</a> or <a href = 'games.php' />play another game</a>."; $kerplunksql = sprintf("UPDATE `users` SET `money` = `money` + '%d', `kerplunkturns` = `kerplunkturns` + '%d' WHERE `userid` = ('%u')", $kermon, 1, $userid); $db->query($kerplunksql); } elseif($kerchance >= $kerlose) { print "You pulled out a rod but a few marbles fell. Unlucky! <a href = 'games.php?action=kerplunkgo' />Try again</a> or <a href = 'games.php?action=kerplunkrisk' />be risky</a> or <a href = 'games.php' />play another game</a>."; $kerplunksql2 = sprintf("UPDATE `users` SET `kerplunkturns` = `kerplunkturns` + '%d' WHERE `userid` = ('%u')", 1, $userid); $db->query($kerplunksql2); } } function kerplunk_risk() { global $db,$ir,$userid; $kerplunkturns = 10; //** Change this to how many Kerplunk turns you want the user to have **// $riskchance = rand(15,200); //** Change these numbers to suit your liking **// $riskwin = 35; //** Change this number to determine the chance of success **// $risklose = 36; //** Change this number to determine the chance of failure **// $riskmon = rand(3000000,3500000); //** Change these numbers to suit your liking for the winnings **// print "<font color = 'blue' />Turns Used: {$ir['kerplunkturns']}</font> "; if($ir['kerplunkturns'] == $kerplunkturns) { die("You've already used your turns for Kerplunk. <a href = 'games.php' />Play another game</a>?"); } elseif($riskchance <= $riskwin) { print "You decide to be risky and pull out a rather stuck rod. You successfully pull it out with out causing any of the marble to fall. You earn $t".money_formatter($riskmon)."! Either <a href = 'games.php?action=kerplunkrisk' />be risky again</a> or <a href = 'games.php?action=kerplunkgo' />be safe</a> or <a href = 'games.php' />play another game</a>."; $kerplunkrisk = sprintf("UPDATE `users` SET `money` = `money` + '%d', `kerplunkturns` = `kerplunkturns` + '%d' WHERE `userid` = ('%u')", $riskmon, 1, $userid); $db->query($kerplunkrisk); } elseif($riskchance >= $risklose) { print "You decide to be risky and pull out a rather stuck rod. Unfortunetly, you cause all of the marbles to fall. Unlucky! Either <a href = 'games.php?action=kerplunkrisk' />be risky again</a> or <a href = 'games.php?action=kerplunkgo' />be safe</a> or <a href = 'games.php' />play another game</a>."; $kerplunkrisk2 = sprintf("UPDATE `users` SET `kerplunkturns` = `kerplunkturns` + '%d' WHERE `userid` = ('%u')", 1, $userid); $db->query($kerplunkrisk2); } } $h->endpage(); ?>   Step 4: Add this link: <a href = 'games.php' />Games Centre</a> anywhere so the users can access the Games Centre.   You may have to change the ? signs into $ signs if your game doesn't use ?s. I've added in comments next to all of the equations/formulas so you know what to edit if you want to change any of the winnings or chances of winning, etc. I've tested this and it works, but if you find any errors, please post them and I will fix them as soon as possible. And if you don't mind, please give me +1 if you like this or if you use this mod. It's not much, just a more fun way of getting money, etc. I might update it when I have the time so games can be added via the staff panel. ;) Hope you enjoy. :)
  6. Re: Error. Please help! Right...I think I understand you. :) So, what would be classed as valid? I don't understand why the part of my script that's causing the error is invalid, as I've used similar code in other scripts and they've worked fine. :? Thank you...for helping me. It's improving my knowledge and understanding. :)
  7. Hi all. I'm getting an error with one of my scripts...but the error doesn't seem to be within my actual script. Here's the error I'm getting: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /usr/home/*********/domains/*******/public_html/class/class_db_mysql.php on line 71 Now, the script I'm working on is called researchfund.php. I'll post the part of code that I'm working on that produces the error:   function med_create1() { global $db,$ir,$userid; $select = ("SELECT * FROM `research_inv`"); $qselect = $db->query($select); $rowselect = $db->fetch_row($qselect); $_GET['ID'] = abs((int) $_GET['ID']); $q = ("SELECT * FROM `items` WHERE `itmid` = {$_GET['ID']}"); $itemd = $db->fetch_row($q); if($rowselect['r_invitemID'] != 96 AND $rowselect['r_invitemID'] != 97) { die("You don't have all of the materials needed to create this medicine. <a href = 'researchfund.php' />Go Back</a>"); } else { print "You have produced a large stash of Medicine 1. You can now distribute it around the community. <a href = 'researchfund.php' />Go Back</a>"; $med1 = sprintf("DELETE * FROM `research_inv` WHERE `r_invitemID` = '%d' AND `r_invitemID` = '%d'", 96, 97); $db->query($med1); $med1a = sprintf("INSERT INTO `research_inv` (r_invID, r_invitemID, r_invitemNAME, r_invitemPRICE) VALUES (%d, %d, %d, %d)", '', 102, $itemd['itmname'], $itemd['itmprice']); $db->query($med1a); } }   Can anyone explain to me about why I'm getting this error and how to fix it? :) Any help will be highly appreciated. :)
  8. Re: Ruby Bank [Free] Here it is for V1. This is my first V2 -->> V1 conversion, so it may not work! :-P   <?php require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.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); check_level(); $fm=money_formatter($ir['money']); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm); $h->menuarea(); print "<h3>Bank</h3>"; if($ir['rubybank']>-1) { switch($_GET['action']) { case "deposit": deposit(); break; case "withdraw": withdraw(); break; default: index(); break; } } else { if(isset($_GET['buy'])) { if($ir['money']>25000) { print "Congratulations, you bought a Ruby bank account for \$25,000! [url='rbank.php']Start using my account[/url]"; mysql_query("UPDATE users SET money=money-25000,rubybank=0 WHERE userid=$userid"); } else { print "You do not have enough Money to open an account. [url='explore.php']Back to town...[/url]"; } } else { print "Open a Ruby bank account today, just \$25,000! [url='rbank.php?buy']> Yes, sign me up![/url]"; } } function index() { global $db, $ir,$c,$userid,$h; print "\n[b]You currently have {$ir['rubybank']} Ruby in the bank.[/b] <table width='75%' cellspacing=1 class='table'> <tr> <td width='50%'>[b]Deposit ruby[/b] <form action='rbank.php?action=deposit' method='post'> Amount: <input type='text' name='deposit' value='{$ir['ruby']}' /> <input type='submit' value='Deposit' /></form></td> <td> [b]Withdraw ruby[/b] There is no fee on withdrawals.<form action='rbank.php?action=withdraw' method='post'> Amount: <input type='text' name='withdraw' value='{$ir['rubybank']}' /> <input type='submit' value='Withdraw' /></form></td> </tr> </table>"; } function deposit() { global $db,$ir,$c,$userid,$h; $_POST['deposit']=abs((int) $_POST['deposit']); if($_POST['deposit'] > $ir['ruby']) { print "You do not have enough ruby to deposit this amount."; } else { $gain=$_POST['deposit']-$fee; $ir['ruby']+=$gain; mysql_query("UPDATE users SET rubybank=rubybank+$gain, ruby=ruby-{$_POST['deposit']} where userid=$userid"); print "You hand over {$_POST['deposit']} to be deposited, $gain is added to your account. [b]You now have {$ir['rubybank']} in the bank.[/b] [url='rbank.php']> Back[/url]"; } } function withdraw() { global $db,$ir,$c,$userid,$h; $_POST['withdraw']=abs((int) $_POST['withdraw']); if($_POST['withdraw'] > $ir['rubybank']) { print "You do not have enough banked ruby to withdraw this amount."; } else { $gain=$_POST['withdraw']; $ir['rubybank']-=$gain; mysql_query("UPDATE users SET rubybank=rubybank-$gain, ruby=ruby+$gain where userid=$userid"); print "You ask to withdraw $gain, the banking lady grudgingly hands it over. [b]You now have {$ir['rubybank']} in the bank.[/b] [url='rbank.php']> Back[/url]"; } } $h->endpage(); ?>
  9. Re: The Standards of CE Mod! It means a lot to me for my name to be on the list. :) I totally agree with having an option to approve topics and an option to delete topics. I've not been here long, but I've seen so many topics that are basically the same: a small little mod that gives the user a random amount of money, etc. I understand that everyone has to start off low, so maybe there could be a board so users new to PHP could post their new mods on that board, then, if it is approved by the people on the list, it would be moved to the Free Game Modifications. Just an idea. :) But as I say, I don't have a huge say in this as I'm still relatively new here. ;)
  10. Re: [FREE][V2] Club Mod (my version)   No, it's supposed to be like that. ;)
  11. Re: Burn House for V2   Thank you. :D I'm currently improving my security skills a bit so I haven't had the time to create another mod. :-P But I hope to get another one done soon....ish. :)
  12. Re: $_POST Help Needed Hi again. :) I've tried editing my code so the user has to have a text answer to get a clue, but it doesn't work. I don't get any error with it though. This is the small bit I've edited:   function clue2() { global $db,$ir,$c,$h,$userid; $_POST['ans1'] = isset($_POST['ans1']) ? abs(@intval($_POST['ans1'])) : 0; $_POST['ans2'] = isset($_POST['ans2']) ? abs(@intval($_POST['ans2'])) : 0 && $_POST['ans2'] = strip_tags($_POST['ans2']); $_POST['ans3'] = isset($_POST['ans3']) ? abs(@intval($_POST['ans3'])) : 0; $regexp = "^[M-O]$"; $answer2 = $regexp; //**Answer to the second clue goes here**// if($ir['clue'] != 1) { die("Either you've had this clue before or you haven't figured out the clue before this. <a href = 'clues.php' />Go Back</a>"); } elseif(!is_int($_POST['ans2'])) { die("The answer is not a number! Please <a href = 'clues.php' />try again.</a>."); } elseif(!ereg($regexp,$_POST['ans2'])) { die("Sorry. That was not the correct answer. Please <a href = 'clues.php' />try again</a>."); } else { print "Well done! That is the correct answer. Your second clue to the hidden link: <font color = 'blue' /><i />If you live a life of crime and sin, you will spend the rest of eternity in the firey depths of the underworld.[/i]</font> <br / > <a href = 'clues.php' />Have another clue</a> or <a href = 'index.php' />return home</a>."; $sql1 = sprintf("UPDATE `users` SET `clue` = '%d' WHERE `userid` = ('%u')", 2, $userid); $db->query($sql1); } }   I've tried using a few new things (new to me, that is). So I've probably cocked everything up. :-P I'm not sure why it isn't working, so any help would be highly appreciated. :)
  13. Re: $_POST Help Needed Ah right. Thank you killah. I'll take a look at that. :)   Right. I'm really pleased but also rather pissed off. The reason why it wasn't working was because of the names of my $_POSTs. I had clue1, clue2 and clue3 as the names of my $_POSTs and my functions/cases. So, I'm guessing that was the reason why it didn't work. I just changed the names of the $_POSTs and it worked. That's why I'm a little p-eed off, as it was such a simple error. :-P lol Now to try it with a text answer. I'm not too sure how that will go though. :-P   Thank you all for helping me out. I may need some help with the text answers if I can't get it to work. Thanks again,
  14. Re: $_POST Help Needed Agh. I accidently put that $ir[ bit in. I actually have: elseif($_POST['clue1'] == $answer) etc. Yet is still doesn't work. :( Hmm...confusing me.   Sessions? I'm not sure how to 'work' them. :-P lol
  15. Re: $_POST Help Needed Ah right, thank you. :) Hmm. I don't think the section about the clue being displayed was very clear in my first post. :-P lol   I'll explain my mod a little more: The clues page will ask the user a question. If the user gets the question right, a clue to a hidden link will be given, but if they do not get it right, they will have to try again. Therefore, the $_POST['clue1'] is the user's answer to the question. This part of my code: if($ir[$_POST['clue1'] == $answer) { print "Correct answer!"; $sql = 'my queries' } doesn't work, because even if they do enter the right answer, it still says it's wrong. In this case, $answer = 648;. I'm not sure as to how to fix that bit, so that when the user enters the correct answer, it will output the correct text.   I hope that that clears it up a little bit. :)
  16. Re: $_POST Help Needed Ohhh. Thank you. Security is one of my biggest issues. I usually just use $_POST['clue1'] = abs((int) $_POST['clue1']; to secure my $_POST's.   Now that I've sorted that bit out, how would I fix my mod so that it will give out the clue if the user gets the answer right? :)   Thank you for helping me with the first bit. Just a small question: is $_POST['clue1'] = abs((int) $_POST['clue1']; enough to secure the $_POST's or would what you did: $_POST['clue1'] = isset($_POST['clue1']) ? abs(@intval($_POST['clue1'])) : 0; be a lot better? :) Thanks again,
  17. Hi all. :) I'm having a little trouble with a mod I'm making with my brother. The mod asks the user a question and the user is asked to submit an answer. However, when the user enters the correct answer, it doesn't give them what they're supposed to get. :? I've tried all sorts of things to try and get it to work, but I can't seem to do it.   Also, at the moment the mod requires the user to input a number answer, but I'd like them to input a text answer for two of the questions. But, I'm not sure how to secure the $_POST from SQL injections and all if the form requires a text answer. This is one of my functions: function index() { global $db,$ir,$c,$h,$userid; $_POST['clue1'] = abs((int) $_POST['clue1']) && $_POST['clue1'] = isset($_POST['clue1']); $_POST['clue2'] = abs((int) $_POST['clue2']) && $_POST['clue2'] = isset($_POST['clue2']); $_POST['clue3'] = abs((int) $_POST['clue3']) && $_POST['clue3'] = isset($_POST['clue3']); print "Congratulations. You found the clues page. Here, you can find out clues to what the URL is for the Hidden Link. There will be 3 clues. You will have to answer the riddles correctly, however, to receive a clue. "; if($ir['clue'] == 0) { print "Here is your first question/riddle. <table width = '45%' cellspacing = '1' class = 'table' /> <tr /> <th />Time</th> <th />Frequency</th> <th />Cumulative Frequency</th> </tr> <tr /> <td />0 <= t < 2</td> <td />8</td> <td />8</td> </tr> <tr /> <td />2 <= t < 4</td> <td />14</td> <td />22</td> </tr> <tr /> <td />4 <= t < 6</td> <td />23</td> <td />45</td> </tr> <tr /> <td />6 <= t < 8</td> <td />35</td> <td />80</td> </tr> <tr /> <td />8 <= t < 10</td> <td />20</td> <td />100</td> </tr> <tr /> <td />10 <= t < 12</td> <td />4</td> <td />104</td> </tr> <tr /> <td /> </td> <td /> <b />104[/b] </td> <td /> </td> </tr> </table> From this table, work out the <b /><font color = 'blue' />Median, Upper Quartile and Lower Quartile</font>[/b]. Once you find the answers to each, combine them and that will be your final answer. <i /><font color = 'green' />For Example: If the Median was 6.7, it would be rounded up to 7. If the UQ was 9.4, it would be rounded down to 9, and if the LQ was 4.65, it would be rounded up to 5. Therefore, the answer would be <u />795</u>.</font>[/i]. <form action = 'clues.php?action=clue1' method = 'post' /> Your Final Answer: <input type = 'text' name = 'clue1' value = '' /> <input type = 'submit' value = 'Submit Answer' /> </form>"; }   and the clue function to go with it:   function clue1() { global $db,$ir,$c,$h,$userid; $_POST['clue1'] = abs((int) $_POST['clue1']) && $_POST['clue1'] = isset($_POST['clue1']); $_POST['clue2'] = abs((int) $_POST['clue2']) && $_POST['clue2'] = isset($_POST['clue2']); $_POST['clue3'] = abs((int) $_POST['clue3']) && $_POST['clue3'] = isset($_POST['clue3']); $answer1 = 648; //**Answer to first clue goes here**// if($ir['clue'] != 0) { die("Either you've had this clue before or haven't figured out the clue before this. <a href = 'clues.php' />Go Back</a>"); } elseif($_POST['clue1'] != $answer) { die("Sorry. That is not the correct answer. Please <a href = 'clues.php' />try again</a>."); } elseif($_POST['clue1'] == $answer) { print "Well done! That is the correct answer. Your first clue to the hidden link: <font color = 'blue' /><i />You see the light and start walking towards it. When you arrive, you see the Golden Gates, and beyond them two beautiful angels. Where are you? (The first part of the URL)[/i]</font>"; $sql = sprintf("UPDATE `users` SET `clue` = '%d' WHERE `userid` = ('%u')", 1, $userid); $db->query($sql); } }   Is anyone able to help? All help will be highly appreciated. :) Cheers,
  18. Re: Warning Thanks for the warning. :) I'll be checking the IPs occasionally now, just to see if someone signs up with that IP.
  19. Re: [FREE][V2] Club Mod (my version) Have you edited any of the scripts? Because it works fine for me. :-P Post what you've got, if you've edited, and we'll have a look at it. :)
  20. Re: Cookie Shop My Second MOD!! WOOT You're doing well for a beginner. Keep up the good work. :) One of your other errors was in the query. You got the first bit right: $db-> but forgot the other bit: query. An example of query: $db->query("UPDATE `users` SET `blah` = 1 WHERE `userid` = $userid");. But you're doing very well. :) Keep it up. ;)
  21. Re: My First MOD EVER!!! Need help..think there is big time mistakes... To randomise the money give out, change: $money_give = 900; to $money_give = rand(600,900); :)   Nice little mod here. +1 from me for the effort. You'll get the hang of PHP quite quickly. I've been coding for around 1-2 months now and have grasped all of the basics. :)
  22. Re: [FREE] [V2] Ian's Investments I understand what you're saying. :)   And thank you very much. :)
  23. Re: [v1]Attack Stats FREE[v1]   You're missing something after the mmugged=mmugged+. ;) That field in the user's table needs to go up when a user successfully mugs someone. :)
  24. Re: [FREE] [V2] Ian's Investments I use tabs/spaces to make my code easier to read. :) With my first mod, I didn't have any spaces or indents, so it was very hard to read. I was told that it would be easier on the eyes if the code was presentable and easy to read and edit. :)   And thank you, Miniman. :)
  25. Re: [FREE] [V2] Ian's Investments Thank you all for the positive comments. :)   And I'll contact you when I've developed my skills some more. ;) So, thank you very much for the offer. It'll spur me on. :-D
×
×
  • Create New...