Jump to content
MakeWebGames

F4R1D

Members
  • Posts

    27
  • Joined

  • Last visited

    Never

F4R1D's Achievements

Newbie

Newbie (1/14)

0

Reputation

  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
×
×
  • Create New...