query('UPDATE `users`,`online` SET `users`.`room` = 20, `online`.`room` = 20 WHERE `users`.`id` = ?i AND `online`.`id` = ?i', $_SESSION['uid'], $_SESSION['uid']); header('Location: city.php'); } if ($get == 'hps') { db::c()->query('UPDATE `users` SET `hp` = `maxhp` WHERE `id` = ?i', $_SESSION['uid']); $status = 'Вы исцелились!'; } if (isset($_GET['quid'])) { $pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `delete` = "0" AND `min_lvl` <= "' . $user['level'] . '" AND `max_lvl` >= "' . $user['level'] . '" AND `id` = "' . mysql_real_escape_string($_GET['quid']) . '" LIMIT 1')); if (isset($pl['id']) && $q->testGood($pl, $user['id']) == 1) { echo $q->startq($pl['id'], $user['id']); } elseif ($q->testGood($pl, $user['id']) == 2) { $status = 'У вас уже есть такое задание ...'; } elseif ($q->testGood($pl, $user['id']) == 3) { $status = 'Необходимо завершить квесты ...'; } elseif ($q->testGood($pl, $user['id']) == 4) { $status = 'Задержка на выполнение задания ...'; } elseif ($q->testGood($pl, $user['id']) == 5) { $status = 'Достигнут лимит выполнения заданий ...'; } else { $status = $q->testGood($pl, $user['id']); } } $questList = ''; $sp = db::c()->query('SELECT * FROM `quests` WHERE `delete` = 0 ORDER BY `id` DESC'); while ($pl = $sp->fetch_assoc()) $questList .= $q->list_quest($pl, $user['id']); if (empty($questList)) $questList = 'Нет заданий.'; function info_quest($id) { $sp = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "' . $id . '" LIMIT 1')); if (isset($sp['id'])) { return $sp; } else { return null; } } if (!empty($q->error)) $status = $q->error; ?>