forked from simmoo/Mafia-Game-Script
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathestate.php
157 lines (135 loc) · 5.13 KB
/
estate.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<?php
/**************************************************************************************************
| Software Name : Ravan Scripts Online Mafia Game
| Software Author : Ravan Soft Tech
| Software Version : Version 2.0.1 Build 2101
| Website : http://www.ravan.info/
| E-mail : [email protected]
|**************************************************************************************************
| The source files are subject to the Ravan Scripts End-User License Agreement included in License Agreement.html
| The files in the package must not be distributed in whole or significant part.
| All code is copyrighted unless otherwise advised.
| Do Not Remove Powered By Ravan Scripts without permission .
|**************************************************************************************************
| Copyright (c) 2010 Ravan Scripts . All rights reserved.
|**************************************************************************************************/
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['hNAME']}.";
}
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
{
$db->query("UPDATE users SET money=money+{$np['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=green><b>{$mp['hNAME']}</b></font><br><br />The houses you can buy are listed below. Click a house to buy it.<br><br />";
print "<a href='estate.php?sellhouse'><b>Sell Your House</b></a>
<div id='estatePage' class='housepage'>
<div class='housepage_btnpart'>
</div>
<div class='housepage_bigimg'>
<p><img src='images/bigimg_txt.jpg' alt='' /></p>
</div>
<div class='house_bg1'>
<div class='house_bg2'>
<div class='house_conpart'>
<div class='house_titpart'>
<div><img src='images/gym_tit_left.png' alt='' /></div>
<div class='house_tittxt'>
<div class='htit1'><img src='images/hname.gif' alt='' /></div>
<div class='htit2'><img src='images/hcity.gif' alt='' /></div>
<div class='htit3'><img src='images/hprice.gif' alt='' /></div>
<div class='htit4'><img src='images/hwill.gif' alt='' /></div>
<div class='htit5'><img src='images/hbuy.gif' alt='' /></div>
</div>
<div><img src='images/gym_tit_right.png' alt='' /></div>
</div>
";
if($ir['willmax'] > 100)
{
}
$hq=$db->query("SELECT * FROM houses WHERE hWILL>{$ir['maxwill']} ORDER BY hWILL ASC");
while($r=$db->fetch_row($hq))
{
print " ";
$hq=mysql_query("SELECT * FROM houses WHERE hWILL>{$ir['maxwill']} ORDER BY hWILL ASC",$c);
while($r=$db->fetch_row($hq))
{
print "
<div class='house_contentpart' >
<div class='shackpart'>
<div><img src='images/shack_top.png' alt='' /></div>
<div class='shack_con'>
<div class='shack_img'><img src='{$r['hPIC']}' width='137' height='72' alt='' /></div>
<div class='shack_txt'>{$r['hNAME']} </div>
</div>
<div><img src='images/shack_btm.png' alt='' /></div>
</div>
<div class='city_con'>
<div><img src='images/all_top.gif' alt='' /></div>
<div class='city_md'>
<div class='alltxt'>All City</div>
</div>
<div><img src='images/all_btm.gif' alt='' /></div>
</div>
<div class='city_con'>
<div><img src='images/all_top.gif' alt='' /></div>
<div class='city_md'>
<div class='alltxt'>\$$t".money_formatter($r['hPRICE'],'')."</div>
</div>
<div><img src='images/all_btm.gif' alt='' /></div>
</div>
<div class='city_con'>
<div><img src='images/all_top.gif' alt='' /></div>
<div class='city_md'>
<div class='alltxt'>{$r['hWILL']}</div>
</div>
<div><img src='images/all_btm.gif' alt='' /></div>
</div>
<div class='buybtn'><a href='estate.php?property={$r['hID']}'><img src='images/buy_btn.jpg' title='BUY' alt='BUY' /></a></div>
</div> ";
}
print "
</div>
</div>
</div>
</div>
</div>
</div> </div></div> </div></div>
</div>
</div>
</div>
";
}
}
$h->endpage();
?>