Re: [mccode] Buy A House With Level Requirements !
on the page where you show the houses put this in the cell with the buy link ( i don't know exact names ) ...
echo($r['hLEVEL'] =< $ir['level']):'[url="buyhouse.php?id='.$r['hID'].'"]Buy[/url]':'<i style="color:#009">'.number_format($r['hCOST']).'[/i]';
Then in the buy bit..
if($np['hLevel'] > $ir['level'] ) {
echo '
You Are Not The Level Required Yet</p>';
$h->endpage();
die;
}
$newMoney = $ir['money'] - $np['hPRICE'];
if($db->query(sprintf("UPDATE users SET money = '%u', will = '0', maxwill = '%u' WHERE userid = '%u'",$newMoney,(int)$np['hWILL'],(int)$userid))) {
echo '
You now live in a '.$np['hNAME'],'</p>[url="index.php"]back[/url]';
} else { echo 'error';