Jump to content
MakeWebGames

estate.php


Satans_Pimp

Recommended Posts

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();

?>
Link to comment
Share on other sites

  • 4 months later...
  • 9 months later...

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...