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

Размер файла: 9.35Kb
  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,voodoo,nums,guns,cars,id,login,pass,money,level,police,health,zav,lsd,ban from users where id='".$id."';");
  27. }
  28. else
  29. {
  30. die ($lang['empty_login']."</small></p></card></wml>");
  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. $voo_por=$data['voodoo'];
  46. $golod=$data['golod'];
  47. $secur=$data['secur'];
  48. $zav=$data['zav'];
  49. $lsd=$data['lsd'];
  50. $ban=$data['ban'];
  51.  
  52. if($pass!=$data['pass'])
  53. {
  54. die ($lang['empty_login']."</small></p></card></wml>");
  55. }
  56.  
  57. if($level<50)
  58. {
  59. die ($lang['error']."</small></p></card></wml>");
  60. }
  61.  
  62. mysql_query("update users set last='".time()."',city='2' where id='".$id."';");
  63. if($ban==0)
  64. {
  65.  
  66. include "./../includes/inc_secur.php";
  67. include "./../includes/inc_golod.php";
  68. include "./../includes/inc_hospital.php";
  69. include "./../includes/inc_police.php";
  70. include "./../includes/inc_die.php";
  71. include "./../includes/inc_voodoo.php";
  72. include "./../includes/inc_attack.php";
  73. include "./../includes/inc_mes.php";
  74. print "<b>[Зд: $health %][Сыт: $golod %][Зщ: $secur %]</b><br/>";
  75. $result = mysql_query("SELECT * FROM `themes`");
  76. $ths = mysql_num_rows($result);
  77. $result = mysql_query("SELECT * FROM `posts`");
  78. $pts = mysql_num_rows($result);
  79. echo'<a href="./../forum.php?id='.$id.'&amp;pass='.$pass.'">Форум</a> (<b>'.$ths.'</b>|<b>'.$pts.'</b>)<br/>';
  80.  
  81. print "<b>".$lang['game_city2']."</b><br/>";
  82.  
  83. print "<u>[".$lang['gm_name']."]</u><br/>";
  84.  
  85. switch ($mode)
  86. {
  87. case "p":
  88.  
  89. if(empty($gun_sale))
  90. {
  91. if(!empty($guns))
  92. {
  93. $guns_count = explode(".", $guns);
  94. $count_guns=count($guns_count);
  95. print $lang['game_guns']." <b>($count_guns)</b>:<br/></small><select name=\"gun_sale\">";
  96. for($i=0;$i<$count_guns;$i++)
  97. {
  98. print "<option value=\"".$guns_count[$i]."\">".$guns_count[$i]."</option>";
  99. }
  100. print "</select><small><br/>";
  101. print "<anchor>".$lang['ok']."<go href=\"gunman.php?id=$id&amp;pass=$pass&amp;mode=p\" method=\"post\">
  102. <postfield name=\"gun_sale\" value=\"$(gun_sale)\"/>
  103. </go></anchor>";
  104. }
  105. else
  106. {
  107. print $lang['bs_error'];
  108. }
  109. }
  110. else
  111. {
  112.  
  113.  
  114.  
  115. $check=mysql_fetch_array(mysql_query("select guns from users where id='".$id."';"));
  116. $ch_guns_ar=$check['guns'];
  117. $ch_guns=explode('.',$ch_guns_ar);
  118. if(!in_array($gun_sale,$ch_guns)) print $lang['error'];
  119. else
  120. {
  121.  
  122. $gun_sale=cyr(htmlspecialchars(stripslashes(trim($gun_sale))));
  123. if($gun_sale=="Кастет" && !empty($guns))
  124. {
  125. $money=$money+2;
  126. mysql_query("update users set money='".$money."' where id='".$id."';");
  127. }
  128. elseif($gun_sale=="Нож" && !empty($guns))
  129. {
  130. $money=$money+15;
  131. mysql_query("update users set money='".$money."' where id='".$id."';");
  132. }
  133. elseif($gun_sale=="Дубинка" && !empty($guns))
  134. {
  135. $money=$money+25;
  136. mysql_query("update users set money='".$money."' where id='".$id."';");
  137. }
  138. elseif($gun_sale=="ПМ" && !empty($guns))
  139. {
  140. $money=$money+40;
  141. mysql_query("update users set money='".$money."' where id='".$id."';");
  142. }
  143. elseif($gun_sale=="Мачете" && !empty($guns))
  144. {
  145. $money=$money+100;
  146. mysql_query("update users set money='".$money."' where id='".$id."';");
  147. }
  148. elseif($gun_sale=="Беретта" && !empty($guns))
  149. {
  150. $money=$money+250;
  151. mysql_query("update users set money='".$money."' where id='".$id."';");
  152. }
  153. elseif($gun_sale=="Меч" && !empty($guns))
  154. {
  155. $money=$money+400;
  156. mysql_query("update users set money='".$money."' where id='".$id."';");
  157. }
  158. elseif($gun_sale=="Калашников" && !empty($guns))
  159. {
  160. $money=$money+600;
  161. mysql_query("update users set money='".$money."' where id='".$id."';");
  162. }
  163. elseif($gun_sale=="Взрывчатка" && !empty($guns))
  164. {
  165. $money=$money+750;
  166. mysql_query("update users set money='".$money."' where id='".$id."';");
  167. }
  168. elseif($gun_sale=="Электрошокер" && !empty($guns))
  169. {
  170. $money=$money+1250;
  171. mysql_query("update users set money='".$money."' where id='".$id."';");
  172. }
  173. elseif($gun_sale=="Напалм" && !empty($guns))
  174. {
  175. $money=$money+2000;
  176. mysql_query("update users set money='".$money."' where id='".$id."';");
  177. }
  178. elseif($gun_sale=="Базука" && !empty($guns))
  179. {
  180. $money=$money+2500;
  181. mysql_query("update users set money='".$money."' where id='".$id."';");
  182. }
  183. elseif($gun_sale=="Гранатомет" && !empty($guns))
  184. {
  185. $money=$money+5000;
  186. mysql_query("update users set money='".$money."' where id='".$id."';");
  187. }
  188. elseif($gun_sale=="ПЗРК" && !empty($guns))
  189. {
  190. $money=$money+10000;
  191. mysql_query("update users set money='".$money."' where id='".$id."';");
  192. }
  193. elseif($gun_sale=="Слонобой" && !empty($guns))
  194. {
  195. $money=$money+25000;
  196. mysql_query("update users set money='".$money."' where id='".$id."';");
  197. }
  198. elseif($gun_sale=="Ракетная установка" && !empty($guns))
  199. {
  200. $money=$money+100000;
  201. mysql_query("update users set money='".$money."' where id='".$id."';");
  202. }
  203. elseif($gun_sale=="МЕ 85 Combat" && !empty($guns))
  204. {
  205. $money=$money+250000;
  206. mysql_query("update users set money='".$money."' where id='".$id."';");
  207. }
  208. elseif($gun_sale=="Rohm 735" && !empty($guns))
  209. {
  210. $money=$money+375000;
  211. mysql_query("update users set money='".$money."' where id='".$id."';");
  212. }
  213. elseif($gun_sale=="Brunner CZ 75" && !empty($guns))
  214. {
  215. $money=$money+500000;
  216. mysql_query("update users set money='".$money."' where id='".$id."';");
  217. }
  218. elseif($gun_sale=="Лазерное оружие" && !empty($guns))
  219. {
  220. $money=$money+750000;
  221. mysql_query("update users set money='".$money."' where id='".$id."';");
  222. }
  223.  
  224. $guns_array = explode(".", $guns);
  225. if(count($guns_array)<=1)
  226. {
  227. $guns=str_replace("$gun_sale","","$guns");
  228. mysql_query("update users set guns='$guns' where id='$id';");
  229. }
  230. elseif(count($guns_array)>1 && $guns_array[0]!=$gun_sale)
  231. {
  232. $guns=str_replace(".$gun_sale","","$guns");
  233. mysql_query("update users set guns='$guns' where id='$id';");
  234. }
  235. elseif(count($guns_array)>1 && $guns_array[0]==$gun_sale)
  236. {
  237. $guns=str_replace("$gun_sale.","","$guns");
  238. mysql_query("update users set guns='$guns' where id='$id';");
  239. }
  240.  
  241. print $lang['gm_saled']." ".$money." $$!";
  242.  
  243. }
  244. }
  245.  
  246. print "<br/>&gt;<a href=\"gunman.php?id=$id&amp;pass=$pass\">".$lang['city2_gunman']."</a><br/>";
  247. break;
  248.  
  249. case k:
  250. if(!empty($p) && $money>=$p)
  251. {
  252. $p=cyr(htmlspecialchars(stripslashes(trim($p))));
  253. if($p==4000) $gun="Напалм";
  254. elseif($p==5000) $gun="Базука";
  255. elseif($p==10000) $gun="Гранатомет";
  256. elseif($p==20000) $gun="ПЗРК";
  257. else
  258. {
  259. die($lang['error']."<br/><anchor>".$lang['back']."<prev/></anchor></small></p></card></wml>");
  260. }
  261. include "./../includes/inc_in_array.php";
  262. if(empty($guns))
  263. {
  264. $money=$money-$p;
  265. mysql_query("update users set guns='$gun',money='$money' where id='".$id."';");
  266. }
  267. elseif(!empty($guns))
  268. {
  269. $money=$money-$p;
  270. mysql_query("update users set guns='$guns.$gun',money='$money' where id='".$id."';");
  271. }
  272. print $lang['city1_yo_man']." $gun-".$lang['city1_best_purchase']."<br/>";
  273. }
  274. elseif($money<=$p)
  275. {
  276. print $lang['city1_dont_have_money']."<br/>";
  277. }
  278. print $lang['city1_at_you']." <b>$money $$</b> ".$lang['city1_want_buy']."<br/>";
  279. print "<a href=\"gunman.php?id=$id&amp;pass=$pass&amp;mode=k&amp;p=4000\">Напалм</a>(4000 $$),<br/>";
  280. print "<a href=\"gunman.php?id=$id&amp;pass=$pass&amp;mode=k&amp;p=5000\">Базука</a>(5000 $$),<br/>";
  281. print "<a href=\"gunman.php?id=$id&amp;pass=$pass&amp;mode=k&amp;p=10000\">Гранатомет</a>(10000 $$),<br/>";
  282. print "<a href=\"gunman.php?id=$id&amp;pass=$pass&amp;mode=k&amp;p=20000\">ПЗРК</a>(20000 $$)<br/>";
  283. print "&gt;<a href=\"gunman.php?id=$id&amp;pass=$pass\">".$lang['city2_gunman']."</a><br/>";
  284. break;
  285.  
  286. default:
  287. print $lang['gm_hello'];
  288. print "<a href=\"gunman.php?id=$id&amp;pass=$pass&amp;mode=k\">".$lang['gm_k']."</a><br/>";
  289. break;
  290. }
  291.  
  292.  
  293. print "---<br/>&gt;<a href=\"index.php?id=$id&amp;pass=$pass\">".$lang['in_city']."</a>";
  294. print "<br/>&gt;&gt;<a href=\"./../game.php?id=$id&amp;pass=$pass\">".$lang['menu']."</a>";
  295. print "<br/>---";
  296.  
  297. mysql_close();
  298. include "./../includes/footer.php";
  299. echo '<br/><br/>-------<br/><div class="msg"><a href="http://wenz.net.ru">Сайт вап мастеру</a></div><br/>';
  300.  
  301. }
  302.  
  303. elseif($ban==1)
  304. {
  305. die ($lang['empty_login']."</small></p></card></wml>");
  306.  
  307. }
  308. ?>