Advertisement
Guest User

Untitled

a guest
Jan 16th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.86 KB | None | 0 0
  1. <?PHP
  2. $todata_worlds = [
  3. 1 => 'c:/world1/data',
  4. 2 => 'c:/world2/data',
  5. ];
  6.  
  7. $main_content .= '
  8. <center>
  9. <font size="3">Houses Information</font>
  10. </center>
  11. <hr>
  12. <b>Commands</b><br>
  13. - To buy house use command: <b>!buyhouse</b>
  14. <br>
  15. - To buy house with <b>Trainers</b> use command: <b>!buyhousepremium</b>
  16. <br>
  17. - To pay for rent use command: <b>!rent</b>
  18. <br><br>
  19. <b>Houses spells</b><br>
  20. <table style="width:600px;">
  21. <tbody>
  22. <tr>
  23. <td><span class="darkred">aleta sio</span></td>
  24. <td>List of persons who cannot move items in house</td>
  25. </tr>
  26. <tr>
  27. <td><span class="darkred">aleta grav</span></td>
  28. <td>List of door owner</td>
  29. </tr>
  30. <tr>
  31. <td><span class="darkred">aleta som</span></td>
  32. <td>List of owners who can move items in house</td>
  33. </tr>
  34. <tr>
  35. <td><span class="darkred">aleta san</span></td>
  36. <td>List of persons who can move items</td>
  37. </tr>
  38. <tr>
  39. <td><span class="darkred">alana sio</span></td>
  40. <td>Kick self from house</td>
  41. </tr>
  42. <tr>
  43. <td><span class="darkred">alana sio "</span>Roar</td>
  44. <td>Kick player from house</td>
  45. </tr>
  46. </tbody>
  47. </table>
  48. <div align="left">
  49. <font size="3"><b>Trade House - System</b></font>
  50. <br>To buy a house should be in the middle and then use command <b>!sellhouse</b> will then create an act of ownership which we transfer through the trade to the person whom we want to sell the house if there is information about the name of the cottage and the owner of the trade<br><br>
  51. The person who buys the house should click <b>look</b> on the document in the trade window, if everything is ok then the cottage name will appear, otherwise please do not accept the transaction.
  52. </div>
  53. <img src="/images/sellhouse.png" height="242" width="222" align="right">
  54. <div align="right">
  55. <font size="3"><b>Rent House - System</b></font>
  56. <br>To buy a house should be in the middle and then use command <b>!sellhouse</b> will then create an act of ownership which we transfer through the trade to the person whom we want to sell the house if there is information about the name of the cottage and the owner of the trade<br><br>
  57. <br>The person who buys the house should click <b>look</b> on the document in the trade window, if everything is ok then the cottage name will appear, otherwise please do not accept the transaction.
  58. </div>
  59. <img src="/images/sellhouse.png" height="242" width="222" align="left">
  60. ';
  61.  
  62. if(count($config['site']['worlds']) > 1)
  63. {
  64. $main_content .= '<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR><TD>
  65. <FORM ACTION="?subtopic=houses" METHOD=get>
  66. <INPUT TYPE=hidden NAME=subtopic VALUE=houses>
  67. <TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>World Selection</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['lightborder'].'">
  68. <TABLE BORDER=0 CELLPADDING=1><TR><TD>World: </TD><TD><SELECT SIZE="1" NAME="world"><OPTION VALUE="" SELECTED>(choose world)</OPTION>';
  69. foreach($config['site']['worlds'] as $idd => $world)
  70. {
  71. $main_content .= '<OPTION VALUE="'.$idd.'">'.$world.'</OPTION>';
  72. }
  73. $main_content .= '</SELECT> </TD><TD><INPUT TYPE=image NAME="Submit" ALT="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18>
  74. </TD></TR></TABLE></TABLE></FORM></TABLE><br>';
  75. }
  76.  
  77. if(isset($_GET['world']) && $_GET['world'] != "" && isset($todata_worlds[(int)$_GET['world']]))
  78. {
  79.  
  80. $filen = file_get_contents($todata_worlds[(int)$_GET['world']].'/../config.lua');
  81. $temppos = stristr($filen, "priceforsqm = ");
  82. $exp = explode(' ', $temppos);
  83. $exp = explode('--', $exp[2]);
  84. $price = $exp[0];
  85.  
  86. $main_content .= '
  87. <p align="justify"><span class="bkv">I</span>nformacje na temat dostępnych domków.</p>
  88. <p align="justify">
  89. <h1>Zasady</h1>
  90. <ul style="margin-left:20px;">
  91. <li>Jedna osoba (człowiek) może posiadać tylko jeden domek!<br>
  92. <li>Domek może kupic osoba posiadająca 50 level lub wyższy!<br>
  93. <li>Kupując nowy domek ze starego musisz się wyprowadzić!<br>
  94. <li>Domek bez właściciela (Nobody) można kupić za pomoca komendy !buyhouse<br>
  95. <li>Każdy ma obowiązek opłacania czynszu za swój domek, w przeciwnym wypadku zostanie z niego wyrzucony<br>
  96. <li>Domek na terenie pacc jest kasowany po skonczeniu sie promocji!<br>
  97. <li>Domek jest kasowany po braku logowania przez 14 dni!<br>
  98. </ul><br>
  99. <h1>Sugerowane ceny</h1>
  100. <table border="0" style="font-family: Tahoma, sans-serif; font-size: 0.9em;">
  101. <tr><td>&nbsp;Cena domku(1sqm)&nbsp;</td><td>&nbsp;-&nbsp;</td><td>&nbsp;<?=$price;?> gp</td></tr>
  102. <tr><td>&nbsp;Cena czynszu&nbsp;</td><td>&nbsp;-&nbsp;</td><td>&nbsp;1/3 ceny domku</td></tr>
  103. </table>
  104. <br>
  105. </p>
  106. <p align="justify"><span class="bkv">S</span>pis wszystkich domków dostępnych na serwerze.</p>
  107. <p align="justify">
  108. ';
  109.  
  110. $file = $todata_worlds[(int)$_GET['world']].'/houses.xml';
  111.  
  112. if (file_exists($file))
  113. {
  114. $xml = simplexml_load_file($file);
  115.  
  116. $main_content .= "
  117. <center>
  118. <table class='sortable' frame='void' ><thead>
  119. <tr>
  120. <th class='textleft'>&nbsp;Nazwa Domku&nbsp;</th>
  121. <th class='textcenter'>&nbsp;SQM&nbsp;</th>
  122. <th class='textcenter'>&nbsp;Właściciel&nbsp;</th>
  123. <th class='textcenter'>&nbsp;Cena&nbsp;</th>
  124. </tr>
  125. </thead>
  126. <tbody>
  127. ";
  128.  
  129. $to_color = 0;
  130. foreach($xml->house as $house)
  131. {
  132. $to_color = $to_color+1;
  133. if(isset($house->tile))
  134. {
  135. $size=count($house->tile);
  136. }
  137. else
  138. {
  139. if(count($house->tiles>0))
  140. {
  141. $size = 0;
  142. $c = count($house->tiles);
  143. $i = 0;
  144. while($c > $i)
  145. {
  146. $tsize = 1;
  147. if(($house->tiles[$i]['tox'] - $house->tiles[$i]['fromx']) != 0)
  148. $tsize = $tsize * ($house->tiles[$i]['tox'] - $house->tiles[$i]['fromx'] + 1);
  149. if(($house->tiles[$i]['toy']-$house->tiles[$i]['fromy']) != 0)
  150. $tsize = $tsize * ($house->tiles[$i]['toy'] - $house->tiles[$i]['fromy'] + 1);
  151. if(($house->tiles[$i]['toz'] - $house->tiles[$i]['fromz']) != 0)
  152. {
  153. if($house->tiles[$i]['toz']>$house->tiles[$i]['fromz'])
  154. $tsize = $tsize * ($house->tiles[$i]['toz'] - $house->tiles[$i]['fromz'] + 1);
  155. else
  156. $tsize = $tsize * ($house->tiles[$i]['fromz'] - $house->tiles[$i]['toz'] + 1);
  157. }
  158.  
  159. $size = $size + $tsize;
  160. $i++;
  161. }
  162. }
  163. else
  164. {
  165. $main_content .= "{$house['name']} - Blad z size, coś się z****ło i nie wiemy co.";
  166. }
  167. }
  168.  
  169. if (file_exists($todata_worlds[(int)$_GET['world']]."/houses/".$house['name'].".xml"))
  170. {
  171. $xml2 = simplexml_load_file($todata_worlds[(int)$_GET['world']]."/houses/".$house['name'].".xml");
  172.  
  173. foreach($xml2->owner as $howner)
  174. {
  175. if($howner['name'] == '')
  176. $owner = "nobody";
  177. else
  178. $owner = "<b>{$howner['name']}</b>";
  179. }
  180. }
  181. else
  182. {
  183. exit("Failed to open xml file{$todata_worlds[(int)$_GET['world']]}/houses/{$house['name']}.xml");
  184. }
  185.  
  186. $color = ($to_color % 2) ? '#D7AF6C' : '#D4AA65';
  187. $k = ($size*$price)/1000;
  188. $main_content .= "
  189. <tr>
  190. <td class='textleft' style='background-color:{$color};'>&nbsp;{$house['name']}&nbsp;</td>
  191. <td class='textcenter' style='background-color:{$color};'><span class='darkred'>&nbsp;{$size}&nbsp;</span></td>
  192. <td class='textcenter' style='background-color:{$color};'>&nbsp;Rented by: {$owner}&nbsp;</td>
  193. <td class='textcenter' style='background-color:{$color}';>&nbsp;{$k}k&nbsp;</td>
  194. </tr>
  195. ";
  196. }
  197. $main_content .= "
  198. </tbody>
  199. </table>
  200. ";
  201. }
  202. else
  203. {
  204. $main_content .= "Failed to open xml file: {$file}";
  205. }
  206. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement