Размер файла: 9.54Kb
<?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'];
$gold=$data['gold'];
$lox=$data['lox'];
$maska=$data['maska'];
if(md5($pass)!=$data['pass'])
{
die ($lang['empty_login']."</body>
</html>");
}
mysql_query("update users set last='".time()."',city='1' 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_city1']."</b><br/>";
switch ($mode)
{
case "skupka":
if(empty($car_sale))
{
if(!empty($cars))
{
$cars_count = explode(".", $cars);
$count_cars=count($cars_count);
print $lang['game_cars']." <b>($count_cars)</b>:<br/>";
echo "<form action=\"black_sale.php?id=$id&pass=$pass&mode=skupka\" method=\"post\">
<postfield name=\"car_sale\" value=\"$(car_sale)\"/>";
print "<select name=\"car_sale\">";
for($i=0;$i<$count_cars;$i++)
{
print "<option value=\"".$cars_count[$i]."\">".$cars_count[$i]."</option>";
}
print "</select><br/>";
echo "<input class=\"ibutton\" type=\"submit\" value=\"".$lang['ok']."\"/>";
echo "</form>";
}
else
{
print $lang['bs_error'];
}
}
else
{
$check=mysql_fetch_array(mysql_query("select cars from users where id='".$id."';"));
$ch_cars_ar=$check['cars'];
$ch_cars=explode('.',$ch_cars_ar);
if(!in_array($car_sale,$ch_cars)) print $lang['error'];
else
{
$car_sale=cyr(htmlspecialchars(stripslashes(trim($car_sale))));
if($car_sale==$lang['car1'] && !empty($cars))
{
$money=$money+200;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($car_sale==$lang['car2'] && !empty($cars))
{
$money=$money+2500;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($car_sale==$lang['car3'] && !empty($cars))
{
$money=$money+5000;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($car_sale==$lang['car4'] && !empty($cars))
{
$money=$money+6000;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($car_sale==$lang['car5'] && !empty($cars))
{
$money=$money+12500;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($car_sale==$lang['car6'] && !empty($cars))
{
$money=$money+22500;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($car_sale==$lang['car7'] && !empty($cars))
{
$money=$money+30000;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($car_sale==$lang['car8'] && !empty($cars))
{
$money=$money+50000;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($car_sale==$lang['car9'] && !empty($cars))
{
$money=$money+90000;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($car_sale==$lang['car10'] && !empty($cars))
{
$money=$money+125000;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($car_sale==$lang['car11'] && !empty($cars))
{
$money=$money+200000;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($car_sale==$lang['car12'] && !empty($cars))
{
$money=$money+250000;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($car_sale==$lang['car13'] && !empty($cars))
{
$money=$money+300000;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($car_sale==$lang['car14'] && !empty($cars))
{
$money=$money+400000;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($car_sale==$lang['car15'] && !empty($cars))
{
$money=$money+500000;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($car_sale==$lang['car16'] && !empty($cars))
{
$money=$money+625000;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($car_sale==$lang['car17'] && !empty($cars))
{
$money=$money+1000000;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($car_sale==$lang['car18'] && !empty($cars))
{
$money=$money+2000000;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($car_sale==$lang['car19'] && !empty($cars))
{
$money=$money+2500000;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($car_sale==$lang['car20'] && !empty($cars))
{
$money=$money+3000000;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($car_sale==$lang['car21'] && !empty($cars))
{
$money=$money+4000000;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
elseif($car_sale==$lang['car22'] && !empty($cars))
{
$money=$money+5000000;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
$cars_array = explode(".", $cars);
if(count($cars_array)<=1)
{
$cars=str_replace("$car_sale","","$cars");
mysql_query("update users set cars='$cars' where id='$id';");
}
elseif(count($cars_array)>1 && $cars_array[0]!=$car_sale)
{
$cars=str_replace(".$car_sale","","$cars");
mysql_query("update users set cars='$cars' where id='$id';");
}
elseif(count($cars_array)>1 && $cars_array[0]==$car_sale)
{
$cars=str_replace("$car_sale.","","$cars");
mysql_query("update users set cars='$cars' where id='$id';");
}
print $lang['bs_car_saled']." ".$money." $$!<br/>";
}
}
print "<br/>><a href=\"black_sale.php?id=$id&pass=$pass\">".$lang['sl_black_sale']."</a><br/>";
break;
case "blackgold":
print "<br/><u>[Темный переулок]</u><br/>";
$kurs=rand(300,1500);
if(!empty($p) && $gold>$obmen && $p==1 && $obmen<=50 && $obmen>0)
{
$p=cyr(htmlspecialchars(stripslashes(trim($p))));
$gold=$gold-$obmen;
$omoney=$obmen*$kurs;
$money=$money+$omoney;
if($maska<time())++$police;
mysql_query("update users set money='".$money."',gold='".$gold."',police='".$police."' where id='".$id."';");
print "Ты обменял золото на деньги! Теперь у тебя $money$$<br/>";
}else{
if($gold<=$obmen) print "У тебя недостаточно золота<br/>";
if($obmen>50) print "За раз можно обменять не более 50 золота<br/>";
}
if(empty($p))
{
print "Здесь ты можешь обменять свое золото.Будь осторожен при обмене.Курс меняется раз в 10 секунд<br/>";
print "Примерный курс: <b>1 золото=$kurs $$</b><br/>";
print "Сколько золота меняем?<br/>";
echo "<form action=\"black_sale.php?id=$id&pass=$pass&mode=blackgold&p=1\" method=\"post\">
<postfield name=\"obmen\" value=\"obmen\"/>";
print "<input name=\"obmen\" type=\"*N\"/><br/>";
echo "<input class=\"ibutton\" type=\"submit\" value=\"".$lang['ok']."\"/>";
echo "</form>";
}
print "><a href=\"black_sale.php?id=$id&pass=$pass\">Черный рынок</a><br/>";
break;
case "nap":
print "<u>[".$lang['bs_nap']."]</u><br/>";
print $lang['bs_nap_mes']."<br/>";
if(!empty($p) && ($p==1 || $p==2 || $p=3))
{
$val=rand(1,4);
if($p==$val)
{
$val=$val*4;
print $lang['bs_nap_yes1']." ".$p." ".$lang['bs_nap_yes2']." ".$val."$$<br/>";
$money=$money+$val;
mysql_query("update users set money='".$money."' where id='".$id."';");
}
else
{
$money=$money-($p+$p);
if($money<=0) print $lang['voo_no_money'];
else
{
mysql_query("update users set money='".$money."' where id='".$id."';");
print $lang['bs_nap_false']." ".$money."$$<br/>";
}
}
}
print "-<a href=\"black_sale.php?id=$id&pass=$pass&mode=nap&p=1\">".$lang['bs_nap_stakan']." 1</a><br/>";
print "-<a href=\"black_sale.php?id=$id&pass=$pass&mode=nap&p=2\">".$lang['bs_nap_stakan']." 2</a><br/>";
print "-<a href=\"black_sale.php?id=$id&pass=$pass&mode=nap&p=3\">".$lang['bs_nap_stakan']." 3</a><br/>";
print "><a href=\"black_sale.php?id=$id&pass=$pass\">".$lang['sl_black_sale']."</a><br/>";
break;
default:
print "<u>[".$lang['sl_black_sale']."]</u><br/>";
print $lang['bs_mes']."<br/>";
print "<a href=\"black_sale.php?id=$id&pass=$pass&mode=skupka\">".$lang['bs_skup_krad']."</a><br/>";
print "<a href=\"black_sale.php?id=$id&pass=$pass&mode=nap\">".$lang['bs_nap']."</a><br/>";
print "<a href=\"black_sale.php?id=$id&pass=$pass&mode=blackgold\">Тёмный переулок</a><br/>";
break;
}
include "./../includes/inc_in_city.php";
mysql_close();
include "./../includes/footer2.php";
}
elseif($ban==1)
{
die ($lang['empty_login']."</body>
</html>");
}
?>