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

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