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

Размер файла: 6.55Kb
  1. <?php
  2.  
  3. $r=rand(10000,1000000);
  4.  
  5. $file='./../data/dp.dat';
  6. if (file_exists($file))
  7. {
  8. $fp = fopen($file, "r");
  9. $dp = fread($fp, 20);
  10. fclose($fp);
  11. }
  12. else
  13. {
  14. $fp = fopen($file, "w");
  15. chmod($file, 0666);
  16. fwrite($file, 1000);
  17. fclose($fp);
  18. }
  19.  
  20. include "./../ini.php";
  21. include "./../includes/header.php";
  22. include "./../includes/inc_online.php";
  23. print "<p><small>";
  24.  
  25. $id=cyr(htmlspecialchars(stripslashes(trim($id))));
  26. $pass=cyr(htmlspecialchars(stripslashes(trim($pass))));
  27.  
  28. if(!empty($id))
  29. {
  30. $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."';");
  31. }
  32. else
  33. {
  34. die ($lang['empty_login']."</small></p></card></wml>");
  35. }
  36.  
  37. $data = mysql_fetch_array($q);
  38.  
  39. $id=$data['id'];
  40. $login=$data['login'];
  41. $money=$data['money'];
  42. $level=$data['level'];
  43. $police=$data['police'];
  44. $stage=$data['stage'];
  45. $health=$data['health'];
  46. $cars=$data['cars'];
  47. $guns=$data['guns'];
  48. $nums=$data['nums'];
  49. $voo_por=$data['voodoo'];
  50. $golod=$data['golod'];
  51. $secur=$data['secur'];
  52. $zav=$data['zav'];
  53. $lsd=$data['lsd'];
  54. $ban=$data['ban'];
  55.  
  56. if($pass!=$data['pass'])
  57. {
  58. die ($lang['empty_login']."</small></p></card></wml>");
  59. }
  60.  
  61. mysql_query("update users set last='".time()."',city='1' where id='".$id."';");
  62. if($ban==0)
  63. {
  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. print "<b>".$lang['game_city1']."</b><br/>";
  76. print "<u>[".$lang['area_play']."]</u><br/>";
  77.  
  78.  
  79. include "./../includes/inc_play.php";
  80. if (isset($stavka))
  81. {
  82. if ($money < $stavka)
  83. {
  84. print ''.$lang['pl_no_money'].'<br/>
  85. &gt;<a href="play.php?id='.$id.'&amp;pass='.$pass.'">'.$lang['area_play'].'</a><br/>';
  86. }
  87. else
  88. {
  89. /* */
  90. if ($stavka == $st[0])
  91. {
  92. $c1 = charGenerator("0178",1);
  93. $c2 = charGenerator("3567",1);
  94. $c3 = charGenerator("2497",1);
  95.  
  96. }
  97. /* , ..) */
  98. elseif ($stavka == $st[1])
  99. {
  100. $c1 = charGenerator("01356789",1);
  101. $c2 = charGenerator("01356789",1);
  102. $c3 = charGenerator("01356789",1);
  103.  
  104. }
  105. /* , */
  106. elseif ($stavka == $st[2])
  107. {
  108. $c1 = charGenerator("0125689",1);
  109. $c2 = charGenerator("0125689",1);
  110. $c3 = charGenerator("0125689",1);
  111. }
  112. /* */
  113. elseif ($stavka == $st[3])
  114. {
  115. $c1 = charGenerator("02479",1);
  116. $c2 = charGenerator("02479",1);
  117. $c3 = charGenerator("02479",1);
  118. }
  119. /* ) */
  120. elseif ($stavka == $st[4])
  121. {
  122. $c1 = charGenerator("2579",1);
  123. $c2 = charGenerator("2579",1);
  124. $c3 = charGenerator("2579",1);
  125.  
  126. }
  127. else
  128. {
  129. print $lang['error'];
  130. $err=1;
  131. }
  132. if ($err != 1)
  133. {
  134. if ($c1 == $c2 and $c2 != $c3)
  135. {
  136. $money = $money + $two;
  137. mysql_query("update users set money='".$money."' where id='".$id."'");
  138. print "".$lang['pl_pr']." $two</b><br/>
  139. <b>$c1-$c2</b>-$c3<br/>";
  140. }
  141. elseif ($c2 == $c3 and $c2 != $c1)
  142. {
  143. $money = $money + $two;
  144. mysql_query("update users set money='".$money."' where id='".$id."'");
  145. print "".$lang['pl_pr']." $two</b><br/>
  146. $c1-<b>$c2-$c3</b><br/>";
  147. }
  148. elseif ($c1 == $c2 and $c2 == $c3)
  149. {
  150. if ($c1 != 7)
  151. {
  152. $m2 = what_money($c1);
  153. $money = $money + $m2;
  154. mysql_query("update users set money='".$money."' where id='".$id."'");
  155. print "".$lang['pl_pr']."".$m2."</b><br/>";
  156. }
  157. else
  158. {
  159. $money = $money + $dp;
  160. print "".$lang['pl_cool']."<br/><b>$$".$dp." </b> ".$lang['pl_your']."<br/>";
  161. mysql_query("update users set money='".$money."' where id='".$id."'");
  162. $fp = fopen($file, "w");
  163. fwrite($fp, 1000);
  164. fclose($fp);
  165. }
  166. print "<b>$c1-$c2-$c3</b><br/>";
  167. }
  168. else
  169. {
  170. $money = $money - $stavka;
  171. $dp = $dp + $stavka;
  172. $fp = fopen($file, "w");
  173. fwrite($fp, $dp);
  174. fclose($fp);
  175. mysql_query("update users set money='".$money."' where id='".$id."'");
  176. print "".$lang['pl_no']."<br/>$c1-$c2-$c3<br/>";
  177. }
  178.  
  179. }
  180.  
  181. print '<anchor>'.$lang['pl_al'].'
  182. <go href="play.php?id='.$id.'&amp;pass='.$pass.'&amp;r='.$r.'" method="post">
  183. <postfield name="stavka" value="'.$stavka.'"/>
  184. </go></anchor><br/>
  185. &gt;<a href="play.php?id='.$id.'&amp;pass='.$pass.'">'.$lang['area_play'].'</a><br/>';
  186. }
  187. }
  188. /* */
  189. else
  190. {
  191. print ''.$lang['pl_dp'].' <b>'.$dp.'</b><br/>'.$lang['pl_your_money'].''.$money.'</b><br/>['.$lang['pl_stavka'].']<br/>
  192. </small><select name="stavka" title="'.$lang['pl_stavka'].'">
  193. ';
  194. for ($i=0; $i < count($st); $i++)
  195. {
  196. print '<option value="'.$st[$i].'">'.$st[$i].'$$</option>';
  197. }
  198. print '
  199. </select><small><br/>
  200. <anchor>'.$lang['ok'].'
  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="kasino.php?id='.$id.'&amp;pass='.$pass.'">'.$lang['area_kasino'].'</a><br/>
  205. ';
  206. }
  207.  
  208. print "---<br/>&gt;<a href=\"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. }
  215.  
  216. elseif($ban==1)
  217. {
  218. die ($lang['empty_login']."</small></p></card></wml>");
  219.  
  220. }
  221. ?>