Размер файла: 8.67Kb
<?php
include "./../ini3.php";
include "./../includes/header2.php";
include "./../includes/inc_online.php";
$id=cyr(htmlspecialchars(stripslashes(trim($id))));
$pass=cyr(htmlspecialchars(stripslashes(trim($pass))));
if(!empty($id))
{
$q = mysql_query("select * 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'];
$level=$data['level'];
$police=$data['police'];
$stage=$data['stage'];
$health=$data['health'];
$cars=$data['cars'];
$guns=$data['guns'];
$nums=$data['nums'];
$voo_por=$data['voodoo'];
$energy=$data['energy'];
$secur=$data['secur'];
$zav=$data['zav'];
$lsd=$data['lsd'];
$ban=$data['ban'];
$dieta=$data['dieta'];
$lox=$data['lox'];
if(md5($pass)!=$data['pass'])
{
die ($lang['empty_login']."</body></html>");
}
if($level<50)
{
die ($lang['error']."</small></p></card></wml>");
}
mysql_query("update users set last='".time()."',city='2' where id='".$id."';");
if($ban==0)
{
include "./../includes/inc_secur.php";
include "./../includes/inc_energy.php";
include "./../includes/inc_hospital.php";
include "./../includes/inc_police.php";
include "./../includes/inc_die.php";
include "./../includes/inc_voodoo.php";
include "./../includes/inc_attack.php";
include "./../includes/inc_mes.php";
print "<b>[Зд: $health %][<img src='a href=\./../../pic/energy.gif' title='Энергия'/>: $energy %][Зщ: $secur %]</b><br/>";
print "<b>".$lang['game_city2']."</b><br/>";
print "<u>[".$lang['gm_name']."]</u><br/>";
switch ($mode)
{
case "p":
if(empty($gun_sale))
{
if(!empty($guns))
{
$guns_count = explode(".", $guns);
$count_guns=count($guns_count);
print $lang['game_guns']." <b>($count_guns)</b>:";
echo "<form action=\"gunman.php?id=$id&pass=$pass&mode=p\" method=\"post\">
<br/>";
echo "<select name=\"gun_sale\">";
for($i=0;$i<$count_guns;$i++)
{
echo "<option value=\"".$guns_count[$i]."\">".$guns_count[$i]."</option>";
}
echo "</select><br/>
<input type=\"hidden\" name=\"a\" value=\"b\"/>
<postfield name=\"gun_sale\" value=\"$(gun_sale)\"/>
<input class=\"ibutton\" type=\"submit\" value=\"".$lang['ok']."\"/>
</form>";
}
else
{
print $lang['bs_error'];
}
}
else
{
$check=mysql_fetch_array(mysql_query("select guns from users where id='".$id."';"));
$ch_guns_ar=$check['guns'];
$ch_guns=explode('.',$ch_guns_ar);
if(!in_array($gun_sale,$ch_guns)) print $lang['error'];
else
{
$gun_sale=cyr(htmlspecialchars(stripslashes(trim($gun_sale))));
if($gun_sale==$lang['gun1'] && !empty($guns))
{
$money=$money+75;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($gun_sale==$lang['gun2'] && !empty($guns))
{
$money=$money+250;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($gun_sale==$lang['gun3'] && !empty($guns))
{
$money=$money+600;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($gun_sale==$lang['gun4'] && !empty($guns))
{
$money=$money+1250;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($gun_sale==$lang['gun5'] && !empty($guns))
{
$money=$money+2000;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($gun_sale==$lang['gun6'] && !empty($guns))
{
$money=$money+2500;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($gun_sale==$lang['gun7'] && !empty($guns))
{
$money=$money+6000;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($gun_sale==$lang['gun8'] && !empty($guns))
{
$money=$money+7500;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($gun_sale==$lang['gun9'] && !empty($guns))
{
$money=$money+12500;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($gun_sale==$lang['gun10'] && !empty($guns))
{
$money=$money+22500;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($gun_sale==$lang['gun11'] && !empty($guns))
{
$money=$money+45000;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($gun_sale==$lang['gun12'] && !empty($guns))
{
$money=$money+100000;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($gun_sale==$lang['gun13'] && !empty($guns))
{
$money=$money+175000;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($gun_sale==$lang['gun14'] && !empty($guns))
{
$money=$money+250000;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($gun_sale==$lang['gun15'] && !empty($guns))
{
$money=$money+500000;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($gun_sale==$lang['gun16'] && !empty($guns))
{
$money=$money+1000000;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($gun_sale==$lang['gun17'] && !empty($guns))
{
$money=$money+1750000;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($gun_sale==$lang['gun18'] && !empty($guns))
{
$money=$money+2500000;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($gun_sale==$lang['gun19'] && !empty($guns))
{
$money=$money+3000000;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($gun_sale==$lang['gun20'] && !empty($guns))
{
$money=$money+5000000;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($gun_sale==$lang['gun21'] && !empty($guns))
{
$money=$money+16000000;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
$guns_array = explode(".", $guns);
if(count($guns_array)<=1)
{
$guns=str_replace("$gun_sale","","$guns");
mysql_query("update users set guns='$guns' where id='$id';");
}
elseif(count($guns_array)>1 && $guns_array[0]!=$gun_sale)
{
$guns=str_replace(".$gun_sale","","$guns");
mysql_query("update users set guns='$guns' where id='$id';");
}
elseif(count($guns_array)>1 && $guns_array[0]==$gun_sale)
{
$guns=str_replace("$gun_sale.","","$guns");
mysql_query("update users set guns='$guns' where id='$id';");
}
print $lang['gm_saled']." ".$money." $$!";
}
}
print "<br/>><a href=\"gunman.php?id=$id&pass=$pass\">".$lang['city2_gunman']."</a><br/>";
break;
case k:
if(!empty($p) && $money>=$p)
{
$p=cyr(htmlspecialchars(stripslashes(trim($p))));
if($p==25000) $gun=$lang['gun10'];
elseif($p==45000) $gun=$lang['gun11'];
elseif($p==100000) $gun=$lang['gun12'];
elseif($p==190000) $gun=$lang['gun13'];
else
{
die($lang['error']."<br/><anchor>".$lang['back']."<prev/></anchor></small></p></card></wml>");
}
include "./../includes/inc_in_array.php";
if(empty($guns))
{
$money=$money-$p;
mysql_query("update users set guns='$gun',money='$money' where id='".$id."';");
}
elseif(!empty($guns))
{
$money=$money-$p;
mysql_query("update users set guns='$guns.$gun',money='$money' where id='".$id."';");
}
print $lang['city1_yo_man']." $gun-".$lang['city1_best_purchase']."<br/>";
}
elseif($money<=$p)
{
print $lang['city1_dont_have_money']."<br/>";
}
print $lang['city1_at_you']." <b>$money $$</b> ".$lang['city1_want_buy']."<br/>";
print "<img src='./../city1/images/gun10.jpeg' alt='gun10'/><a href=\"gunman.php?id=$id&pass=$pass&mode=k&p=25000\">".$lang['gun10']."</a>(25000 $$),<br/>";
print "<img src='./../city1/images/gun12.jpeg' alt='gun11'/><a href=\"gunman.php?id=$id&pass=$pass&mode=k&p=45000\">".$lang['gun11']."</a>(45000 $$),<br/>";
print "<img src='./../city1/images/gun12.jpeg' alt='gun12'/><a href=\"gunman.php?id=$id&pass=$pass&mode=k&p=100000\">".$lang['gun12']."</a>(100000 $$),<br/>";
print "<img src='./../city1/images/gun13.jpeg' alt='gun13'/><a href=\"gunman.php?id=$id&pass=$pass&mode=k&p=190000\">".$lang['gun13']."</a>(190000 $$)<br/>";
print "><a href=\"gunman.php?id=$id&pass=$pass\">".$lang['city2_gunman']."</a><br/>";
break;
default:
print $lang['gm_hello'];
print "<a href=\"gunman.php?id=$id&pass=$pass&mode=k\">".$lang['gm_k']."</a><br/>";
print "<a href=\"gunman.php?id=$id&pass=$pass&mode=p\">".$lang['gm_p']."</a><br/>";
break;
}
print "---<br/>><a href=\"index.php?id=$id&pass=$pass\">".$lang['in_city']."</a>";
print "<br/>>><a href=\"./../game.php?id=$id&pass=$pass\">".$lang['menu']."</a>";
print "<br/>---";
mysql_close();
include "./../includes/footer2.php";
}
elseif($ban==1)
{
die ($lang['empty_login']."</body></html>");
}
?>