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

Размер файла: 6.48Kb
  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.  
  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']."</body>
  30. </html>");
  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']."</body>
  55. </html>");
  56. }
  57.  
  58. mysql_query("update users set last='".time()."',city='1' where id='".$id."';");
  59. if($ban==0)
  60. {
  61.  
  62.  
  63. include "./../includes/inc_secur.php";
  64. include "./../includes/inc_golod.php";
  65. include "./../includes/inc_hospital.php";
  66. include "./../includes/inc_police.php";
  67. include "./../includes/inc_die.php";
  68. include "./../includes/inc_voodoo.php";
  69. include "./../includes/inc_attack.php";
  70. include "./../includes/inc_mes.php";
  71. print "<b>[Зд: $health %][Сыт: $golod %][Зщ: $secur %]</b><br/>";
  72. print "<b>".$lang['game_city1']."</b><br/>";
  73. print "<u>[".$lang['area_kasino']."]</u><br/>";
  74.  
  75. switch ($mode)
  76. {
  77. case "k0":
  78.  
  79.  
  80. global $b;
  81. global $gwin;
  82. global $gover;
  83. $cdiff = 'Normal';
  84.  
  85. if (isset($new))
  86. {
  87. unset($b);
  88. unset($turn);
  89. mysql_query("delete from kasino where userid='".$id."';");
  90. }
  91.  
  92. if (!isset($turn)) $turn=1;
  93.  
  94. if(!empty($h))
  95. {
  96. $h=base64_decode($h);
  97. $b=explode(".",$h);
  98. }
  99.  
  100. include "./../functions/func_casino.php";
  101.  
  102. print "</small><table columns=\"3\" align=\"LL\">";
  103.  
  104. if (isset($mv))
  105. $b[$mv]='x';
  106.  
  107. checkwin();
  108. checkfull();
  109.  
  110.  
  111.  
  112. if ($gover <> 1 && $gwin == '' && $mv <> '')
  113. {
  114. $what=rand(1,2);
  115. if($what==1)
  116. {
  117. compmove();
  118.  
  119. if ($cmv == '')
  120. {
  121. comprand();
  122. }
  123. }
  124. else
  125. {
  126. compmove();
  127. if ($cmv == '')
  128. {
  129. if ($b[4] == '')
  130. $cmv=4;
  131. elseif ($b[0] == '')
  132. $cmv=0;
  133. elseif ($b[2] == '')
  134. $cmv=2;
  135. elseif ($b[6] == '')
  136. $cmv=6;
  137. elseif ($b[8] == '')
  138. $cmv=8;
  139. if ($cmv == '')
  140. comprand();
  141. }
  142. }
  143.  
  144. $b[$cmv] = 'o';
  145. }
  146.  
  147. checkwin();
  148. checkfull();
  149.  
  150.  
  151.  
  152. for ($i = 0; $i <= 8; $i++)
  153. {
  154. if ($i == 0 || $i == 3 || $i == 6)
  155. print '<tr>';
  156. print '<td>';
  157.  
  158. if ($b[$i] == 'x')
  159. print 'X';
  160. elseif ($b[$i] == 'o')
  161. print '0';
  162. elseif ($gwin == '')
  163. {
  164.  
  165. print "<anchor>".$i."
  166. <go href=\"kasino.php?mv=$i&amp;id=$id&amp;pass=$pass&amp;mode=k0\" method=\"post\">
  167. <postfield name=\"h\" value=\"".base64_encode("$b[0].$b[1].$b[2].$b[3].$b[4].$b[5].$b[6].$b[7].$b[8]")."\"/></go></anchor>";
  168. }
  169.  
  170. print '</td>';
  171. if ($i == 2 || $i == 5 || $i == 8)
  172. print '</tr>';
  173. }
  174.  
  175.  
  176. print "</table><small>";
  177.  
  178.  
  179. if ($gwin == 'X')
  180. {
  181. $k_db=mysql_fetch_array(mysql_query("select combo from kasino where userid='".$id."' and combo='".$h."';"));
  182.  
  183. if($k_db['combo']!=$h)
  184. {
  185. mysql_query("insert into kasino values(0,'".$id."','".$h."');");
  186. $val=rand(1,100);
  187. $money=$money+$val;
  188. mysql_query("update users set money='".$money."' where id='".$id."'");
  189. print "<b>".$lang['kasino_you_win']." ".$val."$$</b><br/>";
  190. }
  191. else
  192. {
  193. mysql_query("delete from kasino where userid='".$id."';");
  194. $new=$lang['kasino_new_game'];
  195. $money=$money-300;
  196. if($money<=0) $money=0;
  197. mysql_query("update users set money='".$money."' where id='".$id."'");
  198. print "<b>".$lang['kasino_you_lose']." 300$$</b><br/>";
  199. }
  200.  
  201. }
  202. elseif ($gwin == 'O')
  203. {
  204. $h='';
  205. $val=rand(1,100);
  206. $money=$money-$val;
  207. if($money<=0) $money=0;
  208. mysql_query("update users set money='".$money."' where id='".$id."'");
  209. print "<b>".$lang['kasino_you_lose']." ".$val."$$</b><br/>";
  210. }
  211. elseif ($gover == 1)
  212. {
  213. print "<b>".$lang['kasino_nichya']."</b><br/>";
  214. }
  215.  
  216. print "<anchor>".$lang['kasino_new_game']."<go href=\"".$PHP_SELF."?id=$id&amp;pass=$pass&amp;mode=k0\" method=\"post\">
  217. <postfield name=\"new\" value=\"".$lang['kasino_new_game']."\"/>
  218. </go></anchor><br/>";
  219. print "&gt;<a href=\"kasino.php?id=$id&amp;pass=$pass\">".$lang['area_kasino']."</a><br/>";
  220. break;
  221. default:
  222.  
  223.  
  224. print '<a href="play.php?id='.$id.'&amp;pass='.$pass.'">'.$lang['area_play'].'</a><br/>';
  225.  
  226. break;
  227. }
  228.  
  229. print "---<br/>&gt;<a href=\"index.php?id=$id&amp;pass=$pass\">".$lang['in_city']."</a>";
  230. print "<br/>&gt;&gt;<a href=\"./../game.php?id=$id&amp;pass=$pass\">".$lang['menu']."</a>";
  231. print "<br/>---";
  232.  
  233. mysql_close();
  234. include "./../includes/footer2.php";
  235. }
  236.  
  237. elseif($ban==1)
  238. {
  239. die ($lang['empty_login']."</body>
  240. </html>");
  241.  
  242. }
  243. ?>