Файл: chats/city1/play.php
Строк: 136
<?php
$r=rand(10000,1000000);
$file='./../data/dp.dat';
if (file_exists($file))
{
$fp = fopen($file, "r");
$dp = fread($fp, 20);
fclose($fp);
}
else
{
$fp = fopen($file, "w");
chmod($file, 0666);
fwrite($file, 1000);
fclose($fp);
}
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_play']."]</u><br/>";
include "./../includes/inc_play.php";
if (isset($stavka))
{
if ($mafcredits < $stavka)
{
print ''.$lang['pl_no_mafcredits'].'<br/>
><a href="play.php?id='.$id.'&pass='.$pass.'">'.$lang['area_play'].'</a><br/>';
}
else
{
/*этим способом мало чего мона выиграть*/
if ($stavka == $st[0])
{
$c1 = charGenerator("0178",1);
$c2 = charGenerator("3567",1);
$c3 = charGenerator("2497",1);
}
/* если наконец дошло, что первый способ почти наебка..) */
elseif ($stavka == $st[1])
{
$c1 = charGenerator("01356789",1);
$c2 = charGenerator("01356789",1);
$c3 = charGenerator("01356789",1);
}
/* увеличим шансы выигрыша, но джек пот этим способом не выиграешь*/
elseif ($stavka == $st[2])
{
$c1 = charGenerator("0125689",1);
$c2 = charGenerator("0125689",1);
$c3 = charGenerator("0125689",1);
}
/* еще больше шансов выиграть */
elseif ($stavka == $st[3])
{
$c1 = charGenerator("02479",1);
$c2 = charGenerator("02479",1);
$c3 = charGenerator("02479",1);
}
/* для тех кто не жмот ) */
elseif ($stavka == $st[4])
{
$c1 = charGenerator("2579",1);
$c2 = charGenerator("2579",1);
$c3 = charGenerator("2579",1);
}
else
{
print $lang['error'];
$err=1;
}
if ($err != 1)
{
if ($c1 == $c2 and $c2 != $c3)
{
$mafcredits = $mafcredits + $two;
mysql_query("update users set mafcredits='".$mafcredits."' where id='".$id."'");
print "".$lang['pl_pr']." $two</b><br/>
<b>$c1-$c2</b>-$c3<br/>";
}
elseif ($c2 == $c3 and $c2 != $c1)
{
$mafcredits = $mafcredits + $two;
mysql_query("update users set mafcredits='".$mafcredits."' where id='".$id."'");
print "".$lang['pl_pr']." $two</b><br/>
$c1-<b>$c2-$c3</b><br/>";
}
elseif ($c1 == $c2 and $c2 == $c3)
{
if ($c1 != 7)
{
$m2 = what_mafcredits($c1);
$mafcredits = $mafcredits + $m2;
mysql_query("update users set mafcredits='".$mafcredits."' where id='".$id."'");
print "".$lang['pl_pr']."".$m2."</b><br/>";
}
else
{
$mafcredits = $mafcredits + $dp;
print "".$lang['pl_cool']."<br/><b>$$".$dp." </b> ".$lang['pl_your']."<br/>";
mysql_query("update users set mafcredits='".$mafcredits."' where id='".$id."'");
$fp = fopen($file, "w");
fwrite($fp, 1000);
fclose($fp);
}
print "<b>$c1-$c2-$c3</b><br/>";
}
else
{
$mafcredits = $mafcredits - $stavka;
$dp = $dp + $stavka;
$fp = fopen($file, "w");
fwrite($fp, $dp);
fclose($fp);
mysql_query("update users set mafcredits='".$mafcredits."' where id='".$id."'");
print "".$lang['pl_no']."<br/>$c1-$c2-$c3<br/>";
}
}
print '<anchor>'.$lang['pl_al'].'
<go href="play.php?id='.$id.'&pass='.$pass.'&r='.$r.'" method="post">
<postfield name="stavka" value="'.$stavka.'"/>
</go></anchor><br/>
><a href="play.php?id='.$id.'&pass='.$pass.'">'.$lang['area_play'].'</a><br/>';
}
}
/* печатаем форму */
else
{
print ''.$lang['pl_dp'].' <b>'.$dp.'</b><br/>'.$lang['pl_your_mafcredits'].''.$mafcredits.'</b><br/>['.$lang['pl_stavka'].']<br/>";
echo "<form method="post" action="play.php?id='.$id.'&pass='.$pass.'&r='.$r.'">";
</small><select name="stavka" title="'.$lang['pl_stavka'].'">
';
for ($i=0; $i < count($st); $i++)
{
print '<option value="'.$st[$i].'">'.$st[$i].'$$</option>';
}
echo "<input value="крутим" type="submit" class="cp">rn</form>";
//print '
//</select><small><br/>
//<anchor>'.$lang['ok'].'
//<go href="play.php?id='.$id.'&pass='.$pass.'&r='.$r.'" method="post">
//<postfield name="stavka" value="$('.stavka.')"/>
//</go></anchor><br/>
//><a href="kasino.php?id='.$id.'&pass='.$pass.'">'.$lang['area_kasino'].'</a><br/>
//';
}
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";
?>