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

Размер файла: 6.45Kb
  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 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. $golod=$data['golod'];
  50. $secur=$data['secur'];
  51.  
  52. if($pass!=$data['pass'])
  53. {
  54. die ($lang['empty_login']."</small></p></card></wml>");
  55. }
  56.  
  57. mysql_query("update users set last='".time()."',city='1' where id='".$id."';");
  58.  
  59.  
  60. include "./../includes/inc_secur.php";
  61. include "./../includes/inc_golod.php";
  62. include "./../includes/inc_hospital.php";
  63. include "./../includes/inc_police.php";
  64. include "./../includes/inc_die.php";
  65. include "./../includes/inc_voodoo.php";
  66. include "./../includes/inc_attack.php";
  67. include "./../includes/inc_mes.php";
  68. print "<b>".$lang['game_city1']."</b><br/>";
  69. print "<u>[".$lang['area_play']."]</u><br/>";
  70.  
  71.  
  72. include "./../includes/inc_play.php";
  73. if (isset($stavka))
  74. {
  75. if ($money < $stavka)
  76. {
  77. print ''.$lang['pl_no_money'].'<br/>
  78. &gt;<a href="play.php?id='.$id.'&amp;pass='.$pass.'">'.$lang['area_play'].'</a><br/>';
  79. }
  80. else
  81. {
  82. /*этим способом мало чего мона выиграть*/
  83. if ($stavka == $st[0])
  84. {
  85. $c1 = charGenerator("0178",1);
  86. $c2 = charGenerator("3567",1);
  87. $c3 = charGenerator("2497",1);
  88.  
  89. }
  90. /* если наконец дошло, что первый способ почти наебка..) */
  91. elseif ($stavka == $st[1])
  92. {
  93. $c1 = charGenerator("01356789",1);
  94. $c2 = charGenerator("01356789",1);
  95. $c3 = charGenerator("01356789",1);
  96.  
  97. }
  98. /* увеличим шансы выигрыша, но джек пот этим способом не выиграешь*/
  99. elseif ($stavka == $st[2])
  100. {
  101. $c1 = charGenerator("0125689",1);
  102. $c2 = charGenerator("0125689",1);
  103. $c3 = charGenerator("0125689",1);
  104. }
  105. /* еще больше шансов выиграть */
  106. elseif ($stavka == $st[3])
  107. {
  108. $c1 = charGenerator("02479",1);
  109. $c2 = charGenerator("02479",1);
  110. $c3 = charGenerator("02479",1);
  111. }
  112. /* для тех кто не жмот ) */
  113. elseif ($stavka == $st[4])
  114. {
  115. $c1 = charGenerator("2579",1);
  116. $c2 = charGenerator("2579",1);
  117. $c3 = charGenerator("2579",1);
  118.  
  119. }
  120. else
  121. {
  122. print $lang['error'];
  123. $err=1;
  124. }
  125. if ($err != 1)
  126. {
  127. if ($c1 == $c2 and $c2 != $c3)
  128. {
  129. $money = $money + $two;
  130. mysql_query("update users set money='".$money."' where id='".$id."'");
  131. print "".$lang['pl_pr']." $two</b><br/>
  132. <b>$c1-$c2</b>-$c3<br/>";
  133. }
  134. elseif ($c2 == $c3 and $c2 != $c1)
  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. $c1-<b>$c2-$c3</b><br/>";
  140. }
  141. elseif ($c1 == $c2 and $c2 == $c3)
  142. {
  143. if ($c1 != 7)
  144. {
  145. $m2 = what_money($c1);
  146. $money = $money + $m2;
  147. mysql_query("update users set money='".$money."' where id='".$id."'");
  148. print "".$lang['pl_pr']."".$m2."</b><br/>";
  149. }
  150. else
  151. {
  152. $money = $money + $dp;
  153. print "".$lang['pl_cool']."<br/><b>$$".$dp." </b> ".$lang['pl_your']."<br/>";
  154. mysql_query("update users set money='".$money."' where id='".$id."'");
  155. $fp = fopen($file, "w");
  156. fwrite($fp, 1000);
  157. fclose($fp);
  158. }
  159. print "<b>$c1-$c2-$c3</b><br/>";
  160. }
  161. else
  162. {
  163. $money = $money - $stavka;
  164. $dp = $dp + $stavka;
  165. $fp = fopen($file, "w");
  166. fwrite($fp, $dp);
  167. fclose($fp);
  168. mysql_query("update users set money='".$money."' where id='".$id."'");
  169. print "".$lang['pl_no']."<br/>$c1-$c2-$c3<br/>";
  170. }
  171.  
  172. }
  173.  
  174. print '<anchor>'.$lang['pl_al'].'
  175. <go href="play.php?id='.$id.'&amp;pass='.$pass.'&amp;r='.$r.'" method="post">
  176. <postfield name="stavka" value="'.$stavka.'"/>
  177. </go></anchor><br/>
  178. &gt;<a href="play.php?id='.$id.'&amp;pass='.$pass.'">'.$lang['area_play'].'</a><br/>';
  179. }
  180. }
  181. /* печатаем форму */
  182. else
  183. {
  184. print ''.$lang['pl_dp'].' <b>'.$dp.'</b><br/>'.$lang['pl_your_money'].''.$money.'</b><br/>['.$lang['pl_stavka'].']<br/>
  185. </small><select name="stavka" title="'.$lang['pl_stavka'].'">
  186. ';
  187. for ($i=0; $i < count($st); $i++)
  188. {
  189. print '<option value="'.$st[$i].'">'.$st[$i].'$$</option>';
  190. }
  191. print '
  192. </select><small><br/>
  193. <anchor>'.$lang['ok'].'
  194. <go href="play.php?id='.$id.'&amp;pass='.$pass.'&amp;r='.$r.'" method="post">
  195. <postfield name="stavka" value="$('.stavka.')"/>
  196. </go></anchor><br/>
  197. &gt;<a href="kasino.php?id='.$id.'&amp;pass='.$pass.'">'.$lang['area_kasino'].'</a><br/>
  198. ';
  199. }
  200.  
  201. print "---<br/>&gt;<a href=\"index.php?id=$id&amp;pass=$pass\">".$lang['in_city']."</a>";
  202. print "<br/>&gt;&gt;<a href=\"./../game.php?id=$id&amp;pass=$pass\">".$lang['menu']."</a>";
  203. print "<br/>---";
  204.  
  205. mysql_close();
  206. include "./../includes/footer.php";
  207. ?>