$rost=mysql_fetch_array(mysql_query("SELECT `user_id` FROM `labirint` WHERE `glava`='{$glava}' and `login`='".mysql_escape_string($_GET['kill'])."'"));
$varsa=mysql_fetch_array(mysql_query("SELECT id FROM `users` WHERE `login` = '".mysql_escape_string($_GET['kill'])."' LIMIT 1;"));
if($varsaand$rost){
if($_GET['kill']!=$glava){
mysql_query("DELETE FROM labirint WHERE login='".mysql_escape_string($_GET['kill'])."'");
//mysql_query("DELETE FROM `inventory` WHERE name='Бутерброд' and owner='".$varsa['id']."' and podzem='1'");
}else{print"<font style='font-size:12px; color:#cc0000'>Себя нельзя выгнать.</font>";}
}else{print"<font style='font-size:12px; color:#cc0000'>Такого логина не существует или он не в вашей группе.</font>";}
}}
//smena lider
if($_GET['change']){
if($user['login']==$glava){
$rost=mysql_fetch_array(mysql_query("SELECT `user_id` FROM `labirint` WHERE `glava`='$glava' and `login`='".mysql_escape_string($_GET['change'])."'"));
$varsa=mysql_fetch_array(mysql_query("SELECT id FROM `users` WHERE `login` = '".mysql_escape_string($_GET['change'])."' LIMIT 1;"));
if($varsaand$rost){
if($_GET['change']!=$glava){
mysql_query("UPDATE labirint SET glav_id='".$varsa['id']."',glava='".$_GET['change']."' WHERE glava='".$user['login']."'");
mysql_query("UPDATE podzem3 SET glava='".$_GET['change']."' WHERE glava='".$user['login']."'");
mysql_query("UPDATE `labirint` SET el='1' WHERE `glava`='".$glava."' and `login`='".$user['login']."'");
print" <font style='font-size:12px; color:red;'>Вы получили 'Подземное зелье жизни'</font><br>";
}else{
if($mir['el']=='1'){print" <font style='font-size:12px; color:red;'>Вы уже брали зелье!</font><br>";}
else{print" <font style='font-size:12px; color:red;'>Невозможно! Вы далеко!</font><br>";}}
}
///////////////Сбор чистых гаек/////////////
if($_GET['sun']=='se_gaika_c'){
$ferrr=mysql_query("SELECT n$mesto FROM `podzem3` WHERE glava='$glava' and name='".$mir['name']."'");
$retr=mysql_fetch_array($ferrr);
$stloc=$retr["n$mesto"];
if($stloc=='508'or$stloc=='507'or$stloc=='506'){
if($stloc=='508'){mysql_query("UPDATE `podzem3` SET n$mesto='507' WHERE glava='$glava' and name='".$mir['name']."'");}
if($stloc=='507'){mysql_query("UPDATE `podzem3` SET n$mesto='506' WHERE glava='$glava' and name='".$mir['name']."'");}
if($stloc=='506'){mysql_query("UPDATE `podzem3` SET n$mesto='' WHERE glava='$glava' and name='".$mir['name']."'");}
$f=mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Чистая гайка'");
if($g=mysql_fetch_array($f)){
$koll=$g["maxdur"];
mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.1 WHERE owner='".$user['id']."' and `type`='200' and `name`='Чистая гайка'");
}else{
$fo=mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Чистая гайка','1','g_c.gif','".$user['id']."','200','0.1','0','Лука')");
}
$mis="Чистая гайка";
include"podzem_brat.php";
print" <font style='font-size:12px; color:cc0000;'>Вы получили 'Чистая гайка'</font>";
}else{if($stloc==''){print" <font style='font-size:12px; color:cc0000;'>Кто-то оказался быстрее!</font>";}}
}
///////////////Сбор гаек/////////////
if($_GET['sun']=='gaika'){
$ferrr=mysql_query("SELECT n$mesto FROM `podzem3` WHERE glava='$glava' and name='".$mir['name']."'");
$retr=mysql_fetch_array($ferrr);
$stloc=$retr["n$mesto"];
if($stloc=='503'or$stloc=='502'or$stloc=='501'){
if($stloc=='503'){mysql_query("UPDATE `podzem3` SET n$mesto='502' WHERE glava='$glava' and name='".$mir['name']."'");}
if($stloc=='502'){mysql_query("UPDATE `podzem3` SET n$mesto='501' WHERE glava='$glava' and name='".$mir['name']."'");}
if($stloc=='501'){mysql_query("UPDATE `podzem3` SET n$mesto='' WHERE glava='$glava' and name='".$mir['name']."'");}
$f=mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Гайка'");
if($g=mysql_fetch_array($f)){
$koll=$g["maxdur"];
mysql_query("UPDATE `inventory` SET maxdur=maxdur+1, massa=massa+0.1 WHERE owner='".$user['id']."' and `type`='200' and `name`='Гайка'");
}else{
$fo=mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Гайка','1','g.gif','".$user['id']."','200','0.1','0','Лука')");
}
$mis="Гайка";
include"podzem_brat.php";
print" <font style='font-size:12px; color:cc0000;'>Вы получили 'Гайка'</font>";
}else{if($stloc==''){print" <font style='font-size:12px; color:cc0000;'>Кто-то оказался быстрее!</font>";}}
}
/////////////////////////////////////
///////////////Сбор вентилей/////////////
if($_GET['sun']=='ventil'){
$ferrr=mysql_query("SELECT n$mesto FROM `podzem3` WHERE glava='$glava' and name='".$mir['name']."'");
$retr=mysql_fetch_array($ferrr);
$stloc=$retr["n$mesto"];
if($stloc=='504'or$stloc=='505'or$stloc=='506'){
if($stloc=='506'){mysql_query("UPDATE `podzem3` SET n$mesto='505' WHERE glava='$glava' and name='".$mir['name']."'");}
if($stloc=='505'){mysql_query("UPDATE `podzem3` SET n$mesto='504' WHERE glava='$glava' and name='".$mir['name']."'");}
if($stloc=='504'){mysql_query("UPDATE `podzem3` SET n$mesto='' WHERE glava='$glava' and name='".$mir['name']."'");}
$f=mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Вентиль'");
if($g=mysql_fetch_array($f)){
$koll=$g["maxdur"];
mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.2 WHERE owner='".$user['id']."' and `type`='200' and `name`='Вентиль'");
}else{
$fo=mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Вентиль','1','v.gif','".$user['id']."','200','0.2','0','Лука')");
}
$mis="Вентиль";
include"podzem_brat.php";
print" <font style='font-size:12px; color:cc0000;'>Вы получили 'Вентиль'</font>";
}else{if($stloc==''){print" <font style='font-size:12px; color:cc0000;'>Кто-то оказался быстрее!</font>";}}
}
///////////////Сбор Чистых вентилей/////////////
if($_GET['sun']=='se_ventil'){
$ferrr=mysql_query("SELECT n$mesto FROM `podzem3` WHERE glava='$glava' and name='".$mir['name']."'");
$retr=mysql_fetch_array($ferrr);
$stloc=$retr["n$mesto"];
if($stloc=='512'or$stloc=='513'or$stloc=='514'){
if($stloc=='514'){mysql_query("UPDATE `podzem3` SET n$mesto='513' WHERE glava='$glava' and name='".$mir['name']."'");}
if($stloc=='513'){mysql_query("UPDATE `podzem3` SET n$mesto='512' WHERE glava='$glava' and name='".$mir['name']."'");}
if($stloc=='512'){mysql_query("UPDATE `podzem3` SET n$mesto='' WHERE glava='$glava' and name='".$mir['name']."'");}
$f=mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Чистый вентиль'");
if($g=mysql_fetch_array($f)){
$koll=$g["maxdur"];
mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.4 WHERE owner='".$user['id']."' and `type`='200' and `name`='Чистый вентиль'");
}else{
$fo=mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Чистый вентиль','1','v2.gif','".$user['id']."','200','0.4','0','Лука')");
}
$mis="Чистый вентиль";
include"podzem_brat.php";
print" <font style='font-size:12px; color:cc0000;'>Вы получили 'Чистый вентиль'</font>";
}else{if($stloc==''){print" <font style='font-size:12px; color:cc0000;'>Кто-то оказался быстрее!</font>";}}
}
/////////////////////////////////////
///////////////Сбор Болтов/////////////
if($_GET['sun']=='bolt'){
$ferrr=mysql_query("SELECT n$mesto FROM `podzem3` WHERE glava='$glava' and name='".$mir['name']."'");
$retr=mysql_fetch_array($ferrr);
$stloc=$retr["n$mesto"];
if($stloc=='507'or$stloc=='508'or$stloc=='509'){
if($stloc=='509'){mysql_query("UPDATE `podzem3` SET n$mesto='508' WHERE glava='$glava' and name='".$mir['name']."'");}
if($stloc=='508'){mysql_query("UPDATE `podzem3` SET n$mesto='507' WHERE glava='$glava' and name='".$mir['name']."'");}
if($stloc=='507'){mysql_query("UPDATE `podzem3` SET n$mesto='' WHERE glava='$glava' and name='".$mir['name']."'");}
$f=mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Болт'");
if($g=mysql_fetch_array($f)){
$koll=$g["maxdur"];
mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.1 WHERE owner='".$user['id']."' and `type`='200' and `name`='Болт'");
}else{
$fo=mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Болт','1','bolt.gif','".$user['id']."','200','0.1','0','Лука')");
}
$mis="Болт";
include"podzem_brat.php";
print" <font style='font-size:12px; color:cc0000;'>Вы получили 'Болт'</font>";
}else{if($stloc==''){print" <font style='font-size:12px; color:cc0000;'>Кто-то оказался быстрее!</font>";}}
}
///////////////Сбор Длинных Болтов/////////////
if($_GET['sun']=='se_gaika_bd'){
$ferrr=mysql_query("SELECT n$mesto FROM `podzem3` WHERE glava='$glava' and name='".$mir['name']."'");
$retr=mysql_fetch_array($ferrr);
$stloc=$retr["n$mesto"];
if($stloc=='511'or$stloc=='510'or$stloc=='509'){
if($stloc=='511'){mysql_query("UPDATE `podzem3` SET n$mesto='510' WHERE glava='$glava' and name='".$mir['name']."'");}
if($stloc=='510'){mysql_query("UPDATE `podzem3` SET n$mesto='509' WHERE glava='$glava' and name='".$mir['name']."'");}
if($stloc=='509'){mysql_query("UPDATE `podzem3` SET n$mesto='' WHERE glava='$glava' and name='".$mir['name']."'");}
$f=mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Длинный болт'");
if($g=mysql_fetch_array($f)){
$koll=$g["maxdur"];
mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.2 WHERE owner='".$user['id']."' and `type`='200' and `name`='Длинный болт'");
}else{
$fo=mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Длинный болт','1','dbolt.gif','".$user['id']."','200','0.2','0','Лука')");
}
$mis="Длинный болт";
include"podzem_brat.php";
print" <font style='font-size:12px; color:cc0000;'>Вы получили 'Длинный болт'</font>";
}else{if($stloc==''){print" <font style='font-size:12px; color:cc0000;'>Кто-то оказался быстрее!</font>";}}
}
/////////////////////////////////////
///////////////Сбор ключиик/////////////
if($_GET['sun']=='kluchiik'){
$ferrr=mysql_query("SELECT n$mesto FROM `podzem3` WHERE glava='$glava' and name='".$mir['name']."'");
$retr=mysql_fetch_array($ferrr);
$stloc=$retr["n$mesto"];
if($stloc=='510'){
if($stloc=='510'){mysql_query("UPDATE `podzem3` SET n$mesto='' WHERE glava='$glava' and name='".$mir['name']."'");}
$fo=mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Ключиик','1','kluchik.gif','".$user['id']."','200','0.5','0','Лука')");
$mis="Ключиик";
include"podzem_brat.php";
print" <font style='font-size:12px; color:cc0000;'>Вы получили 'Ключиик'</font>";
}else{if($stloc==''){print" <font style='font-size:12px; color:cc0000;'>Кто-то оказался быстрее!</font>";}}
}
/////////////////////////////////////
///////////////Сбор сундуков/////////////
if($_GET['act']=='sunduk'){
$ferrr=mysql_query("SELECT n".$_GET['n']." FROM `podzem4` WHERE glava='$glava' and name='".$mir['name']."'");
if($stloc=='13.1'){mysql_query("UPDATE `podzem4` SET n".$_GET['n']."='13.0' WHERE glava='$glava' and name='".$mir['name']."'");}
$f=mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Гайка'");
if($g=mysql_fetch_array($f)){
$koll=$g["maxdur"];
mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.1 WHERE owner='".$user['id']."' and `type`='200' and `name`='Гайка'");
}else{
$fo=mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Гайка','1','g.gif','".$user['id']."','200','0.1','0','Лука')");
}
$mis="Гайка";
include"podzem_brat.php";
print" <font style='font-size:12px; color:cc0000;'>Вы получили 'Гайка'</font>";
}
}else{if($stloc=='13.0'){print" <font style='font-size:12px; color:cc0000;'>Кто-то оказался быстрее!</font>";}}
}
/////////////////////////////////////
///////////////Сбор сундуков (БОЛТ)/////////////
if($_GET['act']=='sunduk2'){
$ferrr=mysql_query("SELECT n".$_GET['n']." FROM `podzem4` WHERE glava='$glava' and name='".$mir['name']."'");
if($stloc=='14.1'){mysql_query("UPDATE `podzem4` SET n".$_GET['n']."='14.0' WHERE glava='$glava' and name='".$mir['name']."'");}
$f=mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Болт'");
if($g=mysql_fetch_array($f)){
$koll=$g["maxdur"];
mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.1 WHERE owner='".$user['id']."' and `type`='200' and `name`='Болт'");
}else{
$fo=mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Болт','1','bolt.gif','".$user['id']."','200','0.1','0','Лука')");
}
$mis="Болт";
include"podzem_brat.php";
print" <font style='font-size:12px; color:cc0000;'>Вы получили 'Болт'</font>";
}
}else{if($stloc=='14.0'){print" <font style='font-size:12px; color:cc0000;'>Кто-то оказался быстрее!</font>";}}
}
/////////////////////////////////////
///////////////Сбор ключей/////////////
if($_GET['act']=='key'){
$ferrr=mysql_query("SELECT n".$_GET['n']." FROM `podzem4` WHERE glava='$glava' and name='".$mir['name']."'");
$retr=mysql_fetch_array($ferrr);
$stloc=$retr["n".$_GET['n'].""];
$f=mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Ключик №".mysql_escape_string($_GET['b'])."'");
$fo=mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Ключик №".mysql_escape_string($_GET['b'])."','1','$stloc.gif','".$user['id']."','200','0.1','0','Подземка')");
//Удаляем ключик с локи
//mysql_query("UPDATE `podzem4` SET n".$_GET['n']." = '' WHERE glava='".$glava."' and name='".$mir['name']."'");
print" <font style='font-size:12px; color:cc0000;'>Вы получили 'Ключик №".$_GET['b']."'</font>";
}
}else{if($g){print" <font style='font-size:12px; color:cc0000;'>У вас уже есть Ключик №".$_GET['b']."!</font>";}}
}
/////////////////////////////////////
///////////////Сбор гаек из стоков/////////////
if($_GET['act']=='stok'){
$ferrr=mysql_query("SELECT n".$_GET['n']." FROM `podzem4` WHERE glava='$glava' and name='".$mir['name']."'");
$retr=mysql_fetch_array($ferrr);
$stloc=$retr["n".$_GET['n'].""];
$shans=rand(0,100);
if($shans<51){
mysql_query("UPDATE `podzem4` SET n".$_GET['n']."='11.0' WHERE glava='$glava' and name='".$mir['name']."'");
$stloc='11.0';
}
if($stloc=='11.1'){
if($mesto==$_GET['n']){
if($stloc=='11.1'){mysql_query("UPDATE `podzem4` SET n".mysql_escape_string($_GET['n'])."='11.0' WHERE glava='$glava' and name='".$mir['name']."'");}
$f=mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Гайка'");
if($g=mysql_fetch_array($f)){
$koll=$g["maxdur"];
mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.1 WHERE owner='".$user['id']."' and `type`='200' and `name`='Гайка'");
}else{
$fo=mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Гайка','1','g.gif','".$user['id']."','200','0.1','0','Лука')");
}
$mis="Гайка";
include"podzem_brat.php";
print" <font style='font-size:12px; color:cc0000;'>Вы получили 'Гайка'</font>";
if($stloc=='12.1'){mysql_query("UPDATE `podzem4` SET n".mysql_escape_string($_GET['n'])."='12.0' WHERE glava='$glava' and name='".$mir['name']."'");}
$f=mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Гайка'");
if($g=mysql_fetch_array($f)){
$koll=$g["maxdur"];
mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.1 WHERE owner='".$user['id']."' and `type`='200' and `name`='Гайка'");
}else{
$fo=mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Гайка','1','g.gif','".$user['id']."','200','0.1','0','Лука')");
}
$mis="Гайка";
include"podzem_brat.php";
print" <font style='font-size:12px; color:cc0000;'>Вы получили 'Гайка'</font>";
$fer=mysql_query("SELECT n".mysql_escape_string($rhar[$mesto][$_GET['path']])." FROM podzem3 WHERE glava='".$mir['glava']."' and name='".$mir['name']."'");
<tdbackground="i/labirint3/bg_scroll_05.gif"align="center"><Ahref="#"onClick="findlogin( 'Выберите персонажа которого хотите выгнать','canalizaciya.php', 'kill')"><IMGalt="Выгнать из группы"src="i/labirint3/ico_kill_member1.gif"WIDTH="14"HEIGHT="17"></A> <Ahref="#"onClick="findlogin( 'Выберите персонажа которому хотите передать лидерство','canalizaciya.php', 'change')"><IMGalt="Передать лидерство"src="i/labirint3/ico_change_leader1.gif"WIDTH="14"HEIGHT="17"></A></td>