My houses are set up to require bricks, land, cement and money to buy the next house. I just purchased this mod from someone, but it allows them to buy the next house whether they have the essential criteria or not. If they do not have enough of one or more of the items, it allows them to buy the house and just puts them with negative money/bricks/land/cement etc. How do I stop this?? Here is that part of the code:
<?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'] AND $ir['money'] < $userid['money'])
{
print "You do not have enough money to buy the {$np['hNAME']}.";
}
else
{
$db->query("UPDATE users SET money=money-{$np['hPRICE']},will=0,maxwill={$np['hWILL']}, brick=brick-{$np['hBRICK']}, cement=cement-{$np['hCEMENT']}, land=land-{$np['hLAND']} WHERE userid=$userid");
print "Congrats, you bought the {$np['hNAME']} for \${$np['hPRICE']} , {$np['hBRICK']}, {$np['hCEMENT']} and {$np['hLAND']}!";
}