Проверки с перенаправлениями переехали в functions.php. Глобальный выход если нет сессии в config.php.
This commit is contained in:
+28
-28
@@ -1,34 +1,34 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
|
||||
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '3' ;"));
|
||||
if ($user['intel'] >= 2) {
|
||||
$int=$magic['chanse'] + ($user['intel'] - 2)*3;
|
||||
if ($int>98){$int=99;}
|
||||
}
|
||||
else {$int=0;}
|
||||
|
||||
if (rand(1,100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '3' ;"));
|
||||
if ($user['intel'] >= 2) {
|
||||
$int = $magic['chanse'] + ($user['intel'] - 2) * 3;
|
||||
if ($int > 98) {
|
||||
$int = 99;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = '{$target}' AND `needident` = 1 LIMIT 1;"));
|
||||
if (mysql_query("UPDATE `inventory` SET `needident` = 0 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$target}\" удачно идентифицирован <b></font>";
|
||||
$bet=1;
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета<b></font>";
|
||||
}
|
||||
} else
|
||||
{
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet=1;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = '{$target}' AND `needident` = 1 LIMIT 1;"));
|
||||
if (mysql_query("UPDATE `inventory` SET `needident` = 0 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$target}\" удачно идентифицирован <b></font>";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user