""){echo "error #1";} include ("../../../setup.php"); if ($stav== "" or $stav > 5 or $stav==0){ $stav="2"; } if ($cell > 157){ $cell="0"; } if ($mon== ""){ $mon="0"; } if ($dig== ""){ $dig="15"; } if ($s== ""){ $s="0"; } if ($bet2<>0.2 && $bet2<>1 && $bet2<>5 && $bet2<>10 && $bet2<>50){ $bet2=0.2;} if ($stav== "1"){ $bet2="0.20"; } if ($stav== "2"){ $bet2="1"; } if ($stav== "3"){ $bet2="5"; } if ($stav== "4"){ $bet2="10"; } if ($stav== "5"){ $bet2="50"; } if ($s<>"1"){ $cash=cash($l); $mon="0"; $win="0.00"; echo "
$cash
$stav
$dig
$win
$mon
"; } $cash=cash($l); if ($s=="1" && $cash >= $bet2 && $cell<>""){ $mon="1"; $win="0.00"; $loh=0; // Проверяем можем ли заплатить если нет то облом $resultb=mysql_query("select * from game_bank where name='ttuz'"); $rowb=mysql_fetch_array($resultb); $bank = $rowb[1]; $proc = $rowb[2]; $caswin = $bank/100*$proc; if ($bet2*37>=$caswin) { $loh=1; } //////////////// $dig = rnd1(); $aa= rnd2($cell,$dig); if($aa == true && $loh==1){$dig = rnd1(); $aa= rnd2($cell,$dig); } if($aa == true && $loh==1){$dig = rnd1(); $aa= rnd2($cell,$dig); } if($aa == true && $loh==1){$dig = rnd1(); $aa= rnd2($cell,$dig); } if($aa == true && $loh==1){$dig = rnd1(); $aa= rnd2($cell,$dig); } if($aa == true && $loh==1){$dig = rnd1(); $aa= rnd2($cell,$dig); } if($aa == true && $loh==1){$dig = rnd1(); $aa= rnd2($cell,$dig); } if($aa == true) { if ($cell==157){ $win=bcmul($bet2, 2, 2); } if ($cell==156){ $win=bcmul($bet2, 2, 2); } if ($cell==155){ $win=bcmul($bet2, 2, 2); } if ($cell==154){ $win=bcmul($bet2, 2, 2); } if ($cell==153){ $win=bcmul($bet2, 2, 2); } if ($cell==152){ $win=bcmul($bet2, 2, 2); } if ($cell==151){ $win=bcmul($bet2, 3, 2); } if ($cell==150){ $win=bcmul($bet2, 3, 2); } if ($cell==149){ $win=bcmul($bet2, 3, 2); } if ($cell==148){ $win=bcmul($bet2, 12, 2); } if ($cell==147){ $win=bcmul($bet2, 6, 2); } if ($cell==146){ $win=bcmul($bet2, 12, 2); } if ($cell==145){ $win=bcmul($bet2, 6, 2); } if ($cell==144){ $win=bcmul($bet2, 12, 2); } if ($cell==143){ $win=bcmul($bet2, 6, 2); } if ($cell==142){ $win=bcmul($bet2, 12, 2); } if ($cell==141){ $win=bcmul($bet2, 6, 2); } if ($cell==140){ $win=bcmul($bet2, 12, 2); } if ($cell==139){ $win=bcmul($bet2, 6, 2); } if ($cell==138){ $win=bcmul($bet2, 12, 2); } if ($cell==137){ $win=bcmul($bet2, 6, 2); } if ($cell==136){ $win=bcmul($bet2, 12, 2); } if ($cell==135){ $win=bcmul($bet2, 6, 2); } if ($cell==134){ $win=bcmul($bet2, 12, 2); } if ($cell==133){ $win=bcmul($bet2, 6, 2); } if ($cell==132){ $win=bcmul($bet2, 12, 2); } if ($cell==131){ $win=bcmul($bet2, 6, 2); } if ($cell==130){ $win=bcmul($bet2, 12, 2); } if ($cell==129){ $win=bcmul($bet2, 6, 2); } if ($cell==128){ $win=bcmul($bet2, 12, 2); } if ($cell==127){ $win=bcmul($bet2, 6, 2); } if ($cell==126){ $win=bcmul($bet2, 12, 2); } if ($cell==125){ $win=bcmul($bet2, 9, 2); } if ($cell==124){ $win=bcmul($bet2, 3, 2); } if ($cell==123){ $win=bcmul($bet2, 36, 2); } if ($cell==122){ $win=bcmul($bet2, 18, 2); } if ($cell==121){ $win=bcmul($bet2, 36, 2); } if ($cell==120){ $win=bcmul($bet2, 18, 2); } if ($cell==119){ $win=bcmul($bet2, 36, 2); } if ($cell==118){ $win=bcmul($bet2, 18, 2); } if ($cell==117){ $win=bcmul($bet2, 36, 2); } if ($cell==116){ $win=bcmul($bet2, 18, 2); } if ($cell==115){ $win=bcmul($bet2, 36, 2); } if ($cell==114){ $win=bcmul($bet2, 18, 2); } if ($cell==113){ $win=bcmul($bet2, 36, 2); } if ($cell==112){ $win=bcmul($bet2, 18, 2); } if ($cell==111){ $win=bcmul($bet2, 36, 2); } if ($cell==110){ $win=bcmul($bet2, 18, 2); } if ($cell==109){ $win=bcmul($bet2, 36, 2); } if ($cell==108){ $win=bcmul($bet2, 18, 2); } if ($cell==107){ $win=bcmul($bet2, 36, 2); } if ($cell==106){ $win=bcmul($bet2, 18, 2); } if ($cell==105){ $win=bcmul($bet2, 36, 2); } if ($cell==104){ $win=bcmul($bet2, 18, 2); } if ($cell==103){ $win=bcmul($bet2, 36, 2); } if ($cell==102){ $win=bcmul($bet2, 18, 2); } if ($cell==101){ $win=bcmul($bet2, 36, 2); } if ($cell==100){ $win=bcmul($bet2, 18, 2); } if ($cell==99){ $win=bcmul($bet2, 18, 2); } if ($cell==98){ $win=bcmul($bet2, 9, 2); } if ($cell==97){ $win=bcmul($bet2, 18, 2); } if ($cell==96){ $win=bcmul($bet2, 9, 2); } if ($cell==95){ $win=bcmul($bet2, 18, 2); } if ($cell==94){ $win=bcmul($bet2, 9, 2); } if ($cell==93){ $win=bcmul($bet2, 18, 2); } if ($cell==92){ $win=bcmul($bet2, 9, 2); } if ($cell==91){ $win=bcmul($bet2, 18, 2); } if ($cell==90){ $win=bcmul($bet2, 9, 2); } if ($cell==89){ $win=bcmul($bet2, 18, 2); } if ($cell==88){ $win=bcmul($bet2, 9, 2); } if ($cell==87){ $win=bcmul($bet2, 18, 2); } if ($cell==86){ $win=bcmul($bet2, 9, 2); } if ($cell==85){ $win=bcmul($bet2, 18, 2); } if ($cell==84){ $win=bcmul($bet2, 9, 2); } if ($cell==83){ $win=bcmul($bet2, 18, 2); } if ($cell==82){ $win=bcmul($bet2, 9, 2); } if ($cell==81){ $win=bcmul($bet2, 18, 2); } if ($cell==80){ $win=bcmul($bet2, 9, 2); } if ($cell==79){ $win=bcmul($bet2, 18, 2); } if ($cell==78){ $win=bcmul($bet2, 9, 2); } if ($cell==77){ $win=bcmul($bet2, 18, 2); } if ($cell==76){ $win=bcmul($bet2, 12, 2); } if ($cell==75){ $win=bcmul($bet2, 3, 2); } if ($cell==74){ $win=bcmul($bet2, 36, 2); } if ($cell==73){ $win=bcmul($bet2, 18, 2); } if ($cell==72){ $win=bcmul($bet2, 36, 2); } if ($cell==71){ $win=bcmul($bet2, 18, 2); } if ($cell==70){ $win=bcmul($bet2, 36, 2); } if ($cell==69){ $win=bcmul($bet2, 18, 2); } if ($cell==68){ $win=bcmul($bet2, 36, 2); } if ($cell==67){ $win=bcmul($bet2, 18, 2); } if ($cell==66){ $win=bcmul($bet2, 36, 2); } if ($cell==65){ $win=bcmul($bet2, 18, 2); } if ($cell==64){ $win=bcmul($bet2, 36, 2); } if ($cell==63){ $win=bcmul($bet2, 18, 2); } if ($cell==62){ $win=bcmul($bet2, 36, 2); } if ($cell==61){ $win=bcmul($bet2, 18, 2); } if ($cell==60){ $win=bcmul($bet2, 36, 2); } if ($cell==59){ $win=bcmul($bet2, 18, 2); } if ($cell==58){ $win=bcmul($bet2, 36, 2); } if ($cell==57){ $win=bcmul($bet2, 18, 2); } if ($cell==56){ $win=bcmul($bet2, 36, 2); } if ($cell==55){ $win=bcmul($bet2, 18, 2); } if ($cell==54){ $win=bcmul($bet2, 36, 2); } if ($cell==53){ $win=bcmul($bet2, 18, 2); } if ($cell==52){ $win=bcmul($bet2, 36, 2); } if ($cell==51){ $win=bcmul($bet2, 18, 2); } if ($cell==50){ $win=bcmul($bet2, 18, 2); } if ($cell==49){ $win=bcmul($bet2, 9, 2); } if ($cell==48){ $win=bcmul($bet2, 18, 2); } if ($cell==47){ $win=bcmul($bet2, 9, 2); } if ($cell==46){ $win=bcmul($bet2, 18, 2); } if ($cell==45){ $win=bcmul($bet2, 9, 2); } if ($cell==44){ $win=bcmul($bet2, 18, 2); } if ($cell==43){ $win=bcmul($bet2, 9, 2); } if ($cell==42){ $win=bcmul($bet2, 18, 2); } if ($cell==41){ $win=bcmul($bet2, 9, 2); } if ($cell==40){ $win=bcmul($bet2, 18, 2); } if ($cell==39){ $win=bcmul($bet2, 9, 2); } if ($cell==38){ $win=bcmul($bet2, 18, 2); } if ($cell==37){ $win=bcmul($bet2, 9, 2); } if ($cell==36){ $win=bcmul($bet2, 18, 2); } if ($cell==35){ $win=bcmul($bet2, 9, 2); } if ($cell==34){ $win=bcmul($bet2, 18, 2); } if ($cell==33){ $win=bcmul($bet2, 9, 2); } if ($cell==32){ $win=bcmul($bet2, 18, 2); } if ($cell==31){ $win=bcmul($bet2, 9, 2); } if ($cell==30){ $win=bcmul($bet2, 18, 2); } if ($cell==29){ $win=bcmul($bet2, 9, 2); } if ($cell==28){ $win=bcmul($bet2, 18, 2); } if ($cell==27){ $win=bcmul($bet2, 12, 2); } if ($cell==26){ $win=bcmul($bet2, 3, 2); } if ($cell==25){ $win=bcmul($bet2, 36, 2); } if ($cell==24){ $win=bcmul($bet2, 18, 2); } if ($cell==23){ $win=bcmul($bet2, 36, 2); } if ($cell==22){ $win=bcmul($bet2, 18, 2); } if ($cell==21){ $win=bcmul($bet2, 36, 2); } if ($cell==20){ $win=bcmul($bet2, 18, 2); } if ($cell==19){ $win=bcmul($bet2, 36, 2); } if ($cell==18){ $win=bcmul($bet2, 18, 2); } if ($cell==17){ $win=bcmul($bet2, 36, 2); } if ($cell==16){ $win=bcmul($bet2, 18, 2); } if ($cell==15){ $win=bcmul($bet2, 36, 2); } if ($cell==14){ $win=bcmul($bet2, 18, 2); } if ($cell==13){ $win=bcmul($bet2, 36, 2); } if ($cell==12){ $win=bcmul($bet2, 18, 2); } if ($cell==11){ $win=bcmul($bet2, 36, 2); } if ($cell==10){ $win=bcmul($bet2, 18, 2); } if ($cell==9){ $win=bcmul($bet2, 36, 2); } if ($cell==8){ $win=bcmul($bet2, 18, 2); } if ($cell==7){ $win=bcmul($bet2, 36, 2); } if ($cell==6){ $win=bcmul($bet2, 18, 2); } if ($cell==5){ $win=bcmul($bet2, 36, 2); } if ($cell==4){ $win=bcmul($bet2, 18, 2); } if ($cell==3){ $win=bcmul($bet2, 36, 2); } if ($cell==2){ $win=bcmul($bet2, 18, 2); } if ($cell==1){ $win=bcmul($bet2, 36, 2); } // Здесь платим выигрыш и всякую статистику mysql_query("update users set cash=cash-'$bet2' where login='$l'"); mysql_query("update users set cash=cash+'$win' where login='$l'"); mysql_query("update game_bank set bank=bank-'$win' where name='ttuz'"); $cash=cash($l); // Собираем статистику $date=date("d.m.y"); $time=date("H:i:s"); $sqls="INSERT INTO stat_game VALUES('NULL','$date','$time','$l','$cash','$bet2','$win','Рулетка')"; mysql_query($sqls); echo "
$cash
$stav
$dig
$win
$mon
"; } else { $mon="1"; $win="0.00"; // здесь проигрыш и снимаем ставку mysql_query("update users set cash=cash-'$bet2' where login='$l'"); mysql_query("update game_bank set bank=bank+'$bet2' where name='ttuz'"); $cash=cash($l); // Собираем статистику $date=date("d.m.y"); $time=date("H:i:s"); $sqls="INSERT INTO stat_game VALUES('NULL','$date','$time','$l','$cash','$bet2','$win','Рулетка')"; mysql_query($sqls); echo "
$cash
$stav
$dig
$win
$mon
"; } } else { $cash=cash($l); echo "
$cash
$stav
$dig
$win
3
"; } function rnd1() { srand ((double) microtime()*time()); $dig=rand(0,36); return $dig; } function rnd2($cell,$dig) { $masvet0=array(1,2,27,51,76,100,125); $masvet1=array(76,77,78,100,101,102,124,125,126,127,149,152,154,156); $masvet2=array(27,28,29,51,52,53,75,76,77,78,125,126,127,149,152,153,155); $masvet3=array(2,3,4,26,27,28,29,125,126,127,149,152,154,156); $masvet4=array(78,79,80,102,103,104,124,127,128,129,149,152,153,155); $masvet5=array(29,30,31,53,54,55,75,78,79,80,127,128,129,149,152,154,156); $masvet6=array(4,5,6,26,29,30,31,127,128,129,149,152,153,155); $masvet7=array(80,81,82,104,105,106,124,129,130,131,149,152,154,156); $masvet8=array(31,32,33,55,56,57,75,80,81,82,129,130,131,149,152,153,155); $masvet9=array(7,8,26,31,32,33,129,130,131,149,152,154,156); $masvet10=array(82,83,84,106,107,108,124,131,132,133,149,152,153,155); $masvet11=array(33,34,35,57,58,59,75,82,83,84,131,132,133,149,152,155,156); $masvet12=array(8,9,10,26,33,34,35,131,132,133,149,152,153,154); $masvet13=array(84,85,86,108,109,110,124,133,134,135,150,152,155,156); $masvet14=array(35,36,37,59,60,61,75,84,85,86,133,134,135,150,152,153,154); $masvet15=array(10,11,12,26,35,36,37,133,134,135,150,152,155,156); $masvet16=array(86,87,88,110,111,112,124,135,136,137,150,152,153,154); $masvet17=array(37,38,39,61,62,63,75,86,87,88,135,136,137,150,152,155,156); $masvet18=array(12,13,14,26,37,38,39,135,136,137,150,152,153,154); $masvet19=array(88,89,90,112,113,114,124,137,138,139,150,154,156,157); $masvet20=array(39,40,41,63,64,65,75,88,89,90,137,138,139,150,153,155,157); $masvet21=array(14,15,16,26,39,40,41,137,138,139,150,154,156,157); $masvet22=array(90,91,92,114,115,116,124,139,140,141,150,153,155,157); $masvet23=array(41,42,43,65,66,67,75,90,91,92,139,140,141,150,154,156,157); $masvet24=array(16,17,18,26,41,42,43,139,140,141,150,153,155,157); $masvet25=array(92,93,94,116,117,118,124,141,142,143,151,154,156,157); $masvet26=array(43,44,45,67,68,69,75,92,93,94,141,142,143,151,153,155,157); $masvet27=array(18,19,20,26,43,44,45,141,142,143,151,154,156,157); $masvet28=array(94,95,96,118,119,120,124,143,144,145,151,153,155,157); $masvet29=array(45,46,47,69,70,71,75,94,95,96,143,144,145,151,155,156,157); $masvet30=array(20,21,22,26,45,46,47,143,144,145,151,153,154,157); $masvet31=array(96,97,98,120,121,122,124,145,146,147,151,155,156,157); $masvet32=array(47,48,49,71,72,73,75,96,97,98,145,146,147,151,153,154,157); $masvet33=array(22,23,24,26,47,48,49,145,146,147,151,155,156,157); $masvet34=array(98,99,122,123,124,147,148,151,153,154,157); $masvet35=array(49,50,73,74,75,98,99,147,148,151,155,156,157); $masvet36=array(24,25,26,49,50,147,148,151,153,154,157); $mas=${"masvet".$dig}; $aa=in_array($cell, $mas); return $aa; } function cash($l) { $table_cash=mysql_query("select * from users where login='$l'"); $row1=mysql_fetch_array($table_cash); $cash=$row1["cash"]; return $cash; } ?>