Файл: chats/city1/kasino.php
Строк: 158
<?php
require( "../inc/conf.inc.php" );
require( "../inc/check.php" );
include "./../includes/header.php";
include "../includes/inc_online.php";
include "../russian/lang_main.php"; //языковой файл
if(!empty($id))
{
$q = mysql_query("select secur,golod,voodoo,nums,guns,cars,id,login,pass,mafcredits,level,police,health from users where id='".$id."';");
}
$data = mysql_fetch_array($q);
$id=$data['id'];
$login=$data['login'];
$mafcredits=$data['mafcredits'];
$level=$data['level'];
$police=$data['police'];
$stage=$data['stage'];
$health=$data['health'];
$cars=$data['cars'];
$guns=$data['guns'];
$nums=$data['nums'];
$golod=$data['golod'];
$secur=$data['secur'];
mysql_query("update users set last='".time()."',city='1' where id='".$id."';");
include "./../includes/inc_secur.php";
include "./../includes/inc_golod.php";
include "./../includes/inc_hospital.php";
include "./../includes/inc_police.php";
include "./../includes/inc_die.php";
include "./../includes/inc_voodoo.php";
include "./../includes/inc_attack.php";
include "./../includes/inc_mes.php";
print "<b>".$lang['game_city1']."</b><br/>";
print "<u>[".$lang['area_kasino']."]</u><br/>";
switch ($mode)
{
case "k0":
global $b;
global $gwin;
global $gover;
$cdiff = 'Normal';
if (isset($new))
{
unset($b);
unset($turn);
mysql_query("delete from kasino where userid='".$id."';");
}
if (!isset($turn)) $turn=1;
if(!empty($h))
{
$h=base64_decode($h);
$b=explode(".",$h);
}
include "./../functions/func_casino.php";
print "</small><table columns="3" align="LL">";
if (isset($mv))
$b[$mv]='x';
checkwin();
checkfull();
if ($gover <> 1 && $gwin == '' && $mv <> '')
{
$what=rand(1,2);
if($what==1)
{
compmove();
if ($cmv == '')
{
comprand();
}
}
else
{
compmove();
if ($cmv == '')
{
if ($b[4] == '')
$cmv=4;
elseif ($b[0] == '')
$cmv=0;
elseif ($b[2] == '')
$cmv=2;
elseif ($b[6] == '')
$cmv=6;
elseif ($b[8] == '')
$cmv=8;
if ($cmv == '')
comprand();
}
}
$b[$cmv] = 'o';
}
checkwin();
checkfull();
for ($i = 0; $i <= 8; $i++)
{
if ($i == 0 || $i == 3 || $i == 6)
print '<tr>';
print '<td>';
if ($b[$i] == 'x')
print 'X';
elseif ($b[$i] == 'o')
print '0';
elseif ($gwin == '')
{
print "<anchor>".$i."
<go href="kasino.php?mv=$i&id=$id&pass=$pass&mode=k0" method="post">
<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>";
}
print '</td>';
if ($i == 2 || $i == 5 || $i == 8)
print '</tr>';
}
print "</table><small>";
if ($gwin == 'X')
{
$k_db=mysql_fetch_array(mysql_query("select combo from kasino where userid='".$id."' and combo='".$h."';"));
if($k_db['combo']!=$h)
{
mysql_query("insert into kasino values(0,'".$id."','".$h."');");
$val=rand(1,100);
$mafcredits=$mafcredits+$val;
mysql_query("update users set mafcredits='".$mafcredits."' where id='".$id."'");
print "<b>".$lang['kasino_you_win']." ".$val."$$</b><br/>";
}
else
{
mysql_query("delete from kasino where userid='".$id."';");
$new=$lang['kasino_new_game'];
$mafcredits=$mafcredits-300;
if($mafcredits<=0) $mafcredits=0;
mysql_query("update users set mafcredits='".$mafcredits."' where id='".$id."'");
print "<b>".$lang['kasino_you_lose']." 300$$</b><br/>";
}
}
elseif ($gwin == 'O')
{
$h='';
$val=rand(1,100);
$mafcredits=$mafcredits-$val;
if($mafcredits<=0) $mafcredits=0;
mysql_query("update users set mafcredits='".$mafcredits."' where id='".$id."'");
print "<b>".$lang['kasino_you_lose']." ".$val."$$</b><br/>";
}
elseif ($gover == 1)
{
print "<b>".$lang['kasino_nichya']."</b><br/>";
}
print "<anchor>".$lang['kasino_new_game']."<go href="".$PHP_SELF."?id=$id&pass=$pass&mode=k0" method="post">
<postfield name="new" value="".$lang['kasino_new_game'].""/>
</go></anchor><br/>";
print "><a href="kasino.php?id=$id&pass=$pass">".$lang['area_kasino']."</a><br/>";
break;
default:
print $lang['kasino_mes']."<br/>";
print "<anchor>".$lang['kasino_k0']."<go href="kasino.php" method="post">
<postfield name="id" value="$id"/>
<postfield name="pass" value="$pass"/>
<postfield name="mode" value="k0"/>
</go></anchor><br/>";
print '<a href="play.php?id='.$id.'&pass='.$pass.'">'.$lang['area_play'].'</a><br/>';
break;
}
print "---<br/>><a href="index.php?id=$id&pass=$pass">".$lang['in_city']."</a>";
print "<br/>>><a href="./../game.php?id=$id&pass=$pass">".$lang['menu']."</a>";
print "<br/>---";
echo "<br/><a href="../enter.php?id={$id}&pass={$pass}&ref={$ref}">Прихожка</a><br/>";
mysql_close();
include "./../includes/footer.php";
?>