Просмотр файла gta/city2/supermarket.php

Размер файла: 11.78Kb
  1. <?php
  2. #####################################################
  3. # mod by -=LesNIK=- #
  4. # icq 366244181 #
  5. # Официальный сайт мода http://wenz.net.ru #
  6. # все ответы на вопросы и помощь по скрипту #
  7. # вы можете получить только там! #
  8. # #
  9. # Вы не имеете право вносить #
  10. # свои изменения в данный мод!#
  11. # #
  12. # Уважайте труд автора! #
  13. #####################################################
  14.  
  15.  
  16. include "./../ini3.php";
  17. include "./../includes/header2.php";
  18. include "./../includes/inc_online.php";
  19. print "<p><small>";
  20.  
  21. $id=cyr(htmlspecialchars(stripslashes(trim($id))));
  22. $pass=cyr(htmlspecialchars(stripslashes(trim($pass))));
  23.  
  24. if(!empty($id))
  25. {
  26. $q = mysql_query("select secur,golod,band,voodoo,nums,guns,cars,id,login,pass,money,level,police,health from users where id='".$id."';");
  27. }
  28. else
  29. {
  30. die ($lang['empty_login']."</small></p></body></html>");
  31. }
  32.  
  33. $data = mysql_fetch_array($q);
  34.  
  35. $id=$data['id'];
  36. $login=$data['login'];
  37. $money=$data['money'];
  38. $level=$data['level'];
  39. $police=$data['police'];
  40. $stage=$data['stage'];
  41. $health=$data['health'];
  42. $cars=$data['cars'];
  43. $guns=$data['guns'];
  44. $nums=$data['nums'];
  45. $band=$data['band'];
  46. $golod=$data['golod'];
  47. $secur=$data['secur'];
  48.  
  49. if($pass!=$data['pass'])
  50. {
  51. die ($lang['empty_login']."</small></p></body></html>");
  52. }
  53.  
  54. mysql_query("update users set last='".time()."',city='1' where id='".$id."';");
  55.  
  56. include "./../includes/inc_secur.php";
  57. include "./../includes/inc_golod.php";
  58. include "./../includes/inc_hospital.php";
  59. include "./../includes/inc_police.php";
  60. include "./../includes/inc_die.php";
  61. include "./../includes/inc_voodoo.php";
  62. include "./../includes/inc_attack.php";
  63. include "./../includes/inc_mes.php";
  64. print "<b>".$lang['game_city2']."</b><br/>";
  65. print "<u>[".$lang['supermarket']."]</u><br/>";
  66.  
  67.  
  68. $db=mysql_fetch_array(mysql_query("select * from krisha where city='2' and house='supermarket';"));
  69. $bcity=$db['city'];
  70. $bband=$db['band'];
  71. $busers=$db['users'];
  72. $bmoney=$db['money'];
  73. $btime=$db['time'];
  74.  
  75. if(empty($bmoney))
  76. {
  77. $bank_money=rand(100,12000);
  78. mysql_query("update krisha set money='".$bank_money."' where city='2' and house='supermarket';");
  79. }
  80.  
  81. switch ($mode)
  82. {
  83. case "eat":
  84.  
  85. if(!empty($p))
  86. {
  87. if(($money-$p)<=0) print $lang['voo_no_money']."<br/>";
  88. else
  89. {
  90. if($p==1000)
  91. {
  92. $money=$money-1000;
  93. mysql_query("update users set money='".$money."',golod='250' where id='".$id."';");
  94. print $lang['rest_now_yr_golod']." 250% :-)<br/>";
  95. }
  96. elseif($p==500)
  97. {
  98. $money=$money-500;
  99. mysql_query("update users set money='".$money."',golod='150' where id='".$id."';");
  100. print $lang['rest_now_yr_golod']." 150% :-)<br/>";
  101. }
  102. elseif($p==200)
  103. {
  104. $gol_rand=rand(90,100);
  105. $golod=$golod+$gol_rand;
  106. if($golod>250)print $lang['rest_golod_err'];
  107. else
  108. {
  109. $money=$money-200;
  110. mysql_query("update users set money='".$money."',golod='".$golod."' where id='".$id."';");
  111. print $lang['rest_now_yr_golod']." ".$golod."% :-)<br/>";
  112. }
  113. }
  114. elseif($p==100)
  115. {
  116. $gol_rand=rand(50,70);
  117. $golod=$golod+$gol_rand;
  118. if($golod>250)print $lang['rest_golod_err'];
  119. else
  120. {
  121. $money=$money-100;
  122. mysql_query("update users set money='".$money."',golod='".$golod."' where id='".$id."';");
  123. print $lang['rest_now_yr_golod']." ".$golod."% :-)<br/>";
  124. }
  125. }
  126. elseif($p==50)
  127. {
  128. $gol_rand=rand(15,30);
  129. $golod=$golod+$gol_rand;
  130. if($golod>250)print $lang['rest_golod_err'];
  131. else
  132. {
  133. $money=$money-50;
  134. mysql_query("update users set money='".$money."',golod='".$golod."' where id='".$id."';");
  135. print $lang['rest_now_yr_golod']." ".$golod."% :-)<br/>";
  136. }
  137. }
  138. elseif($p==5)
  139. {
  140. $gol_rand=rand(1,2);
  141. $golod=$golod+$gol_rand;
  142. if($golod>250)print $lang['rest_golod_err'];
  143. else
  144. {
  145. $money=$money-5;
  146. mysql_query("update users set money='".$money."',golod='".$golod."' where id='".$id."';");
  147. print $lang['rest_now_yr_golod']." ".$golod."% :-)<br/>";
  148. }
  149. }
  150. }
  151. }
  152.  
  153. print $lang['city1_at_you']." <b>$money $$</b>. ".$lang['rest_what_u_want']."<br/>";
  154. print "-<a href=\"supermarket.php?id=$id&amp;pass=$pass&amp;mode=eat&amp;p=1000\">Комплексный набор продуктов</a>(1000$$)<br/>";
  155. print "-<a href=\"supermarket.php?id=$id&amp;pass=$pass&amp;mode=eat&amp;p=500\">Полноценный обед</a>(500$$)<br/>";
  156. print "-<a href=\"supermarket.php?id=$id&amp;pass=$pass&amp;mode=eat&amp;p=200\">Колбаса</a>(200$$)<br/>";
  157. print "-<a href=\"supermarket.php?id=$id&amp;pass=$pass&amp;mode=eat&amp;p=100\">Картофельное пюре</a>(100$$)<br/>";
  158. print "-<a href=\"supermarket.php?id=$id&amp;pass=$pass&amp;mode=eat&amp;p=50\">Салат</a>(50$$)<br/>";
  159. print "-<a href=\"supermarket.php?id=$id&amp;pass=$pass&amp;mode=eat&amp;p=5\">Сок</a>(5$$)<br/>";
  160.  
  161. print "&gt;<a href=\"supermarket.php?id=$id&amp;pass=$pass\">Супермаркет</a><br/>";
  162. break;
  163.  
  164. case "grab":
  165.  
  166. if(empty($guns) || ($bband==$band && $band!=''))
  167. {
  168. print $lang['uv_without_guns']."<br/>";
  169. }
  170. else
  171. {
  172. if(empty($a))
  173. {
  174. $guns_array = explode(".", $guns);
  175. $count_guns=count($guns_array);
  176. echo "<form action=\"supermarket.php?id=$id&amp;pass=$pass&amp;mode=grab2\" method=\"post\">
  177. <postfield name=\"at_gun\" value=\"$(at_gun)\"/>";
  178. print $lang['cops_select_gun']."</small><br/><select name=\"at_gun\">";
  179. for($i=0;$i<$count_guns;$i++)
  180. {
  181. print "<option value=\"".$guns_array[$i]."\">".$guns_array[$i]."</option>";
  182. }
  183. print "</select><br/><small>";
  184. echo "<input class=\"ibutton\" type=\"submit\" value=\"".$lang['ok']."\"/>";
  185. echo "</form>";
  186. //echo "<form action=\"supermarket.php?id=$id&amp;pass=$pass&amp;mode=grab\" method=\"post\">
  187. //<postfield name=\"at_gun\" value=\"$(at_gun)\"/>";
  188.  
  189. //echo "<input class=\"ibutton\" type=\"submit\" value=\"".$lang['ok']."\"/>";
  190. //echo "</form>";
  191. }
  192.  
  193.  
  194.  
  195.  
  196. if($at_gun=="Кастет")$at_gun=1;
  197. elseif($at_gun=="Нож")$at_gun=2;
  198. elseif($at_gun=="Дубинка")$at_gun=3;
  199. elseif($at_gun=="ПМ")$at_gun=4;
  200. elseif($at_gun=="Мачете")$at_gun=5;
  201. elseif($at_gun=="Беретта")$at_gun=6;
  202. elseif($at_gun=="Меч")$at_gun=7;
  203. elseif($at_gun=="Калашников")$at_gun=8;
  204. elseif($at_gun=="Взрывчатка")$at_gun=9;
  205. elseif($at_gun=="Электрошокер")$at_gun=10;
  206. elseif($at_gun=="Напалм")$at_gun=11;
  207. elseif($at_gun=="Базука")$at_gun=12;
  208. elseif($at_gun=="Гранатомет")$at_gun=13;
  209. elseif($at_gun=="ПЗРК")$at_gun=14;
  210. elseif($at_gun=="Слонобой")$at_gun=15;
  211. elseif($at_gun=="Ракетная установка")$at_gun=16;
  212. elseif($at_gun=="МЕ 85 Combat")$at_gun=17;
  213. elseif($at_gun=="Rohm 735")$at_gun=18;
  214. elseif($at_gun=="Brunner CZ 75")$at_gun=19;
  215. elseif($at_gun=="Лазерное оружие")$at_gun=20;
  216.  
  217. $gun_cop=rand(6,17);
  218.  
  219. if($gun_cop==6)$cop_gun="Беретта";
  220. elseif($gun_cop==7)$cop_gun="Меч";
  221. elseif($gun_cop==8)$cop_gun="Калашников";
  222. elseif($gun_cop==9)$cop_gun="Взрывчатка";
  223. elseif($gun_cop==10)$cop_gun="Электрошокер";
  224. elseif($gun_cop==11)$cop_gun="Напалм";
  225. elseif($gun_cop==12)$cop_gun="Базука";
  226. elseif($gun_cop==13)$cop_gun="Гранатомет";
  227. elseif($gun_cop==14)$cop_gun="ПЗРК";
  228. elseif($gun_cop==15)$cop_gun="Слонобой";
  229. elseif($gun_cop==16)$cop_gun="Ракетная установка";
  230. elseif($gun_cop==17)$cop_gun="МЕ 85 Combat";
  231.  
  232. $police=$police+3;
  233. if($gun_cop>$at_gun)
  234. {
  235. --$level;
  236. if($level<0)$level=0;
  237. $health=$health-50;
  238. if($health<0) $health=0;
  239. mysql_query("update users set health='".$health."',police='".$police."',level='".$level."' where id='".$id."';");
  240. print $lang['bank_grab_fuck']." ".$cop_gun."!<br/>".$lang['bank_grab_health']." ".$health."%<br/>";
  241. }
  242. else
  243. {
  244. ++$level;
  245. $grab_money=$money+rand(50,500);
  246. mysql_query("update users set money='".$grab_money."',police='".$police."',level='".$level."' where id='".$id."';");
  247. mysql_query("update krisha set money='0' where city='1' and house='supermarket';");
  248. print "Yo, да ты крут! Ты вынес всю наличку из супермаркета! Теперь у тебя" .$grab_money."$$<br/>";
  249. }
  250.  
  251.  
  252. }
  253.  
  254.  
  255.  
  256. case "at_kr":
  257. if(!empty($band) && $band!=$bband)
  258. {
  259. $band_array_att=mysql_fetch_array(mysql_query("select avtoritet from bands where name='".$band."';"));
  260. $band_array_kr=mysql_fetch_array(mysql_query("select boss,avtoritet from bands where name='".$bband."';"));
  261.  
  262. $avtoritet_att=$band_array_att['avtoritet'];
  263. $boss_kr=$band_array_kr['boss'];
  264. $avtoritet_kr=$band_array_kr['avtoritet'];
  265.  
  266. if($avtoritet_att>$avtoritet_kr)
  267. {
  268. mysql_query("update krisha set band='".$band."' where city='2' and house='supermarket';'");
  269. print $lang['rest_kr_another_band']." ".$band."!<br/>";
  270.  
  271.  
  272. $db_boss=mysql_fetch_array(mysql_query("select id,pass from users where login='".$boss_kr."';"));
  273. $dbid=$db_boss['id'];
  274. $dbpass=$db_boss['pass'];
  275. $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>]";
  276. mysql_query("insert into messagi values(0,'0','$dbid','$messaga');");
  277.  
  278. }
  279. elseif($avtoritet_att<=$avtoritet_kr)
  280. {
  281. print $lang['bank_small_level'];
  282. }
  283.  
  284. }
  285. else
  286. {
  287. print $lang['error']."<br/>";
  288. }
  289.  
  290.  
  291. print "&gt;<a href=\"supermarket.php?id=$id&amp;pass=$pass\">".$lang['supermarket']."</a><br/>";
  292. break;
  293. case "gp":
  294. if(($btime+3600)<time())
  295. {
  296. $band_array=mysql_fetch_array(mysql_query("select boss,money from bands where name='".$bband."';"));
  297. $percents=rand(1,2);
  298. $bmoney=$bmoney-$percents;
  299. $band_money=$band_array['money'];
  300. $band_boss=$band_array['boss'];
  301. $band_money=$band_money+$percents;
  302. mysql_query("update krisha set money='".$bmoney."',time='".time()."' where city='2' and house='supermarket';");
  303. mysql_query("update bands set money='".$band_money."' where name='".$bband."';");
  304. print $percents."$$ ".$lang['bank_now_at_obwak']."<br/>";
  305. $db_boss=mysql_fetch_array(mysql_query("select id,pass from users where login='".$band_boss."';"));
  306. $dbid=$db_boss['id'];
  307. $dbpass=$db_boss['pass'];
  308. $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>]";
  309. mysql_query("insert into messagi values(0,'0','$dbid','$messaga');");
  310. }
  311. else
  312. {
  313. print $lang['bank_kto-to']." ".$bband." ".$lang['bank_uje']."<br/>";
  314. }
  315.  
  316. print "&gt;<a href=\"supermarket.php?id=$id&amp;pass=$pass\">".$lang['supermarket']."</a><br/>";
  317.  
  318. break;
  319.  
  320. default:
  321. print $lang['supermarket_mes'];
  322.  
  323. 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/>";
  324. elseif(!empty($bband) && $bband!=$band && $band!='')
  325. {
  326. print "<a href=\"supermarket.php?id=$id&amp;pass=$pass&amp;mode=at_kr\">".$lang['bank_att_krisha']."</a><br/>";
  327. }
  328. if($band==$bband && $band!='') print "<a href=\"supermarket.php?id=$id&amp;pass=$pass&amp;mode=gp\">".$lang['bank_get_percent']."</a><br/>";
  329. print "<a href=\"supermarket.php?id=$id&amp;pass=$pass&amp;mode=grab\">Ограбить</a><br/>";
  330. print "<a href=\"supermarket.php?id=$id&amp;pass=$pass&amp;mode=eat\">Купить продукты</a><br/>";
  331. break;
  332. }
  333.  
  334.  
  335. print "---<br/>&gt;<a href=\"index.php?id=$id&amp;pass=$pass\">".$lang['in_city']."</a>";
  336. print "<br/>&gt;&gt;<a href=\"./../game.php?id=$id&amp;pass=$pass\">".$lang['menu']."</a>";
  337. print "<br/>---";
  338.  
  339. mysql_close();
  340. include "./../includes/footer.php";
  341. echo '<br/><br/>-------<br/><div class="msg"><a href="http://wenz.net.ru">Сайт вап мастеру</a></div><br/>';
  342.  
  343. ?>