forked from yi12345/TravianT4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test22.php
49 lines (49 loc) · 1.3 KB
/
test22.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
<?php
include "GameEngine/Database.php";
$sector = 4;
// (-/-) SW
if($sector == 1){
$x_a = (WORLD_MAX - (WORLD_MAX*2));
$x_b = 0;
$y_a = (WORLD_MAX - (WORLD_MAX*2));
$y_b = 0;
$order = "ORDER BY y DESC,x DESC";
$mmm = rand(-1, -20);
$x_y = "AND x < -4 AND y < $mmm";
}
// (+/-) SE
elseif($sector == 2){
$x_a = (WORLD_MAX - (WORLD_MAX*2));
$x_b = 0;
$y_a = 0;
$y_b = WORLD_MAX;
$order = "ORDER BY y ASC,x DESC";
$mmm = rand(1, 20);
$x_y = "AND x < -4 AND y > $mmm";
}
// (+/+) NE
elseif($sector == 3){
$x_a = 0;
$x_b = WORLD_MAX;
$y_a = 0;
$y_b = WORLD_MAX;
$order = "ORDER BY y,x ASC";
$mmm = rand(1, 20);
$x_y = "AND x > 4 AND y > $mmm";
}
// (-/+) NW
elseif($sector == 4){
$x_a = 0;
$x_b = WORLD_MAX;
$y_a = (WORLD_MAX - (WORLD_MAX*2));
$y_b = 0;
$order = "ORDER BY y DESC, x ASC";
$mmm = rand(-1, -20);
$x_y = "AND x > 4 AND y < $mmm";
}
$q = "SELECT * FROM ".TB_PREFIX."wdata where fieldtype = 3 and occupied = 0 $x_y and (x BETWEEN $x_a AND $x_b) and (y BETWEEN $y_a AND $y_b) $order LIMIT 20";
$result = mysql_query($q);
while($row = mysql_fetch_array($result)){
echo $row['x']." | ".$row['y']."<br>";
}
?>