Satans_Pimp Posted October 7, 2007 Share Posted October 7, 2007 on estate i can buy a house but it wont keep the house..does anyone know why this would be..i been trying and trying to figure out why..just don't see it.. B.T.W it takes the money also have no error code to show? Thanks for any help giving Quote Link to comment Share on other sites More sharing options...
Isomerizer Posted October 7, 2007 Share Posted October 7, 2007 Re: estate.php mysql query is most probaly wrong... It should update the user's happy / will bar.... Show the query and i'll have a look. Quote Link to comment Share on other sites More sharing options...
Satans_Pimp Posted October 7, 2007 Author Share Posted October 7, 2007 Re: estate.php i have tried to add s different estates but get the same result.. <?php include "globals.php"; $mpq=$db->query("SELECT * FROM houses WHERE hWILL={$ir['maxwill']}"); $mp=$db->fetch_row($mpq); $_GET['property']=abs((int) $_GET['property']); if($_GET['property']) { $npq=$db->query("SELECT * FROM houses WHERE hID={$_GET['property']}"); $np=$db->fetch_row($npq); if($np['hWILL'] < $mp['hWILL']) { print "You cannot go backwards in houses!"; } else if ($np['hPRICE'] > $ir['money']) { print "You do not have enough money to buy the {$np['hrNAME']}."; } else { $db->query("UPDATE users SET money=money-{$np['hPRICE']},will=0,maxwill={$np['hWILL']} WHERE userid=$userid"); print "Congrats, you bought the {$np['hNAME']} for \${$np['hPRICE']}!"; } } else if (isset($_GET['sellhouse'])) { $npq=$db->query("SELECT * FROM houses WHERE hWILL={$ir['maxwill']}"); $np=$db->fetch_row($npq); if($ir['maxwill'] == 100) { print "You already live in the lowest property!"; } else { $hprice=$np['hPRICE']; $db->query("UPDATE users SET money=money+{$hprice},will=0,maxwill=100 WHERE userid=$userid"); print "You sold your {$np['hNAME']} and went back to your shed."; } } else { print "<center>Your current property: <font color=red>[b]{$mp['hNAME']}[/b]</font> The houses you can buy are listed below. Click a house to buy it. "; print "[url='estate.php?sellhouse']Sell Your Property[/url] "; if($ir['willmax'] < 100) { print "[url='estate.php?sellhouse']Sell Your Property[/url] "; } $hq=$db->query("SELECT * FROM houses WHERE hWILL>{$ir['maxwill']} ORDER BY hWILL ASC"); while($r=$db->fetch_row($hq)) { print " <table cellspacing=1 class='table'><tr style='background:gray;'><th>House</th><th>House Price</th><th>House Will</th><th>Tax</th>Tax<th>Buy?</th></tr>"; $hq=$db->query("SELECT * FROM houses WHERE hWILL>{$ir['maxwill']} ORDER BY hWILL ASC"); while($r=$db->fetch_row($hq)) { print "<tr><td>{$r['hNAME']}</a></td><td>\$$t".money_formatter($r['hPRICE'],'')."</td><td>{$r['hWILL']}</td><td>{$r2['hTAX']}</td><td><a href='estate.php?property={$r['hID']}'>Buy</tr>"; } print "</table>"; } } $h->endpage(); ?> Quote Link to comment Share on other sites More sharing options...
Satans_Pimp Posted October 11, 2007 Author Share Posted October 11, 2007 Re: estate.php anyone :? Quote Link to comment Share on other sites More sharing options...
nypthamine Posted February 25, 2008 Share Posted February 25, 2008 Re: estate.php i dont know myb u need a code like torncity...like properties.php...lol i wonder who can code that Quote Link to comment Share on other sites More sharing options...
Ghetto Posted February 25, 2008 Share Posted February 25, 2008 Re: estate.php There could be something in your header.php that keeps reseting your maxwill back to 100. Someone has asked me for help on this befor. It was to do with the marrage script they had. Quote Link to comment Share on other sites More sharing options...
.: Reaper :. Posted December 20, 2008 Share Posted December 20, 2008 Re: estate.php i have tried to add s different estates but get the same result.. <?php include "globals.php"; $mpq=$db->query("SELECT * FROM houses WHERE hWILL={$ir['maxwill']}"); $mp=$db->fetch_row($mpq); $_GET['property']=abs((int) $_GET['property']); if($_GET['property']) { $npq=$db->query("SELECT * FROM houses WHERE hID={$_GET['property']}"); $np=$db->fetch_row($npq); if($np['hWILL'] < $mp['hWILL']) { print "You cannot go backwards in houses!"; } else if ($np['hPRICE'] > $ir['money']) { print "You do not have enough money to buy the {$np['hrNAME']}."; } else { $db->query("UPDATE users SET money=money-{$np['hPRICE']},will=0,maxwill={$np['hWILL']} WHERE userid=$userid"); print "Congrats, you bought the {$np['hNAME']} for \${$np['hPRICE']}!"; } } else if (isset($_GET['sellhouse'])) { $npq=$db->query("SELECT * FROM houses WHERE hWILL={$ir['maxwill']}"); $np=$db->fetch_row($npq); if($ir['maxwill'] == 100) { print "You already live in the lowest property!"; } else { $hprice=$np['hPRICE']; $db->query("UPDATE users SET money=money+{$hprice},will=0,maxwill=100 WHERE userid=$userid"); print "You sold your {$np['hNAME']} and went back to your shed."; } } else { print "<center>Your current property: <font color=red>[b]{$mp['hNAME']}[/b]</font> The houses you can buy are listed below. Click a house to buy it. "; print "[url='estate.php?sellhouse']Sell Your Property[/url] "; if($ir['willmax'] < 100) { print "[url='estate.php?sellhouse']Sell Your Property[/url] "; } $hq=$db->query("SELECT * FROM houses WHERE hWILL>{$ir['maxwill']} ORDER BY hWILL ASC"); while($r=$db->fetch_row($hq)) { print " <table cellspacing=1 class='table'><tr style='background:gray;'><th>House</th><th>House Price</th><th>House Will</th><th>Tax</th>Tax<th>Buy?</th></tr>"; $hq=$db->query("SELECT * FROM houses WHERE hWILL>{$ir['maxwill']} ORDER BY hWILL ASC"); while($r=$db->fetch_row($hq)) { print "<tr><td>{$r['hNAME']}</a></td><td>\$$t".money_formatter($r['hPRICE'],'')."</td><td>{$r['hWILL']}</td><td>{$r2['hTAX']}</td><td><a href='estate.php?property={$r['hID']}'>Buy</tr>"; } print "</table>"; } } $h->endpage(); ?> I had this problem for ages but i figured it out and i fort i would help you guys out kk hers wat you do go to staff panel then click edit house edit the deafult house give it a name and change the cost from 0 to 10 or sumat like that and thats it they work then Quote Link to comment Share on other sites More sharing options...
Haunted Dawg Posted December 21, 2008 Share Posted December 21, 2008 Re: estate.php i have tried to add s different estates but get the same result.. <?php include "globals.php"; $mpq=$db->query("SELECT * FROM houses WHERE hWILL={$ir['maxwill']}"); $mp=$db->fetch_row($mpq); $_GET['property']=abs((int) $_GET['property']); if($_GET['property']) { $npq=$db->query("SELECT * FROM houses WHERE hID={$_GET['property']}"); $np=$db->fetch_row($npq); if($np['hWILL'] < $mp['hWILL']) { print "You cannot go backwards in houses!"; } else if ($np['hPRICE'] > $ir['money']) { print "You do not have enough money to buy the {$np['hrNAME']}."; } else { $db->query("UPDATE users SET money=money-{$np['hPRICE']},will=0,maxwill={$np['hWILL']} WHERE userid=$userid"); print "Congrats, you bought the {$np['hNAME']} for \${$np['hPRICE']}!"; } } else if (isset($_GET['sellhouse'])) { $npq=$db->query("SELECT * FROM houses WHERE hWILL={$ir['maxwill']}"); $np=$db->fetch_row($npq); if($ir['maxwill'] == 100) { print "You already live in the lowest property!"; } else { $hprice=$np['hPRICE']; $db->query("UPDATE users SET money=money+{$hprice},will=0,maxwill=100 WHERE userid=$userid"); print "You sold your {$np['hNAME']} and went back to your shed."; } } else { print "<center>Your current property: <font color=red>[b]{$mp['hNAME']}[/b]</font> The houses you can buy are listed below. Click a house to buy it. "; print "[url='estate.php?sellhouse']Sell Your Property[/url] "; if($ir['willmax'] < 100) { print "[url='estate.php?sellhouse']Sell Your Property[/url] "; } $hq=$db->query("SELECT * FROM houses WHERE hWILL>{$ir['maxwill']} ORDER BY hWILL ASC"); while($r=$db->fetch_row($hq)) { print " <table cellspacing=1 class='table'><tr style='background:gray;'><th>House</th><th>House Price</th><th>House Will</th><th>Tax</th>Tax<th>Buy?</th></tr>"; $hq=$db->query("SELECT * FROM houses WHERE hWILL>{$ir['maxwill']} ORDER BY hWILL ASC"); while($r=$db->fetch_row($hq)) { print "<tr><td>{$r['hNAME']}</a></td><td>\$$t".money_formatter($r['hPRICE'],'')."</td><td>{$r['hWILL']}</td><td>{$r2['hTAX']}</td><td><a href='estate.php?property={$r['hID']}'>Buy</tr>"; } print "</table>"; } } $h->endpage(); ?> I had this problem for ages but i figured it out and i fort i would help you guys out kk hers wat you do go to staff panel then click edit house edit the deafult house give it a name and change the cost from 0 to 10 or sumat like that and thats it they work then How will that help may i ask? Quote Link to comment Share on other sites More sharing options...
shaved92bravada Posted December 21, 2008 Share Posted December 21, 2008 Re: estate.php There could be something in your header.php that keeps reseting your maxwill back to 100. Someone has asked me for help on this befor. It was to do with the marrage script they had. X2 that is your problem. I had the exact same problem at one point in time because I was using the shared housing.... I fixed it but then decided to go without shared housing. Quote Link to comment Share on other sites More sharing options...
AlabamaHit Posted December 21, 2008 Share Posted December 21, 2008 Re: estate.php at a glance over it only error i see is... print "You do not have enough money to buy the {$np['hrNAME']}."; that should be print "You do not have enough money to buy the {$np['hNAME']}."; BUT...that will not cause what your having trouble with. I'm going to say the problem is not on this page. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.