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

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