query('SELECT SUM(`massa`) AS `mass` FROM `inventory` WHERE `owner` = ?i AND `setsale` = 0', $user['id'])->fetch_assoc();
$eff = db::c()->query('SELECT `type` FROM `effects` WHERE `owner` = ?i AND (`type` = 10 OR `type` = 13 OR `type` = 14)', $user['id'])->fetch_assoc();
if ($d['mass'] > get_meshok()) {
err('У вас переполнен рюкзак, вы не можете передвигаться...');
$location[0] = NULL;
}
if ($eff['type'] == 10) {
err('Вы парализованы и не можете передвигаться...');
$location[0] = NULL;
}
if ($eff['type'] == 13 OR $eff['type'] == 14) {
err('У вас тяжелая травма, вы не можете передвигаться...');
$location[0] = NULL;
}
}
/**
* Перемещаемся по заданным параметрам в пределах страницы
* @param int $room - номер локации
* @param string $roomname - название локации
*/
function move_to_inside($room = 0, $roomname = 'неизвестное место')
{
db::c()->query('UPDATE `users`,`online` SET `users`.`room` = ?i,`online`.`room` = ?i WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $room, $room, $_SESSION['uid']);
die("
Переходим на $roomname...
");
}
/**
* Перемещаемся по заданным параметрам за пределами страницы
* @param int $room - номер локации
* @param string $redirect - имя скрипта на который идёт редирект
*/
function move_to_outside($room = 0, $redirect = 'city')
{
db::c()->query('UPDATE `users`,`online` SET `users`.`room` = ?i,`online`.`room` = ?i WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $room, $room, $_SESSION['uid']);
header('location: ' . $redirect);
}
$dig_raw = db::c()->query('SELECT `finish_dig`, `finish_guard` FROM `digger` WHERE `id` = ?i', $user['id'])->fetch_assoc();
if ($dig_raw["finish_dig"] > $tm || $dig_raw["finish_guard"] > $tm) {
header('location: wall_build.php');
die();
}
header("Cache-Control: no-cache");
$location = explode('/', filter_input(INPUT_SERVER, 'QUERY_STRING'));
can_i_move();
switch ($location[0]) {
case 'cp':
move_to_inside(20, 'Центральную площадь');
break;
case 'strah':
move_to_inside(21, 'Страшилкину Улицу');
break;
case 'bps':
move_to_inside(26, 'Большую Парковую улицу');
break;
case 'ps':
move_to_inside(51, 'Парковую улицу');
break;
case 'zaliv':
move_to_inside(2111, 'Ристалище');
break;
case 'zamk':
move_to_inside(2601, 'Замковую площадь');
break;
case 'abog':
move_to_inside(2655, 'Арену Богов');
break;
case 'torg':
move_to_inside(2702, 'Торговую улицу');
break;
case 'got':
if ($user['room'] == 20) {
switch ($location[1]) {
case 'level1':
header('location: main.php?setch=1');
die();
break;
case 'level7':
header('location: city.php?strah');
break;
case 'level8':
header('location: city.php?bps');
break;
case 'level13':
header('location: quest_room.php');
break;
case 'level222':
header('location: city.php?torg');
break;
case 'level17':
move_to_outside(50, 'ashop.php');
break;
case 'level2':
move_to_outside(22, 'shop.php');
break;
case 'level4':
move_to_outside(23, 'repair.php');
break;
case 'level10':
move_to_outside(35, 'krshop.php');
break;
case 'level9':
move_to_outside(24, 'elka.php');
break;
case 'level6':
move_to_outside(27, 'post.php');
break;
case 'level3':
move_to_outside(26, 'comission.php');
break;
}
} elseif ($user['room'] == 21) {
switch ($location[1]) {
case 'level4':
header('location: city.php?cp');
break;
case 'level3':
header('location: city.php?zaliv');
break;
case 'level13':
move_to_outside(34, 'fshop.php');
break;
case 'level5':
move_to_outside(29, 'bank.php');
break;
case 'level16':
move_to_outside(31, 'tower.php');
break;
case 'level14':
move_to_outside(30, 'klanedit.php');
break;
case 'level650':
move_to_outside(650, 'ul_clans.php');
break;
}
} elseif ($user['room'] == 2111) {
switch ($location[1]) {
case 'level1':
header('location: city.php?strah');
break;
case 'level2':
header('location: city.php?haos');
break;
case 'level203':
move_to_outside(1055, 'group_arena.php');
break;
case 'level1000':
move_to_outside(620, 'enter_cave.php');
break;
case 'room666':
move_to_outside(666, 'jail.php');
break;
case 'level5':
move_to_outside(203, 'church.php');
break;
}
} elseif ($user['room'] == 2601) {
switch ($location[1]) {
case 'level4':
header('location: city.php?bps');
break;
case 'level55':
header('location: city.php?abog');
break;
case 'level21':
move_to_outside(87, 'dshop.php');
break;
case 'level10':
move_to_outside(35, 'krshop.php');
break;
case 'level44':
move_to_outside(203, 'church.php');
break; /*FIXME Второй вход в церковь?*/
case 'level1':
move_to_outside(37, 'gotzamok.php');
break;
case 'level1052':
move_to_outside(1053, 'repshop.php');
break;
case 'level1051':
move_to_outside(1051, 'lab_enter.php');
break;
case 'level5':
move_to_outside(404, 'vxod.php');
break;
}
} elseif ($user['room'] == 2701) {
switch ($location[1]) {
case 'level1':
header('location: city.php?zaliv');
break;
case 'level2':
move_to_outside(402, 'lab_chaos_enter.php');
break;
}
} elseif ($user['room'] == 2702) {
switch ($location[1]) {
case 'level10':
header('location: city.php?cp');
break;
case 'level5':
move_to_outside(1054, 'fontan_luck.php');
break;
case 'level202':
move_to_outside(1054, 'fontan_luck.php');
break;
case 'level6':
move_to_outside(61, 'akadem.php');
break;
}
} elseif ($user['room'] == 2655) {
switch ($location[1]) {
case 'level10':
header('location: city.php?zamk');
break;
case 'level2055':
move_to_outside(603, 'aren_of_angels.php');
break;
}
} elseif ($user['room'] == 26) {
switch ($location[1]) {
case 'level4':
header('location: city.php?cp');
break;
case 'level3':
header('location: city.php?zamk');
break;
case 'level5':
move_to_outside(43, 'znahar.php');
break;
case 'level660':
move_to_outside(660, 'hostel.php');
break;
case 'level20':
move_to_outside(223, 'bench.php');
break;
case 'level21':
move_to_outside(222, 'bench_s.php');
break;
case 'level22':
move_to_outside(224, 'bench_m.php');
break;
case 'level7':
move_to_outside(777, 'obshaga.php');
break;
case 'level11':
move_to_outside(42, 'lotery.php');
break;
// case 'level5':
// move_to_outside(401, 'hell.php');
// break;
// case 'level6':
// move_to_outside(110, 'jackill.php');
// break;
}
}
break;
}
$online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time() - 60));
?>
Сейчас в игре : = $online->getNumRows() ?> игроков. | ||
= 3 && $todayMonth <= 5) return 'spring_';
elseif ($todayMonth >= 6 && $todayMonth <= 8) return 'summer_';
elseif ($todayMonth >= 9 && $todayMonth <= 11) return 'autumn_';
else return 'winter_';
}
function buildset_old($id, $img, $top, $left, $des, $noSeason = 0)
{
if (!$noSeason) $img = getSeason() . $img;
?>
![]() ![]() ![]() |