Jump to content
MakeWebGames

F4R1D

Members
  • Posts

    27
  • Joined

  • Last visited

    Never

Everything posted by F4R1D

  1. Re: crystal market u have not sercured it   and y have u done Y not   and u put <br / > u only need one and my way is easyer
  2. Re: crystal market   <?php include_once('globals.php'); echo "<h3><u>Crystal Market</u></h3>"; echo sprintf(" You have %d money</p>",$ir['money']); switch($_GET['action']) { case "buy":crystal_buy();break; case "remove":crystal_remove();break; case "add":crystal_add();break; default:cmarket_index();break; } function cmarket_index() { global $db,$ir,$c,$userid,$h; $st=($_GET['st']) ? $_GET['st'] : 0; $cnt = $db->query("SELECT cm.*, u.* FROM crystalmarket cm LEFT JOIN users u ON u.userid=cm.cmADDER ORDER BY cmPRICE/cmQTY ASC LIMIT $st,15"); $membs=mysql_num_rows($cnt); $pages=(int) ($membs/15)+1; $no1=$st+1; $no2=$st+15; if($membs % 100 == 0) { $pages--; } echo "Pages: "; for($i=1;$i <= $pages;$i++) { $stl=($i-1)*15; echo "[url='cmarket.php?st=$stl&ord=$ord']$i[/url] "; } $no1=$st+1; $no2=$st+15; echo " Showing crystal listing $no1 to $no2 "; echo " [url='cmarket.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>"; while($r=$db->fetch_row($q)) { if($r['cmADDER'] == $userid) { $link = "[url='cmarket.php?action=remove&ID={$r[']Remove[/url]"; } else { $link = "[url='cmarket.php?action=buy&ID={$r[']Buy[/url]"; } $each= (int) $r['cmPRICE'] / $r['cmQTY']; echo "\n<tr> <td>[url='viewuser.php?u={$r[']{$r['username']}[/url] [{$r['userid']}]</td> <td>{$r['cmQTY']}</td> <td> \$" . number_format($each)."</td> <td>\$".number_format($r['cmPRICE'])."</td> <td>[$link]</td> </tr>"; } echo "</table>"; } function crystal_remove() { global $db,$ir,$c,$userid,$h; $q=$db->query("SELECT * FROM crystalmarket WHERE cmID={$_GET['ID']} AND cmADDER=$userid"); if(!$db->num_rows($q)) { echo "Error, either these crystals do not exist, or you are not the owner. [url='cmarket.php']> Back[/url]"; $h->endpage(); exit; } $r=$db->fetch_row($q); $db->query("UPDATE users SET crystals=crystals+{$r['cmQTY']} where userid=$userid"); $db->query("DELETE FROM crystalmarket WHERE cmID={$_GET['ID']}"); echo "Crystals removed from market! [url='cmarket.php']> Back[/url]"; } function crystal_buy() { global $db,$ir,$c,$userid,$h; $q=$db->query("SELECT * FROM crystalmarket cm WHERE cmID={$_GET['ID']}"); if(!$db->num_rows($q)) { echo "Error, either these crystals do not exist, or they have already been bought. [url='cmarket.php']> Back[/url]"; $h->endpage(); exit; } $r=$db->fetch_row($q); if($r['cmPRICE'] > $ir['money']) { echo "Error, you do not have the funds to buy these crystals. [url='cmarket.php']> Back[/url]"; $h->endpage(); exit; } $db->query("UPDATE users SET crystals=crystals+{$r['cmQTY']} where userid=$userid"); $db->query("DELETE FROM crystalmarket WHERE cmID={$_GET['ID']}"); $db->query("UPDATE users SET money=money-{$r['cmPRICE']} where userid=$userid"); $db->query("UPDATE users SET bankmoney=bankmoney+{$r['cmPRICE']} where userid={$r['cmADDER']}"); event_add($r['cmADDER'],"[url='viewuser.php?u=$userid']{$ir['username']}[/url] bought your {$r['cmQTY']} crystals from the market for \$".number_format($r['cmPRICE']).".",$c); echo "You bought the {$r['cmQTY']} crystals from the market for \$".number_format($r['cmPRICE'])."."; } function crystal_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['crystals']) { die ("You are trying to add more crystals to the market than you have."); } $tp=$_POST['amnt']*$_POST['price']; $db->query("INSERT INTO crystalmarket VALUES('',{$_POST['amnt']},$userid,$tp)"); $db->query("UPDATE users SET crystals=crystals-{$_POST['amnt']} WHERE userid=$userid"); echo "Crystals added to market! [url='cmarket.php']> Back[/url]"; } else { echo "[b]Adding a listing...[/b] You have [b]{$ir['crystals']}[/b] crystals that you can add to the market.<form action='cmarket.php?action=add' method='post'><table width=50% border=2><tr> <td>Crystals:</td> <td><input type='text' name='amnt' value='{$ir['crystals']}' /></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(); ?>   More neater but not sercure
  3. Re: crystal market Thats not serucre
  4. Re: Requesting - [Mccodes V2} Shared house mod Looks like it would work any ways +1 :)
  5. Re: Advanced Bug Report System Nice but i think its been made before anyways +1 good efferct
  6. Re: Small mod to header [any version] Nice +1 Lithium
  7. Re: [MC Codes V2] Advanced Player Reports your work is nice as always :P
  8. Re: need help with a delete item type code theres one around the forums look aroud the pages
  9. Re: [V2] Class Benefits - Fighter || Traveller || Banker I Wish people could sercure the ip hack
  10. Re: [V2] Attacking Turns Shop nice but easy
  11. Re: protection mccodes v2 yes everyone is posting that sprintf dose not sercure codes people think its good it makes the code slow but its there style of coding
  12. Re: [mccodes v2] Find random items while playing the game... it dose work its proberly ur header.php or you have added it in the rong page mate so look for the middle part
  13. Re: Help needed will pay $20 $20 is not worth that might aswell just look around the forums and you will find it there
  14. Re: [V2] My home Bump Up My Post
  15. Re: [mccode2] Updated Attack Script That Works With My Updated Inventory ($10.00) This is not worth $10 It is not hard just to add some more stuff to attack
  16. Re: [V2]New Explore Y have you posted loads of the same stuff? Your just trying to make the file bigger
  17. Re: [mccode2] New echange temple How many you ment to get for a donation you did not metion that Anit there ment to be a staff_toc.php to pay the People there credits if they donate
  18. Re: Bank Layout V2 I Like the image and set out +1 for u
  19. Re: [MCCODES V2] New Schooling Advanced well done illusions +1 For you
  20. Re: [mccodes v2]New and improved inventory code sources for free! OMG all You added is little bits now your Selling a attack for $10 Its not worth it no way
  21. Re: [mccode v2] Job Recode I Was Looking trough it and its better than the normal one +1 For You
  22. Re: [V2] My home Thank you karlos +1 For the fix up
  23. Re: [mccode] Diamond gems, with a Diamondtemple.php for v2.0 Well done, for pressing ctrl + h and replacing "Crystals" with "Diamonds". You hardly recoded crystaltemple and u can tell u did not finish it becuause u can see ['ct_moneypercry']). so its a -1 from me
  24. Re: [V2] My home can u give me good comments
  25. this is were you can get will and energy and more from and You can do it once a day Simple Mod For Lerners First Run Sql: ALTER TABLE `users` ADD `tv` INT( 11 ) NOT NULL DEFAULT '0';   Then make a file called myhome.php: <?php /*----------------------------------------------------- -- Made by F4R1D. -- My Home mod (Free Mod) -- myhome.php -----------------------------------------------------*/ include "globals.php"; if ($ir['tv'] ==1) {echo "You Already Did This Today"; EXIT;} if (!$_GET['get']) { echo "<center>What would you like to do? <table Border='1' class='table'><tr><td class='table'>[url='myhome.php?get=tsf1']Watch My T.V[/url]</td><td class='table'>[url='myhome.php?get=tsf2']Food[/url]</td></tr></table>";} //My Code Starts Here\\ //T.V start\\ else if ($_GET['get'] =='tsf1') {echo "You Watched a bit of tv for a bit and got full energy WOW!!! [url='index.php']> Back[/url]"; $db->query("UPDATE users SET energy=100 WHERE userid=$userid"); $db->query("UPDATE users SET tv=1 Where userid=$userid");}/// //T.V end\\ //Food Start\\ else if ($_GET['get'] =='tsf2') {echo "You Had Chicken & Chips and felt a bit of will coming back [url='index.php']> Back[/url]"; $db->query("UPDATE users SET will=100 WHERE userid=$userid"); $db->query("UPDATE users SET tv=1 Where userid=$userid");} //Food end\\ //My Code Ends Here\\ ?>   Now add this to cron_day.php: $db->query("UPDATE users SET tv=0 WHERE tv > 1");   Now You are done
×
×
  • Create New...