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

Размер файла: 7.61Kb
  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. $r=rand(10000,1000000);
  17.  
  18. $file='./../data/dp.dat';
  19. if (file_exists($file))
  20. {
  21. $fp = fopen($file, "r");
  22. $dp = fread($fp, 20);
  23. fclose($fp);
  24. }
  25. else
  26. {
  27. $fp = fopen($file, "w");
  28. chmod($file, 0666);
  29. fwrite($file, 1000);
  30. fclose($fp);
  31. }
  32.  
  33. include "./../ini.php";
  34. include "./../includes/header.php";
  35. include "./../includes/inc_online.php";
  36. print "<p><small>";
  37.  
  38. $id=cyr(htmlspecialchars(stripslashes(trim($id))));
  39. $pass=cyr(htmlspecialchars(stripslashes(trim($pass))));
  40.  
  41. if(!empty($id))
  42. {
  43. $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."';");
  44. }
  45. else
  46. {
  47. die ($lang['empty_login']."</small></p></card></wml>");
  48. }
  49.  
  50. $data = mysql_fetch_array($q);
  51.  
  52. $id=$data['id'];
  53. $login=$data['login'];
  54. $money=$data['money'];
  55. $level=$data['level'];
  56. $police=$data['police'];
  57. $stage=$data['stage'];
  58. $health=$data['health'];
  59. $cars=$data['cars'];
  60. $guns=$data['guns'];
  61. $nums=$data['nums'];
  62. $voo_por=$data['voodoo'];
  63. $golod=$data['golod'];
  64. $secur=$data['secur'];
  65. $zav=$data['zav'];
  66. $lsd=$data['lsd'];
  67. $ban=$data['ban'];
  68.  
  69. if($pass!=$data['pass'])
  70. {
  71. die ($lang['empty_login']."</small></p></card></wml>");
  72. }
  73.  
  74. mysql_query("update users set last='".time()."',city='1' where id='".$id."';");
  75. if($ban==0)
  76. {
  77.  
  78.  
  79. include "./../includes/inc_secur.php";
  80. include "./../includes/inc_golod.php";
  81. include "./../includes/inc_hospital.php";
  82. include "./../includes/inc_police.php";
  83. include "./../includes/inc_die.php";
  84. include "./../includes/inc_voodoo.php";
  85. include "./../includes/inc_attack.php";
  86. include "./../includes/inc_mes.php";
  87. print "<b>[Зд: $health %][Сыт: $golod %][Зщ: $secur %]</b><br/>";
  88. $result = mysql_query("SELECT * FROM `themes`");
  89. $ths = mysql_num_rows($result);
  90. $result = mysql_query("SELECT * FROM `posts`");
  91. $pts = mysql_num_rows($result);
  92. echo'<a href="./../forum.php?id='.$id.'&amp;pass='.$pass.'">Форум</a> (<b>'.$ths.'</b>|<b>'.$pts.'</b>)<br/>';
  93.  
  94. print "<b>".$lang['game_city1']."</b><br/>";
  95. print "<u>[".$lang['area_play']."]</u><br/>";
  96.  
  97.  
  98. include "./../includes/inc_play.php";
  99. if (isset($stavka))
  100. {
  101. if ($money < $stavka)
  102. {
  103. print ''.$lang['pl_no_money'].'<br/>
  104. &gt;<a href="play.php?id='.$id.'&amp;pass='.$pass.'">'.$lang['area_play'].'</a><br/>';
  105. }
  106. else
  107. {
  108. /* */
  109. if ($stavka == $st[0])
  110. {
  111. $c1 = charGenerator("0178",1);
  112. $c2 = charGenerator("3567",1);
  113. $c3 = charGenerator("2497",1);
  114.  
  115. }
  116. /* , ..) */
  117. elseif ($stavka == $st[1])
  118. {
  119. $c1 = charGenerator("01356789",1);
  120. $c2 = charGenerator("01356789",1);
  121. $c3 = charGenerator("01356789",1);
  122.  
  123. }
  124. /* , */
  125. elseif ($stavka == $st[2])
  126. {
  127. $c1 = charGenerator("0125689",1);
  128. $c2 = charGenerator("0125689",1);
  129. $c3 = charGenerator("0125689",1);
  130. }
  131. /* */
  132. elseif ($stavka == $st[3])
  133. {
  134. $c1 = charGenerator("02479",1);
  135. $c2 = charGenerator("02479",1);
  136. $c3 = charGenerator("02479",1);
  137. }
  138. /* ) */
  139. elseif ($stavka == $st[4])
  140. {
  141. $c1 = charGenerator("2579",1);
  142. $c2 = charGenerator("2579",1);
  143. $c3 = charGenerator("2579",1);
  144.  
  145. }
  146. else
  147. {
  148. print $lang['error'];
  149. $err=1;
  150. }
  151. if ($err != 1)
  152. {
  153. if ($c1 == $c2 and $c2 != $c3)
  154. {
  155. $money = $money + $two;
  156. mysql_query("update users set money='".$money."' where id='".$id."'");
  157. print "".$lang['pl_pr']." $two</b><br/>
  158. <b>$c1-$c2</b>-$c3<br/>";
  159. }
  160. elseif ($c2 == $c3 and $c2 != $c1)
  161. {
  162. $money = $money + $two;
  163. mysql_query("update users set money='".$money."' where id='".$id."'");
  164. print "".$lang['pl_pr']." $two</b><br/>
  165. $c1-<b>$c2-$c3</b><br/>";
  166. }
  167. elseif ($c1 == $c2 and $c2 == $c3)
  168. {
  169. if ($c1 != 7)
  170. {
  171. $m2 = what_money($c1);
  172. $money = $money + $m2;
  173. mysql_query("update users set money='".$money."' where id='".$id."'");
  174. print "".$lang['pl_pr']."".$m2."</b><br/>";
  175. }
  176. else
  177. {
  178. $money = $money + $dp;
  179. print "".$lang['pl_cool']."<br/><b>$$".$dp." </b> ".$lang['pl_your']."<br/>";
  180. mysql_query("update users set money='".$money."' where id='".$id."'");
  181. $fp = fopen($file, "w");
  182. fwrite($fp, 1000);
  183. fclose($fp);
  184. }
  185. print "<b>$c1-$c2-$c3</b><br/>";
  186. }
  187. else
  188. {
  189. $money = $money - $stavka;
  190. $dp = $dp + $stavka;
  191. $fp = fopen($file, "w");
  192. fwrite($fp, $dp);
  193. fclose($fp);
  194. mysql_query("update users set money='".$money."' where id='".$id."'");
  195. print "".$lang['pl_no']."<br/>$c1-$c2-$c3<br/>";
  196. }
  197.  
  198. }
  199.  
  200. print '<anchor>'.$lang['pl_al'].'
  201. <go href="play.php?id='.$id.'&amp;pass='.$pass.'&amp;r='.$r.'" method="post">
  202. <postfield name="stavka" value="'.$stavka.'"/>
  203. </go></anchor><br/>
  204. &gt;<a href="play.php?id='.$id.'&amp;pass='.$pass.'">'.$lang['area_play'].'</a><br/>';
  205. }
  206. }
  207. /* */
  208. else
  209. {
  210. print ''.$lang['pl_dp'].' <b>'.$dp.'</b><br/>'.$lang['pl_your_money'].''.$money.'</b><br/>['.$lang['pl_stavka'].']<br/>
  211. </small><select name="stavka" title="'.$lang['pl_stavka'].'">
  212. ';
  213. for ($i=0; $i < count($st); $i++)
  214. {
  215. print '<option value="'.$st[$i].'">'.$st[$i].'$$</option>';
  216. }
  217. print '
  218. </select><small><br/>
  219. <anchor>'.$lang['ok'].'
  220. <go href="play.php?id='.$id.'&amp;pass='.$pass.'&amp;r='.$r.'" method="post">
  221. <postfield name="stavka" value="$('.stavka.')"/>
  222. </go></anchor><br/>
  223. &gt;<a href="kasino.php?id='.$id.'&amp;pass='.$pass.'">'.$lang['area_kasino'].'</a><br/>
  224. ';
  225. }
  226.  
  227. print "---<br/>&gt;<a href=\"index.php?id=$id&amp;pass=$pass\">".$lang['in_city']."</a>";
  228. print "<br/>&gt;&gt;<a href=\"./../game.php?id=$id&amp;pass=$pass\">".$lang['menu']."</a>";
  229. print "<br/>---";
  230.  
  231. mysql_close();
  232. include "./../includes/footer.php";
  233. }
  234.  
  235. elseif($ban==1)
  236. {
  237. die ($lang['empty_login']."</small></p></card></wml>");
  238.  
  239. }
  240. ?>