Satans_Pimp Posted October 7, 2007 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
Isomerizer Posted October 7, 2007 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
Satans_Pimp Posted October 7, 2007 Author 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
nypthamine Posted February 25, 2008 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
Ghetto Posted February 25, 2008 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
.: Reaper :. Posted December 20, 2008 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
Haunted Dawg Posted December 21, 2008 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
shaved92bravada Posted December 21, 2008 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
AlabamaHit Posted December 21, 2008 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
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.