Файл: neb.php
Строк: 42
<?
define('PROTECTOR', 1);
include('files/db.php');
include($path.'files/auth.php');
$mobs=mysql_query("SELECT * FROM `nebes` WHERE `tip`='boss' and `etaz`='1'");
$mob=mysql_fetch_array($mobs);
if($mob['time']<time())
{
$mobs1=mysql_query("SELECT * FROM `nebes` WHERE `tip`='mob' and `etaz`='1'");
$mob1=mysql_fetch_array($mobs1);
$neb_mob_num1=mysql_num_rows(mysql_query("SELECT * FROM `nebes_mob` WHERE `etaz`='1' and `tip`='mob'"));
if($neb_mob_num1==0)
{
for($neb_mob_num1=0; $neb_mob_num1++<$mob1['kol'];)
{
mysql_query("INSERT INTO `nebes_mob` SET
`id`='',
`etaz`='".$mob1['etaz']."',
`tip`='mob',
`name`='".$mob1['name']."',
`img`='".$mob1['img']."',
`hp`='".$mob1['hp']."',
`arm`='".$mob1['arm']."',
`sila`='".$mob1['sila']."'
");
}
}
$mobs2=mysql_query("SELECT * FROM `nebes` WHERE `tip`='boss' and `etaz`='1'");
$mob2=mysql_fetch_array($mobs2);
$neb_mob_num2=mysql_num_rows(mysql_query("SELECT * FROM `nebes_mob` WHERE `etaz`='1' and `tip`='boss'"));
if($neb_mob_num2==0)
{
for($neb_mob_num2=0; $neb_mob_num2++<$mob2['kol'];)
{
mysql_query("INSERT INTO `nebes_mob` SET
`id`='',
`etaz`='".$mob2['etaz']."',
`tip`='boss',
`name`='".$mob2['name']."',
`img`='".$mob2['img']."',
`hp`='".$mob2['hp']."',
`arm`='".$mob2['arm']."',
`sila`='".$mob2['sila']."'
");
}
}
}
echo 'Готово '.$neb_mob_num1.'<br>'.$neb_mob_num2;
?>