
crimec
Members-
Posts
80 -
Joined
-
Last visited
-
Days Won
2
Content Type
Profiles
Forums
Events
Everything posted by crimec
-
hello everyone including mccodes, and staff this is in relation to tpcodes,ravan,mccodes problem i just wanted to apologise for the way i acted towards you guys and that stupid tpcodes engine please you need to hear me out i dont want to get in trouble ok. so i wanted to make a game and i was going to buy mccodes but it was expensive so i searched around and i found a script called ravan(not knowing it was mccdoes honestly) so i bought it i even talked to the guy who owned it he said i know have a licence and that was the end of it so i then modded the engine to my to the way i wanted it and called the game tpcodes this is where the name came from so since i had a licence (ravan) i never new it was mccodes so i wanted to sell it as a modded game not as a game engine like mccodes because i had not made the script so i tried to sell it but kylemasscare was the only one to buy then he did not like it and i issed him a refund (very sorry) i then mailed ravan for my money back as they sold me mccodes but it was to late i got scammed a few days later a guy mailed me about his game he said he wanted me to help him fix errors and change the background for him so i did i said i would do it for 5 dollars so after the job he said he didnt have the money so he said he would trade me some mods so i received 30 mccodes paid mods so i said ok , which i showd you a screen shot which i did not sell or use i want to return them to the rightful owner as i do not need/i did not pay for these mods i apologize to you, dave, cronus etc as you could see in the screenshot the ajax channel chat is there so i was unaware that i could not sell the mccodes -ravan script i am really sorry and i dont want to get in trouble really i got scammed by ravan and those mods i wil return to rightful owner i have deleted the tpcodes (ravan script-mccodes) script and i still have the mods i dont know who to send them to that is rightful owner i was just helping someone and i bought ravan which i didint know was mccodes and i did not know i could not sell it im really sorry i swear please give me anothor chance please and show this to everyone its really hard i dont know what i have done i have issued kyle a refund i am really sorry please guys forgive me :( please just give me a warning i did not mean copyright i have deleted the engine and stopped selling as i only sold one to kyle which i issued him a refund also staff could one of you guys msg me i wanted to send you the list of paid mods file i received for doing work for someone as im not the owner i want to return the delete i have the email of the guy that sent me mods also ravan have scammed me and i want my money back could you help me im very sorry please guys please one more chance
-
im selling its callef breakoutcity.x10.mx
-
Scorpio what's you game link so I can have a look at error
-
deleted this text
-
can someone post an update coz forum messed codes img src with
-
i tried it keep getting errors
-
Change $userid to ".$db->escape($ir['username'])."
-
go to http://tpcodes.webs.com/ or go to our forums tpcodes.x10.mx for our new game engine way better than mccodes we are always updating it and we currently have lots of features Features below >New Inventory Similar to torn city/ etc with item pics and weapon pics something mccodes doesnt have >New shops with Item pics very easy to add items >Ajax Chat The same as torn city not in looks but the same like chat >Also Added Private Chat Feature >New Donator System You Can now create packs etc all in v2 demo >New marriage system >New job system with companies also when you join a job its says on your viewuser what job you have or what company you work for or job owner etc >new Look very nice all this is in the demo > Has Vip and Donator Features >Stook Market Comming Soon >And Lots More go there now any problems post in our forums or on website thanks tpcodes
-
hey guys i have a game but i dont know how to change the max money and max stats the max money is 2bil and max stats is 40m can someone help me thanks
-
where do you add the cron (day,minute etc)
-
ok first this is my first script made 1. replace your itemmarket with this below this i the item market which i fixed for mccodes v2 because it had lots of errors enjoy <?php /*made By CrimeC Enjoy*/ include "globals.php"; print " <div class='info_mid'><h2 style='padding-top:10px;'> Item Market </h2></div> </div> "; switch($_GET['action']) { case "buy": item_buy(); break; case "gift1": item_gift1(); break; case "gift2": item_gift2(); break; case "remove": itemm_remove(); break; default: imarket_index(); break; } function imarket_index() { global $db,$ir,$c,$userid,$h; print "Viewing all listings... <table width=75% cellspacing=1 class='table'> <tr style='background:gray'> <th>Adder</th> <th>Item</th> <th>Price</th> <th>Links</th> </tr>"; $q=$db->query("SELECT im.*, i.*, u.*,it.* FROM itemmarket im LEFT JOIN items i ON im.imITEM=i.itmid LEFT JOIN users u ON u.userid=im.imADDER LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid ORDER BY i.itmtype, i.itmname ASC"); $lt=""; while($r=$db->fetch_row($q)) { if($lt!=$r['itmtypename']) { $lt=$r['itmtypename']; print "\n<tr style='background: gray;'><th colspan=4>{$lt}</th></tr>"; } if($r['imCURRENCY']=="money") { $price="\$".number_format($r['imPRICE']); } else { $price=number_format($r['imPRICE'])." crystals"; } if($r['imADDER'] == $userid) { $link = "[<a href='itemmarket.php?action=remove&ID={$r['imID']}'>Remove</a>]"; } else { $link = "[<a href='itemmarket.php?action=buy&ID={$r['imID']}'>Buy</a>] [<a href='itemmarket.php?action=gift1&ID={$r['imID']}'>Gift</a>]"; } print "\n<tr> <td><a href='viewuser.php?u={$r['userid']}'>{$r['username']}</a> [{$r['userid']}]</td> <td>{$r['itmname']}</td> <td>$price</td> <td>[<a href='iteminfo.php?ID={$r['itmid']}'>Info</a>] $link</td> </tr>"; } print "</table> </div><div></div><br></div></div></div></div></div> "; } function itemm_remove() { global $db,$ir,$c,$userid,$h; $q=$db->query("SELECT im.*,i.* FROM itemmarket im LEFT JOIN items i ON im.imITEM=i.itmid WHERE imID={$_GET['ID']} AND imADDER=$userid"); if(!$db->num_rows($q)) { print "Error, either this item does not exist, or you are not the owner.<br /> <a href='itemmarket.php'>Back</a></div><div> /></div><br></div></div></div></div></div>"; $h->endpage(); exit; } $r=$db->fetch_row($q); item_add($userid, $r['imITEM'], 1); $i=($db->insert_id()) ? $db->insert_id() : 99999; $db->query("DELETE FROM itemmarket WHERE imID={$_GET['ID']}"); $db->query("INSERT INTO imremovelogs VALUES ('', {$r['imITEM']}, {$r['imADDER']}, $userid, {$r['imID']}, $i, unix_timestamp(), '{$ir['username']} removed a {$r['itmname']} from the item market.')"); print "Item removed from market!<br /> <a href='itemmarket.php'>Back</a></div><div> /></div><br></div></div></div></div></div>"; } function item_buy() { global $db,$ir,$c,$userid,$h; $q=$db->query("SELECT * FROM itemmarket im LEFT JOIN items i ON i.itmid=im.imITEM WHERE imID={$_GET['ID']}",$c); if(!$db->num_rows($q)) { print "Error, either this item does not exist, or it has already been bought.<br /> <a href='itemmarket.php'>Back</a></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>"; $h->endpage(); exit; } $r=$db->fetch_row($q); $curr=$r['imCURRENCY']; if($r['imPRICE'] > $ir[$curr]) { print "Error, you do not have the funds to buy this item.<br /> <a href='itemmarket.php'>Back</a></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div> "; $h->endpage(); exit; } item_add($userid, $r['imITEM'], 1); $i=($db->insert_id()) ? $db->insert_id() : 99999; $db->query("DELETE FROM itemmarket WHERE imID={$_GET['ID']}"); $db->query("UPDATE users SET $curr=$curr-{$r['imPRICE']} where userid=$userid"); $db->query("UPDATE users SET $curr=$curr+{$r['imPRICE']} where userid={$r['imADDER']}"); if($curr=="money") { event_add($r['imADDER'],"<a href='viewuser.php?u=$userid'>{$ir['username']}</a> bought your {$r['itmname']} item from the market for \$".number_format($r['imPRICE']).".",$c); $db->query("INSERT INTO imbuylogs VALUES ('', {$r['imITEM']}, {$r['imADDER']}, $userid, {$r['imPRICE']}, {$r['imID']}, $i, unix_timestamp(), '{$ir['username']} bought a {$r['itmname']} from the item market for \${$r['imPRICE']} from user ID {$r['imADDER']}')"); print "You bought the {$r['itmname']} from the market for \$".number_format($r['imPRICE'])." <br/><a href='itemmarket.php'>Back</a></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div> "; } else { event_add($r['imADDER'],"<a href='viewuser.php?u=$userid'>{$ir['username']}</a> bought your {$r['itmname']} item from the market for ".number_format($r['imPRICE'])." crystals.",$c); $db->query("INSERT INTO imbuylogs VALUES ('', {$r['imITEM']}, {$r['imADDER']}, $userid, {$r['imPRICE']}, {$r['imID']}, $i, unix_timestamp(), '{$ir['username']} bought a {$r['itmname']} from the item market for {$r['imPRICE']} crystals from user ID {$r['imADDER']}')"); print "You bought the {$r['itmname']} from the market for ".number_format($r['imPRICE'])." crystals.<br /> <a href='itemmarket.php'>Back</a></div><div> alt='' /></div><br></div></div></div></div></div> "; } } function item_gift1() { global $db,$ir,$c,$userid,$h; $q=$db->query("SELECT * FROM itemmarket im LEFT JOIN items i ON i.itmid=im.imITEM WHERE imID={$_GET['ID']}"); if(!$db->num_rows($q)) { print "Error, either this item does not exist, or it has already been bought.<br /> <a href='itemmarket.php'>Back</a> alt='' /></div><br></div></div></div></div></div>"; $h->endpage(); exit; } $r=$db->fetch_row($q); $curr=$r['imCURRENCY']; if($r['imPRICE'] > $ir[$curr]) { print "Error, you do not have the funds to buy this item.<br /> <a href='itemmarket.php'>Back</a></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>"; $h->endpage(); exit; } if($curr=="money") { print "Buying the <b>{$r['itmname']}</b> for \$".number_format($r['imPRICE'])." as a gift...<br /> <form action='itemmarket.php?action=gift2' method='post'> <input type='hidden' name='ID' value='{$_GET['ID']}' /> User to give gift to: ".user_dropdown($c,'user')."<br /> <input type='submit' STYLE='color: black; background-color: white;' value='Buy Item and Send Gift' /></form></div><div>alt='' /></div><br></div></div></div></div></div>"; } else { print "Buying the <b>{$r['itmname']}</b> for ".number_format($r['imPRICE'])." crystals as a gift...<br /> <form action='itemmarket.php?action=gift2' method='post'> <input type='hidden' name='ID' value='{$_GET['ID']}' /> User to give gift to: ".user_dropdown($c,'user')."<br /> <input type='submit' STYLE='color: black; background-color: white;' value='Buy Item and Send Gift' /></form></div><div><alt='' /></div><br></div></div></div></div></div>"; } } function item_gift2() { global $db,$ir,$c,$userid,$h; $q=$db->query("SELECT * FROM itemmarket im LEFT JOIN items i ON i.itmid=im.imITEM WHERE imID={$_POST['ID']}"); if(!$db->num_rows($q)) { print "Error, either this item does not exist, or it has already been bought.<br /> <a href='itemmarket.php'>Back</a> </div><div> alt='' /></div><br></div></div></div></div></div> "; $h->endpage(); exit; } $r=$db->fetch_row($q); $curr=$r['imCURRENCY']; if($r['imPRICE'] > $ir[$curr]) { print "Error, you do not have the funds to buy this item.<br /> <a href='itemmarket.php'>Back</a></div><div> alt='' /></div><br></div></div></div></div></div>"; $h->endpage(); exit; } item_add($_POST['user'], $r['imITEM'], 1); $i=($db->insert_id()) ? $db->insert_id() : 99999; $db->query("DELETE FROM itemmarket WHERE imID={$_POST['ID']}"); $db->query("UPDATE users SET $curr=$curr-{$r['imPRICE']} where userid=$userid"); $db->query("UPDATE users SET $curr=$curr+{$r['imPRICE']} where userid={$r['imADDER']}"); if($curr=="money") { event_add($r['imADDER'],"<a href='viewuser.php?u=$userid'>{$ir['username']}</a> bought your {$r['itmname']} item from the market for \$".number_format($r['imPRICE']).".",$c); event_add($_POST['user'], "<a href='viewuser.php?u=$userid'>{$ir['username']}</a> bought you a {$r['itmname']} from the item market as a gift.",$c); $u=$db->query("SELECT username FROM users WHERE userid={$_POST['user']}"); $uname=$db->fetch_single($u); $db->query("INSERT INTO imbuylogs VALUES ('', {$r['imITEM']}, {$r['imADDER']}, $userid, {$r['imPRICE']}, {$r['imID']}, $i, unix_timestamp(), '{$ir['username']} bought a {$r['itmname']} from the item market for \${$r['imPRICE']} from user ID {$r['imADDER']} as a gift for $uname [{$_POST['user']}]')"); print "You bought the {$r['itmname']} from the market for \$".number_format($r['imPRICE'])." and sent the gift to $uname.<br /> <a href='itemmarket.php'>Back</a></div><div> alt='' /></div><br></div></div></div></div></div>"; } else { event_add($r['imADDER'],"<a href='viewuser.php?u=$userid'>{$ir['username']}</a> bought your {$r['itmname']} item from the market for ".number_format($r['imPRICE'])." crystals.",$c); event_add($_POST['user'], "<a href='viewuser.php?u=$userid'>{$ir['username']}</a> bought you a {$r['itmname']} from the item market as a gift.",$c); $u=$db->query("SELECT username FROM users WHERE userid={$_POST['user']}"); $uname=$db->fetch_single($u); $db->query("INSERT INTO imbuylogs VALUES ('', {$r['imITEM']}, {$r['imADDER']}, $userid, {$r['imPRICE']}, {$r['imID']}, $i, unix_timestamp(), '{$ir['username']} bought a {$r['itmname']} from the item market for {$r['imPRICE']} crystals from user ID {$r['imADDER']} as a gift for $uname [{$_POST['user']}]')"); print "You bought the {$r['itmname']} from the market for ".number_format($r['imPRICE'])." crystals and sent the gift to $uname.<br /> <a href='itemmarket.php'>Back</a></div><div> alt='' /></div><br></div></div></div></div></div>"; } } $h->endpage(); ?>
-
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/game12x1/public_html/houses.php on line 21 my code <?php include_once('globals.php'); echo '<p class="heading">Your Houses</p>'; switch ($_GET['page']) { case 'move': move_house(); break; case 'move_out': move_out(); break; case 'estate': estate_agent(); break; case 'sell': sell_house(); break; case 'rentals': rental_market(); break; case 'rent': rent_house(); break; case 'upgrade': upgrade_house(); break; default: houses_index(); break; } function houses_index() { global $ir; $houses = mysql_query(sprintf("SELECT * FROM `owned_houses` LEFT JOIN `houses` ON (`hID` = `uhouseHouse`) LEFT JOIN `users` ON (`userid` = `uhouseOwner`) WHERE (`uhouseOwner` = '%u' || `uhouseTenant` = '%u') AND `uhouseId` != '%d'", $ir['userid'], $ir['userid'], $ir['house'])); echo '<table width="600"> <tr> <td width="50%" align="center"><a href='houses.php?page=estate ','>Estate agent</a></td> <td width="50%" align="center"><a href=',houses.php?page=rentals'>Rent a house</a></td> </tr> </table> '; if($ir['house']) { $fetch = mysql_query(sprintf("SELECT * FROM `owned_houses` LEFT JOIN `houses` ON (`hID` = `uhouseHouse`) WHERE (`uhouseId` = '%u')", $ir['house'])); $h = mysql_fetch_assoc($fetch); echo '<b>Current house:</b> <table width="300" class="table"> <tr> <th width="50%">Current house</th> <th width="50%">Move out</th> </tr> <tr> <td>'.stripslashes($h['hNAME']).'</td> <td><a href='houses.php?page=move_out'>Move out</a></td> </tr> </table> '; } echo '<table width="600" class="table"> <tr> <th width="25%">House name</th> <th width="25%">Owner</th> <th width="25%">Mood value</th> <th width="25%">Manage</th> </tr>'; if(!mysql_num_rows($houses)) { echo '<tr> <td colspan="5">You have no houses at this time, purchase one at the estate agent\'s.</td> </tr>'; } while($r = mysql_fetch_assoc($houses)) { echo '<tr> <td>'.stripslashes($r['hNAME']).'</td> <td><a href="http://viewuser.php?u='.$r['userid'].'" target="_blank">'.stripslashes($r['username']).'</a></td> <td>'.number_format($r['uhouseMood']).' mood bar</td> <td><a href='houses.php?page=move&id='.$r['uhouseId'].'>Move in</a> <a href='houses.php?page=sell&id='.$r['uhouseId'].'>Sell house</a> <a href='houses.php?page=rent&id='.$r['uhouseId'].'>Rent house</a> <a href='houses.php?page=upgrade&id='.$r['uhouseId'].'>Add upgrades</a></td> </tr>'; } echo '</table>'; } function move_house() { global $ir; $fetch = mysql_query(sprintf("SELECT * FROM `owned_houses` LEFT JOIN `houses` ON (`hID` = `uhouseHouse`) LEFT JOIN `users` ON (`userid` = `uhouseOwner`) WHERE (`uhouseId` = '%u')", abs((int) $_GET['id']))); if(!isset($_GET['id'])) { echo 'You did not select a house to move in to.'; } else if(!mysql_num_rows($fetch)) { echo 'You cannot move into a non-existant house.'; } else { $r = mysql_fetch_assoc($fetch); if($r['uhouseOwner'] != $ir['userid'] AND $r['uhouseTenant'] != $ir['userid']) { echo 'You are not permitted to move into this house.'; } else if($r['uhouseRTime'] AND $r['uhouseOwner'] == $ir['userid']) { echo 'You cannot move into a house while it is being rented to another member.'; } else { mysql_query(sprintf("UPDATE `users` SET `house` = '%d', `maxwill` = '%d' WHERE (`userid` = '%u')", abs((int) $_GET['id']), $r['uhouseMood'], $ir['userid'])); echo 'You have moved into the '.stripslashes($r['hNAME']).', You now have a maximum mood bar of '.number_format($r['uhouseMood']).'.'; } } } function move_out() { global $ir; $fetch = mysql_query(sprintf("SELECT * FROM `owned_houses` LEFT JOIN `houses` ON (`hID` = `uhouseHouse`) LEFT JOIN `users` ON (`userid` = `uhouseOwner`) WHERE (`uhouseId` = '%u')", $ir['house'])); if(!mysql_num_rows($fetch)) { echo 'You cannot move out of a non-existant house.'; } else { $r = mysql_fetch_assoc($fetch); if($r['uhouseOwner'] != $ir['userid'] AND $r['uhouseTenant'] != $ir['userid']) { echo 'You are not permitted to move out of this house.'; } else { mysql_query(sprintf("UPDATE `users` SET `house` = '0', `maxwill` = '100' WHERE (`userid` = '%u')", $ir['userid'])); echo 'You have moved out of the '.stripslashes($r['hNAME']).', You now have a maximum mood bar of 100.'; } } } function sell_house() { global $ir; $fetch = mysql_query(sprintf("SELECT * FROM `owned_houses` LEFT JOIN `houses` ON (`hID` = `uhouseHouse`) LEFT JOIN `users` ON (`userid` = `uhouseOwner`) WHERE (`uhouseOwner` = '%u') AND (`uhouseId` = '%u')", $ir['userid'], abs((int) $_GET['id']))); if(!isset($_GET['id'])) { echo 'You did not select a house to sell.'; } else if(!mysql_num_rows($fetch)) { echo 'You cannot attempt to sell a non-existant house.'; } else { $r = mysql_fetch_assoc($fetch); if($r['uhouseOwner'] != $ir['userid']) { echo 'You do not own this house, so don\'t attempt to sell it.'; } else if($r['uhouseTenant']) { echo 'You cannot sell a house while it is being rented to another member.'; } else { mysql_query(sprintf("UPDATE `users` SET `money` = `money` + '%d' WHERE (`userid` = '%u')", $r['houseCost'], $ir['userid'])); mysql_query(sprintf("DELETE FROM `owned_houses` WHERE (`uhouseId` = '%u')", abs((int) $_GET['id']))); echo 'You have sold the '.stripslashes($r['hNAME']).' for a total of $'.number_format($r['hPRICE']).'.'; } } } function estate_agent() { global $ir; if(isset($_GET['id'])) { $house = mysql_query(sprintf("SELECT * FROM `houses` WHERE (`hID` = '%u')", abs((int) $_GET['id']))); $r = mysql_fetch_assoc($house); if(!mysql_num_rows($house)) { echo 'You cannot attempt to purchase a non-existant house.'; } else if($ir['money'] < $r['hPRICE']) { echo 'You cannot afford to purchase this house right now, come back another time.'; } else { mysql_query(sprintf("UPDATE `users` SET `money` = `money` - '%d' WHERE (`userid` = '%u')", $r['hPRICE'], $ir['userid'])); mysql_query(sprintf("INSERT INTO `owned_houses` (`uhouseId`, `uhouseOwner`, `uhouseHouse`, `uhouseMood`) VALUES ('NULL','%u', '%d', '%d')", $ir['userid'], $r['hID'], $r['hWILL'])); echo 'You have purchased the '.stripslashes($r['hNAME']).' for a total of $'.number_format($r['houseCost']).'!'; } } else { $houses = mysql_query(sprintf("SELECT * FROM `houses` ORDER BY `hWILL` ASC")); echo '<table width="600" class="table"> <tr> <th>House name</th> <th>Mood value</th> <th>Cost</th> </tr>'; while($r = mysql_fetch_assoc($houses)) { echo '<tr> <td><a href='houses.php?page=estate&id='.$r['hID'].'>'.stripslashes($r['hNAME']).'</a></td> <td>'.number_format($r['hWILL']).' mood bar</td> <td>$'.number_format($r['hPRICE']).'</td> </tr>'; } print '</table>'; } } function rental_market() { global $ir; if(isset($_GET['id'])) { $house = mysql_query(sprintf("SELECT * FROM `owned_houses` LEFT JOIN `houses` ON (`hID` = `uhouseHouse`) LEFT JOIN `users` ON (`userid` = `uhouseOwner`) WHERE (`uhouseId` = '%u')", abs((int) $_GET['id']))); $r = mysql_fetch_assoc($house); if(!mysql_num_rows($house)) { echo 'You cannot rent a house that does not exist.'; } else if($r['uhouseOwner'] == $ir['userid']) { echo 'You own this house at this time, You cannot rent it aswell.'; } else { mysql_query(sprintf("UPDATE `owned_houses` SET `uhouseTenant` = '%d' WHERE (`uhouseId` = '%u')", $ir['userid'], abs((int) $_GET['id']))); echo 'You are now renting the '.stripslashes($r['hNAME']).' for a total of $'.number_format($r['uhouseRent']).' each night!'; } } else { $houses = mysql_query(sprintf("SELECT * FROM `owned_houses` LEFT JOIN `houses` ON (`hID` = `uhouseHouse`) LEFT JOIN `users` ON (`userid` = `uhouseOwner`) WHERE `uhouseTenant` = '0' AND `uhouseRent` > '0' ORDER BY `uhouseRent` ASC")); echo '<table width="600" class="table"> <tr> <th>House name</th> <th>Owner</th> <th>Mood value</th> <th>Cost each night</th> <th>Rental time</th> <th>Manage</th> </tr>'; while($r = mysql_fetch_assoc($houses)) { echo '<tr> <td>'.stripslashes($r['hNAME']).'</td> <td><a href='userprofile.php?id='.$r['userid'].' >'.stripslashes($r['username']).'</a></td> <td>'.number_format($r['uhouseMood']).' mood bar</td> <td>$'.number_format($r['uhouseRent']).'</td> <td>'.number_format($r['uhouseRTime']).' nights</td> <td><a href='houses.php?page=rentals&id='.$r['uhouseId'].'>Rent house</a></td> </tr>'; } print '</table>'; } } function rent_house() { global $ir; $fetch = mysql_query(sprintf("SELECT * FROM `owned_houses` LEFT JOIN `houses` ON (`hID` = `uhouseHouse`) LEFT JOIN `users` ON (`userid` = `uhouseOwner`) WHERE (`uhouseOwner` = '%u') AND (`uhouseId` = '%u')", $ir['userid'], abs((int) $_GET['id']))); if(!isset($_GET['id'])) { echo 'You did not select a house to rent out to members.'; } else if(!mysql_num_rows($fetch)) { echo 'You cannot attempt to rent out a non-existant house.'; } else { $r = mysql_fetch_assoc($fetch); if($r['uhouseOwner'] != $ir['userid']) { echo 'You do not own this house, so don\'t attempt to rent it out to people.'; } else if($r['uhouseTenant']) { echo 'You cannot rent out a house while it is being rented to another member.'; } else { if(isset($_POST['time']) AND isset($_POST['cost'])) { mysql_query(sprintf("UPDATE `owned_houses` SET `uhouseRent` = '%d', `uhouseRTime` = '%d' WHERE (`uhouseId` = '%u')", abs((int) $_POST['cost']), abs((int) $_POST['time']), abs((int) $_GET['id']))); echo 'You have added the '.stripslashes($r['hNAME']).' the the rental market at a cost of $'.number_format($_POST['cost']).' per night.'; } else { echo '<form action="houses.php?page=rent&id='.$_GET['id'].'" method="post"> <table width="600"> <tr> <td><b>Amount of nights:</b></td> <td><input type="text" name="time" value="30" /></td> </tr> <tr> <td><b>Cost per nights:</b></td> <td><input type="text" name="cost" value="250" /></td> </tr> <tr> <td colspan="2" align="center"><input type="submit" value="Submit rental" /></td> </tr> </table> </form>'; } } } } function upgrade_house() { global $ir; if(!isset($_POST['id'])) { if(isset($_GET['id'])) { echo '<form action="houses.php?page=upgrade&id='.$_GET['id'].'" method="post" name="upgrades"> <table class="table" width="600"> <tr> <th width="45%">Upgrade name</th> <th width="25%">Mood gain</th> <th width="25%">Cost</th> <th width="5%"></th> </tr>'; $fetch = mysql_query("SELECT * FROM `house_upgrades` ORDER BY `upgradeMood` ASC"); while ($r = mysql_fetch_assoc($fetch)) { echo '<tr> <td>'.stripslashes($r['upgradeName']).'</td> <td>'.number_format($r['upgradeMood']).' mood</td> <td>$'.number_format($r['upgradeCost']).'</td> <td><input type="radio" name="id" value="'.$r['upgradeId'].'" onClick="document.upgrades.submit();" /></td> </tr>'; } echo '</table>'; } else { echo 'You did not select a house to add upgrades to.'; } } else { $upgrade = mysql_query(sprintf("SELECT * FROM `house_upgrades` WHERE `upgradeId` = '%u'", abs((int) $_POST['id']))); if(!mysql_num_rows($upgrade)) { echo 'This upgrade does not exist at this time, if this problem continues report it to staff.'; } else if(!isset($_GET['id'])) { echo 'You did not select a house to add upgrades to.'; } else { $house = mysql_query(sprintf("SELECT * FROM `owned_houses` LEFT JOIN `houses` ON (`hID` = `uhouseHouse`) LEFT JOIN `users` ON (`userid` = `uhouseOwner`) WHERE (`uhouseId` = '%u')", abs((int) $_GET['id']))); $h = mysql_fetch_assoc($house); $r = mysql_fetch_array($upgrade); if(!mysql_num_rows($house)) { echo 'You cannot add upgrades to a non-existant house.'; } else if($h['uhouseOwner'] != $ir['userid']) { echo 'You are not permitted to add upgrades to this house.'; } else if($ir['money'] < $r['upgradeCost']) { echo 'You do not have enough cash to purchase this upgrade right now.'; } else { $check = mysql_query(sprintf("SELECT * FROM `owned_upgrades` WHERE (`ownupHouse` = '%u') AND (`ownupUpgrade` = '%d')", abs((int) $_GET['id']), abs((int) $_POST['id']))); if(mysql_num_rows($check)) { echo 'This house has this upgrade at this time, it cannot be bought again.'; } else { mysql_query(sprintf("UPDATE `users` SET `money` = `money` - '%d' WHERE `userid` = '%u'", $r['upgradeCost'], $ir['userid'])); mysql_query(sprintf("UPDATE `owned_houses` SET `uhouseMood` = `uhouseMood` + '%d' WHERE `uhouseId` = '%u'", $r['upgradeMood'], abs((int) $_GET['id']))); mysql_query(sprintf("INSERT INTO `owned_upgrades` (`ownupId`, `ownupHouse`, `ownupUpgrade`) VALUES ('NULL','%u', '%d')", abs((int) $_GET['id']), abs((int) $_POST['id']))); echo 'You have purchased the '.stripslashes($r['upgradeName']).' for $'.number_format($r['upgradeCost']).'.'; } } } } } $h->endpage(); ?>