Файл: html/huntb/1x1_open/search.php
Строк: 92
<?php
require_once '../../system/func.php';
if (isset($user['level']) && $user['level'] < 2) {
?>
<script>/*nextshowcontemt*/showContent("/main.php?msg=" + decodeURI("Не доступно до 2 уровня ."));</script>
<?php
exit(0);
}
if (isset($user['vinos_m']) && $user['vinos_m']<=0) {
?>
<script>/*nextshowcontemt*/showContent("/main.php?msg=" + decodeURI("Недостаточно выносливости."));</script>
<?php
exit(0);
}
if (isset($user['temp_health']) && $user['temp_health']<=0) {
?>
<script>/*nextshowcontemt*/showContent("/main.php?msg=" + decodeURI("Недостаточно здоровья."));</script>
<?php
exit(0);
}
?>
<center>
<div>-Поиск противника-</div>
<br>
<div class="info"></div>
<br>
<div class="button_alt_01" onclick="huntb_remove()">отказаться</div>
</center>
<script>
function huntb_remove() {
try {
$.ajax({
type: "POST",
url: "../../huntb/1x1_open/remove.php",
dataType: "json",
success: function (data) {
if (data.result == 1) {
clearTimeout(MyLib.setTimeoutHuntB);
showContent("/");
} else {
alert("error 1765445");
}
},
error: function (e) {
alert("error 141323");
}
});
} catch (e) {
alert("error 11252345634");
}
}
huntb_add("2");
function huntb_add(x) {
try {
$.ajax({
type: "POST",
url: "../../huntb/1x1_open/add.php",
dataType: "json",
data: {
type: x
},
success: function (data) {
if (data.result == 1) {
setTimeHuntB();
} else {
alert("error 1665454");
//showContent("/");
}
},
error: function (e) {
alert("error 15467343");
//showContent("/");
}
});
} catch (e) {
alert("error 1412");
//showContent("/");
}
}
var text = "";
var count = 0;
var inbattle = 0;
function setTimeHuntB() {
clearTimeout(MyLib.setTimeoutHuntB);
if (count >= 5) {
text = ".";
count = 0;
} else {
count++;
text += ".";
}
try {
$.ajax({
type: "POST",
url: "../../huntb/1x1/check.php",
dataType: "json",
success: function (data) {
if (data.result == 1 || inbattle == 1) {
//здесь переход к бою если бой создан
showContent('/hunt/battle.php');
} else if (data.result != 0 && data.error != 0) {
alert("error " + data.error + " setTimeHuntB");
showContent('/');
} else {
if (data.time > 0) {
$(".info").html("Идет поиск противника " + data.time + text);
} else {
inbattle = 1;
$(".info").html("В БОЙ !!!");
}
MyLib.setTimeoutHuntB = setTimeout(function () {
setTimeHuntB();
}, 1000);
}
},
error: function (e) {
alert("error 1554");
showContent('/');
}
});
} catch (e) {
alert("error 1556");
showContent('/');
}
}
;
</script>
<?php
$footval = "huntb1x1";
require_once ('../../system/foot/foot.php');