View file gta/city2/supermarket.php

File size: 11.78Kb
<?php
#####################################################
#             mod by  -=LesNIK=-                    #
#                 icq 366244181                     #
#     Официальный сайт мода http://wenz.net.ru      #
#     все ответы на вопросы и помощь по скрипту     #
#           вы можете получить только там!          #
#                                                   #
# Вы не имеете право вносить                        #
#                       свои изменения в данный мод!#
#                                                   #
#              Уважайте труд автора!                #
#####################################################


include "./../ini3.php";
include "./../includes/header2.php";
include "./../includes/inc_online.php";
print "<p><small>";

$id=cyr(htmlspecialchars(stripslashes(trim($id))));
$pass=cyr(htmlspecialchars(stripslashes(trim($pass))));

if(!empty($id)) 
{
$q = mysql_query("select secur,golod,band,voodoo,nums,guns,cars,id,login,pass,money,level,police,health from users where id='".$id."';"); 
}
else
{
die ($lang['empty_login']."</small></p></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'];
$band=$data['band'];
$golod=$data['golod'];
$secur=$data['secur'];

if($pass!=$data['pass'])
{
die ($lang['empty_login']."</small></p></body></html>");
}

mysql_query("update users set last='".time()."',city='1' where id='".$id."';");

include "./../includes/inc_secur.php";
include "./../includes/inc_golod.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>".$lang['game_city2']."</b><br/>";
print "<u>[".$lang['supermarket']."]</u><br/>";


$db=mysql_fetch_array(mysql_query("select * from krisha where city='2' and house='supermarket';"));
$bcity=$db['city'];
$bband=$db['band'];
$busers=$db['users'];
$bmoney=$db['money'];
$btime=$db['time'];

if(empty($bmoney))
{
$bank_money=rand(100,12000);
mysql_query("update krisha set money='".$bank_money."' where city='2' and house='supermarket';");
}

switch ($mode) 
{  
case "eat":

if(!empty($p))
{
if(($money-$p)<=0) print $lang['voo_no_money']."<br/>";
else
{
if($p==1000)
{
$money=$money-1000;
mysql_query("update users set money='".$money."',golod='250' where id='".$id."';");
print $lang['rest_now_yr_golod']." 250% :-)<br/>";
}
elseif($p==500)
{
$money=$money-500;
mysql_query("update users set money='".$money."',golod='150' where id='".$id."';");
print $lang['rest_now_yr_golod']." 150% :-)<br/>";
}
elseif($p==200)
{
$gol_rand=rand(90,100);
$golod=$golod+$gol_rand;
if($golod>250)print $lang['rest_golod_err'];
else
{
$money=$money-200;
mysql_query("update users set money='".$money."',golod='".$golod."' where id='".$id."';");
print $lang['rest_now_yr_golod']." ".$golod."% :-)<br/>";
}
}
elseif($p==100)
{
$gol_rand=rand(50,70);
$golod=$golod+$gol_rand;
if($golod>250)print $lang['rest_golod_err'];
else
{
$money=$money-100;
mysql_query("update users set money='".$money."',golod='".$golod."' where id='".$id."';");
print $lang['rest_now_yr_golod']." ".$golod."% :-)<br/>";
}
}
elseif($p==50)
{
$gol_rand=rand(15,30);
$golod=$golod+$gol_rand;
if($golod>250)print $lang['rest_golod_err'];
else
{
$money=$money-50;
mysql_query("update users set money='".$money."',golod='".$golod."' where id='".$id."';");
print $lang['rest_now_yr_golod']." ".$golod."% :-)<br/>";
}
}
elseif($p==5)
{
$gol_rand=rand(1,2);
$golod=$golod+$gol_rand;
if($golod>250)print $lang['rest_golod_err'];
else
{
$money=$money-5;
mysql_query("update users set money='".$money."',golod='".$golod."' where id='".$id."';");
print $lang['rest_now_yr_golod']." ".$golod."% :-)<br/>";
}
}
}
}

print $lang['city1_at_you']." <b>$money $$</b>. ".$lang['rest_what_u_want']."<br/>";
print "-<a href=\"supermarket.php?id=$id&amp;pass=$pass&amp;mode=eat&amp;p=1000\">Комплексный набор продуктов</a>(1000$$)<br/>";
print "-<a href=\"supermarket.php?id=$id&amp;pass=$pass&amp;mode=eat&amp;p=500\">Полноценный обед</a>(500$$)<br/>";
print "-<a href=\"supermarket.php?id=$id&amp;pass=$pass&amp;mode=eat&amp;p=200\">Колбаса</a>(200$$)<br/>";
print "-<a href=\"supermarket.php?id=$id&amp;pass=$pass&amp;mode=eat&amp;p=100\">Картофельное пюре</a>(100$$)<br/>";
print "-<a href=\"supermarket.php?id=$id&amp;pass=$pass&amp;mode=eat&amp;p=50\">Салат</a>(50$$)<br/>";
print "-<a href=\"supermarket.php?id=$id&amp;pass=$pass&amp;mode=eat&amp;p=5\">Сок</a>(5$$)<br/>";

print "&gt;<a href=\"supermarket.php?id=$id&amp;pass=$pass\">Супермаркет</a><br/>";
break;

  case "grab":

if(empty($guns) || ($bband==$band && $band!=''))
{
print $lang['uv_without_guns']."<br/>";
}
else
{
if(empty($a))
{
$guns_array = explode(".", $guns);
$count_guns=count($guns_array);
echo "<form action=\"supermarket.php?id=$id&amp;pass=$pass&amp;mode=grab2\" method=\"post\">
<postfield name=\"at_gun\" value=\"$(at_gun)\"/>";
print $lang['cops_select_gun']."</small><br/><select name=\"at_gun\">";
for($i=0;$i<$count_guns;$i++)
{
print "<option value=\"".$guns_array[$i]."\">".$guns_array[$i]."</option>"; 
}
print "</select><br/><small>";
echo "<input class=\"ibutton\" type=\"submit\" value=\"".$lang['ok']."\"/>";
    echo "</form>";
//echo "<form action=\"supermarket.php?id=$id&amp;pass=$pass&amp;mode=grab\" method=\"post\">
    //<postfield name=\"at_gun\" value=\"$(at_gun)\"/>";

 //echo "<input class=\"ibutton\" type=\"submit\" value=\"".$lang['ok']."\"/>";
    //echo "</form>";
}




if($at_gun=="Кастет")$at_gun=1;
elseif($at_gun=="Нож")$at_gun=2;
elseif($at_gun=="Дубинка")$at_gun=3;
elseif($at_gun=="ПМ")$at_gun=4;
elseif($at_gun=="Мачете")$at_gun=5;
elseif($at_gun=="Беретта")$at_gun=6;
elseif($at_gun=="Меч")$at_gun=7;
elseif($at_gun=="Калашников")$at_gun=8;
elseif($at_gun=="Взрывчатка")$at_gun=9;
elseif($at_gun=="Электрошокер")$at_gun=10;
elseif($at_gun=="Напалм")$at_gun=11;
elseif($at_gun=="Базука")$at_gun=12;
elseif($at_gun=="Гранатомет")$at_gun=13;
elseif($at_gun=="ПЗРК")$at_gun=14;
elseif($at_gun=="Слонобой")$at_gun=15;
elseif($at_gun=="Ракетная установка")$at_gun=16;
elseif($at_gun=="МЕ 85 Combat")$at_gun=17;
elseif($at_gun=="Rohm 735")$at_gun=18;
elseif($at_gun=="Brunner CZ 75")$at_gun=19;
elseif($at_gun=="Лазерное оружие")$at_gun=20;

$gun_cop=rand(6,17);

if($gun_cop==6)$cop_gun="Беретта";
elseif($gun_cop==7)$cop_gun="Меч";
elseif($gun_cop==8)$cop_gun="Калашников";
elseif($gun_cop==9)$cop_gun="Взрывчатка";
elseif($gun_cop==10)$cop_gun="Электрошокер";
elseif($gun_cop==11)$cop_gun="Напалм";
elseif($gun_cop==12)$cop_gun="Базука";
elseif($gun_cop==13)$cop_gun="Гранатомет";
elseif($gun_cop==14)$cop_gun="ПЗРК";
elseif($gun_cop==15)$cop_gun="Слонобой";
elseif($gun_cop==16)$cop_gun="Ракетная установка";
elseif($gun_cop==17)$cop_gun="МЕ 85 Combat";

$police=$police+3;
if($gun_cop>$at_gun)
{
--$level;
if($level<0)$level=0;
$health=$health-50;
if($health<0) $health=0;
mysql_query("update users set health='".$health."',police='".$police."',level='".$level."' where id='".$id."';");
print $lang['bank_grab_fuck']." ".$cop_gun."!<br/>".$lang['bank_grab_health']." ".$health."%<br/>";
}
else
{
++$level;
$grab_money=$money+rand(50,500);
mysql_query("update users set money='".$grab_money."',police='".$police."',level='".$level."' where id='".$id."';");
mysql_query("update krisha set money='0' where city='1' and house='supermarket';");
print "Yo, да ты крут! Ты вынес всю наличку из супермаркета! Теперь у тебя" .$grab_money."$$<br/>";
}


}



 
 case "at_kr":
if(!empty($band) && $band!=$bband)
{
$band_array_att=mysql_fetch_array(mysql_query("select avtoritet from bands where name='".$band."';"));
$band_array_kr=mysql_fetch_array(mysql_query("select boss,avtoritet from bands where name='".$bband."';"));

$avtoritet_att=$band_array_att['avtoritet'];
$boss_kr=$band_array_kr['boss'];
$avtoritet_kr=$band_array_kr['avtoritet'];

if($avtoritet_att>$avtoritet_kr)
{
mysql_query("update krisha set band='".$band."' where city='2' and house='supermarket';'");
print $lang['rest_kr_another_band']." ".$band."!<br/>";


$db_boss=mysql_fetch_array(mysql_query("select id,pass from users where login='".$boss_kr."';"));
$dbid=$db_boss['id'];
$dbpass=$db_boss['pass'];
$messaga="<b>".$lang['supermarket']."</b><br/>".$lang['supermarket_kr_another_band']." ".$band.".<br/>[<a href=\"./../mes.php?pass=$dbpass&amp;id=$dbid&amp;dbid=0&amp;mode=del\">".$lang['ok']."</a>]";
mysql_query("insert into messagi values(0,'0','$dbid','$messaga');");

}
elseif($avtoritet_att<=$avtoritet_kr)
{
print $lang['bank_small_level'];
}

}
else
{
print $lang['error']."<br/>";
}


print "&gt;<a href=\"supermarket.php?id=$id&amp;pass=$pass\">".$lang['supermarket']."</a><br/>";
    break;
  case "gp":
if(($btime+3600)<time())
{
$band_array=mysql_fetch_array(mysql_query("select boss,money from bands where name='".$bband."';"));
$percents=rand(1,2);
$bmoney=$bmoney-$percents;
$band_money=$band_array['money'];
$band_boss=$band_array['boss'];
$band_money=$band_money+$percents;
mysql_query("update krisha set money='".$bmoney."',time='".time()."' where city='2' and house='supermarket';");
mysql_query("update bands set money='".$band_money."' where name='".$bband."';");
print $percents."$$ ".$lang['bank_now_at_obwak']."<br/>";
$db_boss=mysql_fetch_array(mysql_query("select id,pass from users where login='".$band_boss."';"));
$dbid=$db_boss['id'];
$dbpass=$db_boss['pass'];
$messaga="<b>".$lang['rest']."</b><br/>".$lang['bank_has_percents']."  ".$band_money."$$<br/>[<a href=\"./../mes.php?pass=$dbpass&amp;id=$dbid&amp;dbid=0&amp;mode=del\">".$lang['ok']."</a>]";
mysql_query("insert into messagi values(0,'0','$dbid','$messaga');");
}
else
{
print $lang['bank_kto-to']." ".$bband." ".$lang['bank_uje']."<br/>";
}

print "&gt;<a href=\"supermarket.php?id=$id&amp;pass=$pass\">".$lang['supermarket']."</a><br/>";

    break;

  default:
print $lang['supermarket_mes'];

if(!empty($bband)) print $lang['bank_krishuet'].": <b><a href=\"./../bands/viewband.php?id=$id&amp;pass=$pass&amp;band=".urlencode($bband)."\">".$bband."</a></b><br/>";
elseif(!empty($bband) && $bband!=$band && $band!='')
{
print "<a href=\"supermarket.php?id=$id&amp;pass=$pass&amp;mode=at_kr\">".$lang['bank_att_krisha']."</a><br/>";
}
if($band==$bband && $band!='') print "<a href=\"supermarket.php?id=$id&amp;pass=$pass&amp;mode=gp\">".$lang['bank_get_percent']."</a><br/>";
print "<a href=\"supermarket.php?id=$id&amp;pass=$pass&amp;mode=grab\">Ограбить</a><br/>";
print "<a href=\"supermarket.php?id=$id&amp;pass=$pass&amp;mode=eat\">Купить продукты</a><br/>";
  break;
}


print "---<br/>&gt;<a href=\"index.php?id=$id&amp;pass=$pass\">".$lang['in_city']."</a>";
print "<br/>&gt;&gt;<a href=\"./../game.php?id=$id&amp;pass=$pass\">".$lang['menu']."</a>";
print "<br/>---";

mysql_close();
include "./../includes/footer.php";
echo '<br/><br/>-------<br/><div class="msg"><a href="http://wenz.net.ru">Сайт вап мастеру</a></div><br/>';

?>