<?php
include "./../config.php";
include "./../includes/header2.php";
$id=cyr(htmlspecialchars(stripslashes(trim($id))));
$pass=cyr(htmlspecialchars(stripslashes(trim($pass))));
if(!empty($id))
{
$q = mysql_query("select login,band,level,cars,id,pass,money,zav,lsd,ban from users where id='".$id."';");
}
else
{
die ($lang['empty_login']."</body></html>");
}
$data = mysql_fetch_array($q);
$id=$data['id'];
$login=$data['login'];
$money=$data['money'];
$cars=$data['cars'];
$level=$data['level'];
$band=$data['band'];
$zav=$data['zav'];
$lsd=$data['lsd'];
$ban=$data['ban'];
if($pass!=$data['pass'])
{
die ($lang['empty_login']."</body></html>");
}
mysql_query("update users set last='".time()."',city='1' where id='".$id."';");
if($ban==0)
{
switch ($mode)
{
case "kup":
$band_q=mysql_query("select * from bands where name='".$band."';");
$band_array=mysql_fetch_array($band_q);
$bname=$band_array['name'];
$boss=$band_array['boss'];
$members=$band_array['members'];
$blvl=$band_array['blvl'];
$obwak=$band_array['kazna'];
$bcars=$band_array['cars'];
$bguns=$band_array['guns'];
$bmoney=$band_array['money'];
$bgold=$band_array['gold'];
$osobnyak=$band_array['osobnyak'];
$band_members = explode(".", $members);
$count_members=count($band_members);
if($osobnyak>=1) die ($lang['os_uje']."<br/><anchor>".$lang['back']."<prev/></anchor></body></html>");
if(empty($type))
{
print '[<u>'.$lang['area_ag'].'</u>]<br/>';
if(empty($band)) print $lang['os_neuch'];
else
{
if($osobnyak>=1) die ($lang['os_uje']."<br/><anchor>".$lang['back']."<prev/></anchor></body></html>");
if ($bmoney<=100000) die ($lang['os_no_money']."<br/><anchor>".$lang['back']."<prev/></anchor></body></html>");
print $lang['os_from_you_band'].' '.$bname.' '.$bmoney.'$$<br/>';
print $lang['os_predl'];
if($bmoney>100000 && $boss==$login && $blvl>=10)
{
print "За 100.000 $$ вы можете купить у нас особняк начального уровня.Здесь доступно:<br/>-Пообедать<br/>";
print "[<a href=\"osobnyaki.php?id=$id&pass=$pass&mode=kup&type=1\">Купить</a>] (100.000 $$)<br/>";
}
if($bmoney>500000 && $boss==$login && $blvl>=20)
{
print "За 500.000 $$ вы можете купить у нас особняк среднего уровня. Здесь доступно:<br/>-Пообедать<br/>--Вылечиться<br/>";
print "[<a href=\"osobnyaki.php?id=$id&pass=$pass&mode=kup&type=2\">Купить</a>] (500.000 $$)<br/>";
}
if($bmoney>1000000&& $boss==$login && $blvl>=25)
{
print "За 1.000.000 $$ вы можете купить особняк высокого уровня.Здесь доступно:<br/>-Пообедать<br/>--Вылечиться<br/>---Загримироваться<br/>----Снять проклятие<br/>-----Чат<br/>";
print "[<a href=\"osobnyaki.php?id=$id&pass=$pass&mode=kup&type=3\">Купить</a>] (1.000.000 $$)<br/>";
}
if($bgold>5000&& $boss==$login && $blvl>=35)
{
print "За 5.000 Золота вы можете купить особняк экстра-класса.Здесь доступно:<br/>-Пообедать<br/>--Вылечиться<br/>---Загримироваться<br/>----Снять проклятие<br/>-----Чат<br/>------Повысить авторитет<br/>-------Получить образование<br/>--------Восстановить здоровье<br/>";
print "[<a href=\"osobnyaki.php?id=$id&pass=$pass&mode=kup&type=4\">Купить</a>] (5.000 золота)<br/>";
}
}
}
else
{
if(!intval($type)) die ($lang['error']."</small></p></card></wml>");
if($type==1)
{
if(($bmoney-100000)<=0) die ($lang['os_no_money']."<br/><anchor>".$lang['back']."<prev/></anchor></body></html>");
mysql_query("update bands set money='".$bmoney."'-'100000' where name='".$bname."';");
mysql_query("update bands set osobnyak='1' where name='".$bname."';");
print $lang['os_yeah'].' 100.000$$!<br/>';
$band_members = explode(".", $members);
$count_members=count($band_members);
for($i=0;$i<$count_members;$i++)
{
$level_ar=mysql_fetch_array(mysql_query("select level from users where login='".$band_members[$i]."';"));
mysql_query("update users set level='".$level_ar['level']."'+'3' where login='".$band_members[$i]."';");
}
}
elseif($type==2)
{
if(($bmoney-500000)<=0) die ($lang['os_no_money']."<br/><anchor>".$lang['back']."<prev/></anchor></body></html>");
mysql_query("update bands set money='".$bmoney."'-'500000' where name='".$bname."';");
mysql_query("update bands set osobnyak='2' where name='".$bname."';");
print $lang['os_yeah'].' 500.000$$!<br/>';
$band_members = explode(".", $members);
$count_members=count($band_members);
for($i=0;$i<$count_members;$i++)
{
$level_ar=mysql_fetch_array(mysql_query("select level from users where login='".$band_members[$i]."';"));
mysql_query("update users set level='".$level_ar['level']."'+'7' where login='".$band_members[$i]."';");
}
}
elseif($type==3)
{
if(($bmoney-1000000)<=0) die ($lang['os_no_money']."<br/><anchor>".$lang['back']."<prev/></anchor></body></html>");
mysql_query("update bands set money='".$bmoney."'-'1000000' where name='".$bname."';");
mysql_query("update bands set osobnyak='3' where name='".$bname."';");
print $lang['os_yeah'].' 1.000.000$$!<br/>';
$band_members = explode(".", $members);
$count_members=count($band_members);
for($i=0;$i<$count_members;$i++)
{
$level_ar=mysql_fetch_array(mysql_query("select level from users where login='".$band_members[$i]."';"));
mysql_query("update users set level='".$level_ar['level']."'+'10' where login='".$band_members[$i]."';");
}
}
elseif($type==4)
{
if(($bgold-5000)<=0) die ($lang['os_no_money']."<br/><anchor>".$lang['back']."<prev/></anchor></body></html>");
mysql_query("update bands set gold='".$bgold."'-'5000' where name='".$bname."';");
mysql_query("update bands set osobnyak='4' where name='".$bname."';");
print $lang['os_yeah'].' 5.000 Золота!<br/>';
$band_members = explode(".", $members);
$count_members=count($band_members);
for($i=0;$i<$count_members;$i++)
{
$level_ar=mysql_fetch_array(mysql_query("select level from users where login='".$band_members[$i]."';"));
mysql_query("update users set level='".$level_ar['level']."'+'20' where login='".$band_members[$i]."';");
}
}
else die ($lang['error']."</body></html>");
}
print "><a href=\"band_panel.php?id=$id&pass=$pass\">Твоя банда</a><br/>";
break;
case "my":
list($osobnyak)=mysql_fetch_array(mysql_query("select osobnyak from bands where name='".$band."';"));
list($members,$bname,$boss,$bmoney,$bgold,$blvl)=mysql_fetch_array(mysql_query("select members,name,boss,money,gold,blvl from bands where name='".$band."';"));
if(empty($osobnyak))die ($lang['error']."</body></html>");
if($osobnyak==1) $znak='<b>+</b>';
elseif($osobnyak==2) $znak='<b>*</b>';
elseif($osobnyak==3) $znak='<b>!</b>';
elseif($osobnyak==4) $znak='<b>$</b>';
print '[<u>'.$bname.'</u> '.$znak.']<br/>';
print $lang['os_mes'];
if(!empty($obed))
{
$band_members = explode(".", $members);
$count_members=count($band_members);
for($i=0;$i<$count_members;$i++)
{
mysql_query("update users set golod='250' where login='".$band_members[$i]."';");
}
print $lang['os_golod'];
$rand=rand(1,1000);
if(($bmoney-$rand)<=0) $rand=$bmoney;
mysql_query("update bands set money='".$bmoney."'-'".$rand."' where name='".$band."';");
print '<b>'.$lang['os_nalog'].' '.$rand.'$$</b><br/>';
}
if(!empty($vrach))
{
if($osobnyak<2)die ($lang['error']."</body></html>");
$band_members = explode(".", $members);
$count_members=count($band_members);
for($i=0;$i<$count_members;$i++)
{
mysql_query("update users set health='150' where login='".$band_members[$i]."';");
}
print $lang['os_health'];
$rand=rand(1,500);
if(($bmoney-$rand)<=0) $rand=$bmoney;
mysql_query("update bands set money='".$bmoney."'-'".$rand."' where name='".$band."';");
print '<b>'.$lang['os_nalog'].' '.$rand.'$$</b><br/>';
}
if(!empty($grim))
{
if($osobnyak<3)die ($lang['error']."</body></html>");
$band_members = explode(".", $members);
$count_members=count($band_members);
for($i=0;$i<$count_members;$i++)
{
mysql_query("update users set police='0' where login='".$band_members[$i]."';");
}
print $lang['os_police'];
$rand=rand(1,700);
if(($bmoney-$rand)<=0) $rand=$bmoney;
mysql_query("update bands set money='".$bmoney."'-'".$rand."' where name='".$band."';");
print '<b>'.$lang['os_nalog'].' '.$rand.'$$</b><br/>';
}
if(!empty($voodoo))
{
if($osobnyak<3)die ($lang['error']."</body></html>");
$band_members = explode(".", $members);
$count_members=count($band_members);
for($i=0;$i<$count_members;$i++)
{
mysql_query("update users set voodoo='' where login='".$band_members[$i]."';");
}
print $lang['os_voodoo'];
$rand=rand(1,1000);
if(($bmoney-$rand)<=0) $rand=$bmoney;
mysql_query("update bands set money='".$bmoney."'-'".$rand."' where name='".$band."';");
print '<b>'.$lang['os_nalog'].' '.$rand.'$$</b><br/>';
}
if(!empty($lev))
{
if($osobnyak<4)die ($lang['error']."</body></html>");
$band_members = explode(".", $members);
$count_members=count($band_members);
for($i=0;$i<$count_members;$i++)
{
$level_ar=mysql_fetch_array(mysql_query("select level from users where login='".$band_members[$i]."';"));
mysql_query("update users set level='".$level_ar['level']."'+'10' where login='".$band_members[$i]."';");
}
print "Авторитет всех членов банды повышен на 10 единиц<br/>";
$rand=rand(1,2000);
if($bmoney>$rand)
{
mysql_query("update bands set money='".$bmoney."'-'".$rand."' where name='".$band."';");
print '<b>'.$lang['os_nalog'].' '.$rand.'$$</b><br/>';}else{
print 'В общаке не хватает денег,чтобы заплатить налог на пользование особняоком<br/>';}
}
if(!empty($health))
{
if($osobnyak<4)die ($lang['error']."</body></html>");
$band_members = explode(".", $members);
$count_members=count($band_members);
$rand=rand(1,20);
if($bgold>$rand)
{
mysql_query("update bands set gold='".$bgold."'-'".$rand."' where name='".$band."';");
print '<b>'.$lang['os_nalog'].' '.$rand.' Золота</b><br/>';
for($i=0;$i<$count_members;$i++)
{
mysql_query("update users set health='3000' where login='".$band_members[$i]."';");
}
print "Теперь вся банда здорова на 3000 единиц<br/>";
}else{
print 'В общаке не хватает золота,чтобы заплатить налог на пользование особняоком<br/>';}
}
if(!empty($obraz))
{
if($osobnyak<4)die ($lang['error']."</body></html>");
$band_members = explode(".", $members);
$count_members=count($band_members);
$rand=rand(20,130);
if($bgold>$rand)
{
mysql_query("update bands set gold='".$bgold."'-'".$rand."' where name='".$band."';");
print '<b>'.$lang['os_nalog'].' '.$rand.' Золота</b><br/>';
for($i=0;$i<$count_members;$i++)
{
$school=rand(1,3);
$s_time=time()+604800;
mysql_query("update users set school='".$school."',school_time='".$s_time."' where id='".$id."';");
}
if($school==1)print "Теперь у тебя нет образования<br/>";
elseif($school==2)print "Ты изучил среднее образование<br/>";
elseif($school==3)print "Ты изучил высшее образование<br/>";
}else{
print 'В общаке не хватает золота,чтобы заплатить налог на пользование особняоком<br/>';}
}
if(!empty($sale))
{
if($boss!=$login) die ($lang['error']."</body></html>");
if($osobnyak==1)$rand=rand(20000,100000);
if($osobnyak==2)$rand=rand(100000,500000);
if($osobnyak==3)$rand=rand(200000,800000);
if($osobnyak==4)$rand=rand(500000,2000000);
mysql_query("update bands set money='".$bmoney."'+'".$rand."' where name='".$band."';");
mysql_query("update bands set osobnyak='0' where name='".$bname."';");
print $lang['os_saled'].' '.$rand.'$$!<br/>';
}
if($osobnyak>=1)
print "-<a href=\"osobnyaki.php?id=$id&pass=$pass&mode=my&obed=1\">".$lang['os_obed']."</a><br/>";
if($osobnyak>=2)
print "-<a href=\"osobnyaki.php?id=$id&pass=$pass&mode=my&vrach=1\">".$lang['os_vrach']."</a><br/>";
if($osobnyak>=3)
{
print "-<a href=\"osobnyaki.php?id=$id&pass=$pass&mode=my&grim=1\">".$lang['os_grim']."</a><br/>";
print "-<a href=\"osobnyaki.php?id=$id&pass=$pass&mode=my&voodoo=1\">".$lang['os_prokl']."</a><br/>";
}
if($osobnyak==4)
{
print "-<a href=\"osobnyaki.php?id=$id&pass=$pass&mode=my&lev=1\">Повысить авторитет банды</a><br/>";
print "-<a href=\"osobnyaki.php?id=$id&pass=$pass&mode=my&health=1\">Восстановить здоровье банды</a><br/>";
print "-<a href=\"osobnyaki.php?id=$id&pass=$pass&mode=my&obraz=1\">Изменить свое образование</a><br/>";
}
if($boss==$login)
print "-<a href=\"osobnyaki.php?id=$id&pass=$pass&mode=my&sale=1\">".$lang['os_sale_boss']."</a><br/>";
print "><a href=\"band_panel.php?id=$id&pass=$pass\">Твоя банда</a><br/>";
break;
default:
print "<u>[".$lang['el_2avenu']."]</u><br/>";
print $lang['os_enter'];
print "-<a href=\"osobnyaki.php?id=$id&pass=$pass&mode=kup\">".$lang['os_nedvij']."</a><br/>";
break;
}
print "<br/>>><a href=\"./../game.php?id=$id&pass=$pass\">".$lang['menu']."</a></body></html>";
mysql_close();
}
elseif($ban==1)
{
die ($lang['empty_login']."</body></html>");
}
?>