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

This commit is contained in:
lopar 2020-10-27 01:43:54 +02:00
parent 5ec1219b04
commit c937f7a0ba
1 changed files with 137 additions and 136 deletions

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,8 +71,9 @@ if ($_POST['main_page'] ?? 0) {
exit();
}
if ($edit === null) {
/* === проверяем соответствие комнаты и скрипта === */
if (in_array($user->room, [20, 21, 26, 48, 51, 52, 651, 2655, 2601, 2701, 2702, 2111], 1)) {
if (in_array($user->room, [20, 21, 26, 48, 51, 52, 651, 2655, 2601, 2701, 2702, 2111])) {
header('Location: city.php');
exit();
}
@ -201,7 +202,7 @@ 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>