• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

[PHP] Znote AAC - House System

Nottinghster

Tibia World RPG Developer
Joined
Oct 24, 2007
Messages
1,618
Solutions
6
Reaction score
537
Location
Brazil - Rio de Janeiro
GitHub
Nottinghster
Hello OTlanders!

I'm having some problems with House System from Znote AAC since isn't 100% finished.
I was tryin' to make it work like Nicaw AAC, but since I'm kinda "noob" with PHP, I can't get it work!

Erros:
1 - Load in first access, but only shows (House, location...)
2 - Stop loading after first access and don't load other pages (including apache)

Here's the code based in Nicaw AAC:
PHP:
<?php require_once 'engine/init.php'; include 'layout/overall/header.php'; ?>

<h3>Houses</h3>
<table>
<tr class="color0"><td width="35%"><b>House</b></td><td width="25%"><b>Location</b></td><td width="25%"><b>Owner</b></td><td><b>Size</b></td><td><b>Rent</b></td></tr>
<?php 
$HousesXML = simplexml_load_file('C:\OpenTibia\Project\data\world\world-house.xml'); // dir example!
$MySQL = mysql_query('SELECT `players`.`name`, `houses`.`id` FROM `players`, `houses` WHERE `houses`.`owner` = `players`.`id`;');

while($row = mysql_fetch_assoc($MySQL)) {
	$houses[(int)$row['id']] = $row['name'];
}
foreach ($HousesXML as $house){
	$house_price = (int)$house['size'] * 50; // Aqui determina o tamanho da casa multiplicado pelo preço;
	$i++;
	$list.= '<tr><td>'.htmlspecialchars($house['name']).'</td><td>'.htmlspecialchars($cfg['temple'][(int)$house['townid']]['name']).'</td><td>'.$houses[(int)$house['houseid']].'</td><td>'.$house['size'].'</td><td>'.$house_price.'</td></tr>'."\r\n";//'.$house['rent'].'
}
echo $list;

?>
</table>

<?php include 'layout/overall/footer.php'; ?>

Thank you!
 
Back
Top