Файл: ohot.php
Строк: 59
<?
define('PROTECTOR', 1);
include('files/db.php');
include($path.'files/auth.php');
if ($user_id==0){
header('location: index.php');exit;
}
$textl='Приключения';
include($path.'files/core.php');
$blok=mysql_query("SELECT * FROM `bot_blok` WHERE `usr`='".$udata['id']."'");
$bl=mysql_num_rows($blok);
if($bl!=0)
{
$bqt=mysql_fetch_array($blok);
$bqt['time']=$bqt['time']-time();
if($bqt['time']<60){
$qqq = $bqt['time']." с.</font>";
}elseif($bqt['time']>60 and $bqt['time']<3600){
$bqt['time']=round($bqt['time']/60);
$qqq = $bqt['time']." м.</font>";
}else{
$bqt['time']=round($bqt['time']/3600);
$qqq = $bqt['time']." ч.</font>";
}
mysql_query("INSERT INTO `user_log` SET `usr`='".$udata['id']."', `text`='Вам заблокирован доступ в боевые режимы еще ".$qqq."'");
header('location: game.php');exit;
}
$mobs=mysql_query("SELECT * FROM `craft` WHERE `usr`='".$udata['id']."'");
$rows=mysql_num_rows($mobs);
if($rows!=0)
{
header('location: work.php');exit;
}
$mobs1=mysql_query("SELECT * FROM `arena_usr` WHERE `usr`='".$udata['id']."'");
$rows1=mysql_num_rows($mobs1);
if($rows1!=0)
{
header('location: arena.php');exit;
}
$mobs2=mysql_query("SELECT * FROM `avan_usr` WHERE `usr`='".$udata['id']."'");
$rows2=mysql_num_rows($mobs2);
if($rows2!=0)
{
header('location: avan.php');exit;
}
$mobs3=mysql_query("SELECT * FROM `battle` WHERE `usr`='".$udata['id']."'");
$rows3=mysql_num_rows($mobs3);
if($rows3!=0)
{
header('location: battle.php');exit;
}
$mobs5=mysql_query("SELECT * FROM `okr_usr` WHERE `usr`='".$udata['id']."'");
$rows5=mysql_num_rows($mobs5);
if($rows5!=0)
{
header('location: b_okr.php');exit;
}
$mobs6=mysql_query("SELECT * FROM `str_usr` WHERE `usr`='".$udata['id']."'");
$rows6=mysql_num_rows($mobs6);
if($rows6!=0)
{
header('location: b_str.php');exit;
}
$mobs7=mysql_query("SELECT * FROM `terr_usr` WHERE `usr`='".$udata['id']."'");
$rows7=mysql_num_rows($mobs7);
if($rows7!=0)
{
header('location: terr_b.php');exit;
}
$arr_usr=mysql_num_rows(mysql_query("SELECT * FROM `ohota` WHERE `usr`='".$udata['id']."'"));
if($arr_usr!=0)
{
header('location: b_oh.php');exit;
}
if($udata['ohot']<time())
{
if($udata['lvl']<16)
{
$hp=7*$udata['lvl'];
$sila=4*$udata['lvl'];
$arm=4*$udata['lvl'];
}
if($udata['lvl']>=16 and $udata['lvl']<31)
{
$hp=(7+2)*$udata['lvl'];
$sila=4*$udata['lvl'];
$arm=4*$udata['lvl'];
}
if($udata['lvl']>=31 and $udata['lvl']<39)
{
$hp=(7+4)*$udata['lvl'];
$sila=4*$udata['lvl'];
$arm=4*$udata['lvl'];
}
if($udata['lvl']>=39)
{
$hp=(7+5)*$udata['lvl'];
$sila=4*$udata['lvl'];
$arm=4*$udata['lvl'];
}
$sila=$sila/5;
$arm=$arm/15;
$tim=time()+rand(0,5);
mysql_query("INSERT INTO `ohota` SET
`id`='',
`usr`='".$udata['id']."',
`tip`='ohot',
`hp`='".$udata['hp']."',
`arm`='".$udata['arm']."',
`sila`='".$udata['sila']."',
`time_us`='0',
`status`='0',
`enemy`='0',
`volna`='1'
");
$tr=mysql_query("SELECT * FROM `pit` WHERE `usr`='".$udata['id']."' and `status`='1'");
$num=mysql_num_rows($tr);
if($num!=0)
{
$t=mysql_fetch_array($tr);
mysql_query("INSERT INTO `ohota` SET
`id`='',
`usr`='".$udata['id']."',
`tip`='pit',
`pit`='".$t['id']."',
`hp`='".$t['hp']."',
`arm`='".$t['arm']."',
`sila`='".$t['sila']."',
`time_us`='0',
`status`='0',
`enemy`='0',
`volna`='1'
");
}
mysql_query("INSERT INTO `ohota_mob` SET
`id`='',
`usr`='".$udata['id']."',
`name`='Волк',
`img`='1',
`sila`='".$sila."',
`hp`='".$hp."',
`arm`='".$arm."',
`time`='".$tim."'
");
header('location: b_oh.php');exit;
}
else
{
include($path.'files/head.php');
include($path.'files/zag.php');
echo '<div class="v3 bts brs bls b p v12">Навигация</div><div class="v4 bts brs bls bbs p">
<img src=img/main/i26.png class="menu"> <a href=game.php>главная</a> / <a href=?>охота</a>
</div>';
echo '<div class="v8"><div class="v3 bts brs bls b p v12">Охота</div><div class="v2 brs bls bbs p" align=center><font color=#ff0000>Вы недавно посещали охоту! Приходите позже!</font>';
echo '</div></div>';
include('files/down.php');
}
?>