Просмотр файла city1/gunman.php

Размер файла: 6.38Kb
  1. <?php
  2. include "./../ini.php";
  3. include "./../includes/header.php";
  4. include "./../includes/inc_online.php";
  5. print "<p><small>";
  6.  
  7. $id=cyr(htmlspecialchars(stripslashes(trim($id))));
  8. $pass=cyr(htmlspecialchars(stripslashes(trim($pass))));
  9.  
  10. if(!empty($id))
  11. {
  12. $q = mysql_query("select secur,golod,voodoo,nums,guns,cars,id,login,pass,money,level,police,health,zav,lsd,ban from users where id='".$id."';");
  13. }
  14. else
  15. {
  16. die ($lang['empty_login']."</small></p></card></wml>");
  17. }
  18.  
  19. $data = mysql_fetch_array($q);
  20.  
  21. $id=$data['id'];
  22. $login=$data['login'];
  23. $money=$data['money'];
  24. $level=$data['level'];
  25. $police=$data['police'];
  26. $stage=$data['stage'];
  27. $health=$data['health'];
  28. $cars=$data['cars'];
  29. $guns=$data['guns'];
  30. $nums=$data['nums'];
  31. $voo_por=$data['voodoo'];
  32. $golod=$data['golod'];
  33. $secur=$data['secur'];
  34. $zav=$data['zav'];
  35. $lsd=$data['lsd'];
  36. $ban=$data['ban'];
  37.  
  38. if($pass!=$data['pass'])
  39. {
  40. die ($lang['empty_login']."</small></p></card></wml>");
  41. }
  42.  
  43. if($level<50)
  44. {
  45. die ($lang['error']."</small></p></card></wml>");
  46. }
  47.  
  48. mysql_query("update users set last='".time()."',city='2' where id='".$id."';");
  49. if($ban==0)
  50. {
  51.  
  52. include "./../includes/inc_secur.php";
  53. include "./../includes/inc_golod.php";
  54. include "./../includes/inc_hospital.php";
  55. include "./../includes/inc_police.php";
  56. include "./../includes/inc_die.php";
  57. include "./../includes/inc_voodoo.php";
  58. include "./../includes/inc_attack.php";
  59. include "./../includes/inc_mes.php";
  60. print "<b>[Зд: $health %][Сыт: $golod %][Зщ: $secur %]</b><br/>";
  61. print "<b>".$lang['game_city2']."</b><br/>";
  62.  
  63. print "<u>[".$lang['gm2_name']."]</u><br/>";
  64.  
  65. switch ($mode)
  66. {
  67.  
  68. case p:
  69. if(empty($gun_sale))
  70. {
  71. if(!empty($guns))
  72. {
  73. if(empty($gun_sale))
  74. $guns_count = explode(".", $guns);
  75. $count_guns=count($guns_count);
  76. for($i=0;$i<$count_guns;$i++)
  77. {
  78. print "<option value=\"".$guns_count[$i]."\">".$guns_count[$i]."</option>";
  79. }
  80. print "</select><small><br/>";
  81. print "<anchor>".$lang['ok']."<go href=\"./../city2/index.php?id=$id&amp;pass=$pass&amp;mode=p\" method=\"post\">
  82. <postfield name=\"gun_sale\" value=\"$(gun_sale)\"/>
  83. </go></anchor>";
  84. }
  85. else
  86. {
  87. print $lang['bs_error'];
  88. }
  89. }
  90. else
  91. {
  92.  
  93.  
  94.  
  95. $check=mysql_fetch_array(mysql_query("select guns from users where id='".$id."';"));
  96. $ch_guns_ar=$check['guns'];
  97. $ch_guns=explode('.',$ch_guns_ar);
  98. if(!in_array($gun_sale,$ch_guns)) print $lang['error'];
  99. else
  100. {
  101.  
  102. $gun_sale=cyr(htmlspecialchars(stripslashes(trim($gun_sale))));
  103. if($gun_sale==$lang['gun1'] && !empty($guns))
  104. {
  105. $money=$money+5;
  106. mysql_query("update users set money='".$money."' where id='".$id."';");
  107. }
  108. elseif($gun_sale==$lang['gun2'] && !empty($guns))
  109. {
  110. $money=$money+10;
  111. mysql_query("update users set money='".$money."' where id='".$id."';");
  112. }
  113. elseif($gun_sale==$lang['gun4'] && !empty($guns))
  114. {
  115. $money=$money+25;
  116. mysql_query("update users set money='".$money."' where id='".$id."';");
  117. }
  118. elseif($gun_sale==$lang['gun5'] && !empty($guns))
  119. {
  120. $money=$money+30;
  121. mysql_query("update users set money='".$money."' where id='".$id."';");
  122. }
  123. elseif($gun_sale==$lang['gun6'] && !empty($guns))
  124. {
  125. $money=$money+35;
  126. mysql_query("update users set money='".$money."' where id='".$id."';");
  127. }
  128. elseif($gun_sale==$lang['gun7'] && !empty($guns))
  129. {
  130. $money=$money+60;
  131. mysql_query("update users set money='".$money."' where id='".$id."';");
  132. }
  133. elseif($gun_sale==$lang['gun9'] && !empty($guns))
  134. {
  135. $money=$money+100;
  136. mysql_query("update users set money='".$money."' where id='".$id."';");
  137. }
  138. elseif($gun_sale==$lang['gun10'] && !empty($guns))
  139. {
  140. $money=$money+150;
  141. mysql_query("update users set money='".$money."' where id='".$id."';");
  142. }
  143.  
  144. $guns_array = explode(".", $guns);
  145. if(count($guns_array)<=1)
  146. {
  147. $guns=str_replace("$gun_sale","","$guns");
  148. mysql_query("update users set guns='$guns' where id='$id';");
  149. }
  150. elseif(count($guns_array)>1 && $guns_array[0]!=$gun_sale)
  151. {
  152. $guns=str_replace(".$gun_sale","","$guns");
  153. mysql_query("update users set guns='$guns' where id='$id';");
  154. }
  155. elseif(count($guns_array)>1 && $guns_array[0]==$gun_sale)
  156. {
  157. $guns=str_replace("$gun_sale.","","$guns");
  158. mysql_query("update users set guns='$guns' where id='$id';");
  159. }
  160.  
  161. print $lang['gm_saled']." ".$money." $$!";
  162.  
  163. }
  164. }
  165.  
  166. print "<br/>&gt;<a href=\"gunman.php?id=$id&amp;pass=$pass\">".$lang['city2_gunman']."</a><br/>";
  167. break;
  168.  
  169. case k:
  170. if(!empty($p) && $money>=$p)
  171. {
  172. $p=cyr(htmlspecialchars(stripslashes(trim($p))));
  173. if($p==100000) $gun=$lang['gun11'];
  174. elseif($p==300000) $gun=$lang['gun13'];
  175. elseif($p==500000) $gun=$lang['gun14'];
  176. elseif($p==1000000) $gun=$lang['gun12'];
  177. else
  178. {
  179. die($lang['error']."<br/><anchor>".$lang['back']."<prev/></anchor></small></p></card></wml>");
  180. }
  181. include "./../includes/inc_in_array.php";
  182. if(empty($guns))
  183. {
  184. $money=$money-$p;
  185. mysql_query("update users set guns='$gun',money='$money' where id='".$id."';");
  186. }
  187. elseif(!empty($guns))
  188. {
  189. $money=$money-$p;
  190. mysql_query("update users set guns='$guns.$gun',money='$money' where id='".$id."';");
  191. }
  192. print $lang['city1_yo_man']." $gun-".$lang['city1_best_purchase']."<br/>";
  193. }
  194. elseif($money<=$p)
  195. {
  196. print $lang['city1_dont_have_money']."<br/>";
  197. }
  198. print $lang['city1_at_you']." <b>$money $$</b> ".$lang['city1_want_buy']."<br/>";
  199. print "<a href=\"gunman.php?id=$id&amp;pass=$pass&amp;mode=k&amp;p=100000\">".$lang['gun11']."</a>(100000 $$),<br/>";
  200. print "<a href=\"gunman.php?id=$id&amp;pass=$pass&amp;mode=k&amp;p=300000\">".$lang['gun13']."</a>(300000 $$),<br/>";
  201. print "<a href=\"gunman.php?id=$id&amp;pass=$pass&amp;mode=k&amp;p=500000\">".$lang['gun14']."</a>(500000 $$),<br/>";
  202. print "<a href=\"gunman.php?id=$id&amp;pass=$pass&amp;mode=k&amp;p=1000000\">".$lang['gun12']."</a>(1000000 $$)<br/>";
  203. print "&gt;<a href=\"gunman.php?id=$id&amp;pass=$pass\">".$lang['city2_gunman2']."</a><br/>";
  204. break;
  205.  
  206. default:
  207. print $lang['gm2_hello'];
  208. print "<a href=\"gunman.php?id=$id&amp;pass=$pass&amp;mode=k\">Нy давай поcмотpим</a><br/>";
  209. print "<a href=\"./../city2/index.php?id=$id&amp;pass=$pass\">".$lang['gm_p2']."</a><br/>";
  210. break;
  211. }
  212.  
  213.  
  214. print "---<br/>&gt;<a href=\"./../city2/index.php?id=$id&amp;pass=$pass\">".$lang['in_city']."</a>";
  215. print "<br/>&gt;&gt;<a href=\"./../game.php?id=$id&amp;pass=$pass\">".$lang['menu']."</a>";
  216. print "<br/>---";
  217.  
  218. mysql_close();
  219. include "./../includes/footer.php";
  220. }
  221.  
  222. elseif($ban==1)
  223. {
  224. die ($lang['empty_login']."</small></p></card></wml>");
  225.  
  226. }
  227. ?>