Больше нельзя телепортироваться в поединки.

This commit is contained in:
lopar 2020-10-27 01:43:54 +02:00
parent 5ec1219b04
commit c937f7a0ba

145
main.php
View File

@ -50,7 +50,7 @@ while ($row = $data->fetch_assoc()) {
}
//Обработчики нажатий на кнопки.
if ($_POST['battlefield'] ?? 0) {
if ($_POST['battlefield'] ?? 0 && $user->room == 1) {
header('Location: zayavka.php');
exit();
}
@ -62,7 +62,7 @@ if ($_POST['move_inside'] ?? 0 && $user->room == 20) {
header('Location: main.php?goto=arena');
exit();
}
if ($_POST['move_outside'] ?? 0 && $user->room != 20) {
if ($_POST['move_outside'] ?? 0 && $user->room == 1) {
header('Location: main.php?goto=plo');
exit();
}
@ -71,137 +71,138 @@ if ($_POST['main_page'] ?? 0) {
exit();
}
/* === проверяем соответствие комнаты и скрипта === */
if (in_array($user->room, [20, 21, 26, 48, 51, 52, 651, 2655, 2601, 2701, 2702, 2111], 1)) {
if ($edit === null) {
/* === проверяем соответствие комнаты и скрипта === */
if (in_array($user->room, [20, 21, 26, 48, 51, 52, 651, 2655, 2601, 2701, 2702, 2111])) {
header('Location: city.php');
exit();
}
if ($user->room == 22) {
}
if ($user->room == 22) {
header('Location: shop.php');
exit();
}
if ($user->room == 23) {
}
if ($user->room == 23) {
header('Location: repair.php');
exit();
}
if ($user->room == 25) {
}
if ($user->room == 25) {
header('Location: comission.php');
exit();
}
if ($user->room == 27) {
}
if ($user->room == 27) {
header('Location: post.php');
exit();
}
if ($user->room == 29) {
}
if ($user->room == 29) {
header('Location: bank.php');
exit();
}
if ($user->room == 31) {
}
if ($user->room == 31) {
header('Location: tower.php');
exit();
}
if ($user->room == 30) {
}
if ($user->room == 30) {
header('Location: clan_create.php');
exit();
}
if ($user->room == 34) {
}
if ($user->room == 34) {
header('Location: fshop.php');
exit();
}
if ($user->room == 45) {
}
if ($user->room == 45) {
header('Location: clan_castle.php');
exit();
}
if ($user->room == 50) {
}
if ($user->room == 50) {
header('Location: ashop.php');
exit();
}
if ($user->room == 53) {
}
if ($user->room == 53) {
header('Location: library.php');
exit();
}
if ($user->room == 61) {
}
if ($user->room == 61) {
header('Location: akadem.php');
exit();
}
if ($user->room == 650) {
}
if ($user->room == 650) {
header('Location: ul_clans.php');
exit();
}
}
//ЦХ
if ($user->room == 600) {
if ($user->room == 600) {
header('Location: c_haos.php');
exit();
}
if ($user->room == 601) {
}
if ($user->room == 601) {
header('Location: c_haos_in.php');
exit();
}
if ($user->room == 602) {
}
if ($user->room == 602) {
header('Location: c_park.php');
exit();
}
if ($user->room == 603) {
}
if ($user->room == 603) {
header('Location: aren_of_angels.php');
exit();
}
if ($user->room == 620) {
}
if ($user->room == 620) {
header('Location: enter_cave.php');
exit();
}
if ($user->room == 621) {
}
if ($user->room == 621) {
header('Location: cave.php');
exit();
}
if ($user->room == 660) {
}
if ($user->room == 660) {
header('Location: hostel.php');
exit();
}
if ($user->room == 661) {
}
if ($user->room == 661) {
header('Location: hostel_room.php');
exit();
}
if ($user->room == 662) {
}
if ($user->room == 662) {
header('Location: quest_room.php');
exit();
}
if ($user->room == 760) {
}
if ($user->room == 760) {
header('Location: c_forest.php');
exit();
}
if ($user->room == 1000) {
}
if ($user->room == 1000) {
header('Location: solib/enterbezdna.php');
exit();
}
if ($user->room == 1001) {
}
if ($user->room == 1001) {
header('Location: solib/dungeon.php');
exit();
}
if ($user->room == 1051) {
}
if ($user->room == 1051) {
header('Location: lab_enter.php');
exit();
}
if ($user->room == 1052) {
}
if ($user->room == 1052) {
header('Location: labirint.php');
exit();
}
if ($user->room == 402) {
}
if ($user->room == 402) {
header('Location: vxod.php');
exit();
}
if ($user->room == 403) {
}
if ($user->room == 403) {
header('Location: canalizaciya.php');
exit();
}
if ($user->room == 1055) {
}
if ($user->room == 1055) {
header('Location: group_arena.php');
exit();
}
if ($user->room == 666) {
}
if ($user->room == 666) {
header('Location: jail.php');
exit();
}
}
function del_efs($id, $type)
{
if ($id && !in_array($type, [2, 3, 4, 5, 8, 10, 11, 12, 13, 14, 20])) {
@ -308,14 +309,14 @@ if ($goto) {
err('У вас тяжелая травма, вы не можете передвигатся...');
$imove = false;
}
if ($goto == 'plo' && !$user->zayavka && $imove == true && $user->room != 20) {
if ($goto == 'plo' && !$user->zayavka && $imove && $user->room != 20) {
db::c()->query('UPDATE users, online SET users.room = 20, online.room = 20 WHERE online.user_id = users.id AND online.user_id = ?i', $_SESSION['uid']);
header('Location: city.php');
exit("<i>Топ-топ-топ...</i>");
} else {
err('Подали заявку на бой и убегаете из клуба? Нехорошо...');
}
if ($goto == 'arena' && $user->room == 20 && $imove == true) {
if ($goto == 'arena' && $user->room == 20 && $imove) {
db::c()->query('UPDATE users, online SET users.room = 1, online.room = 1 WHERE online.user_id = users.id AND online.user_id = ?i', $_SESSION['uid']);
header('Location: main.php');
exit("<i>Топ-топ-топ...</i>");
@ -559,13 +560,13 @@ Template::header('Игра');
title="Образы">
<?php endif; ?>
<div class="button-group">
<input class="button primary" type="submit" name="battlefield" value="Поединки">
<input class="button" type="submit" name="module_quest" value="Активные задания">
<?php if ($user->room == 20): ?>
<input class="button icon move" type="submit" name="move_inside" value="Войти внутрь">
<?php else: ?>
<?php elseif ($user->room == 1): ?>
<input class="button primary" type="submit" name="battlefield" value="Поединки">
<input class="button icon move" type="submit" name="move_outside" value="Выйти на улицу">
<?php endif; ?>
<input class="button" type="submit" name="module_quest" value="Активные задания">
<input class="button" type="submit" name="main_page" value="На главную">
</div>
</div>