<?
#########################################
# Скрипт онлайн игры "Стритрейсинг"_____#
# Автор: -=FеST=-(СиК)__________________#
# ICQ : 345-22-23_______________________#
# Все права принадлежат автору(-=FeST=-)#
#########################################
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/adm_check.php';
include_once '../sys/inc/user.php';
$set['title']='Стритрейсинг';
include_once '../sys/inc/thead.php';
title();
err();
aut();

if(!isset($user)){
echo 'Вы неавторизованы';
include_once '../sys/inc/tfoot.php';
exit;
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `racing` WHERE `id_u`='".$user['id']."'"),0)==0)
mysql_query("INSERT INTO `racing`(`id_u`) VALUES('".$user['id']."')");
  $arr=mysql_fetch_array(mysql_query("SELECT * FROM `racing` WHERE `id_u`='".$user['id']."'"));
   $car=mysql_fetch_array(mysql_query("SELECT * FROM `racing_car` WHERE `id`='".$arr['car']."'"));
echo "
<div class='aut'>
<img src='ico/exp.gif' alt=''/>".$arr['exp']."
<img src='ico/level.gif' alt=''/>".$arr['level']."
<img src='ico/money.gif' alt=''/>".$arr['money']."
<img src='ico/resp.gif' alt=''/>".$arr['resp']."</div>

<center><img src='".$car['screen']."' alt=''/> <br/>".$car['name']."</center>
";
if(($arr['win']>=$arr['nextlevel'] && $arr['level']==0) || ($arr['win']>=$arr['nextlevel'] && $arr['level']==1) ||
($arr['win']>=$arr['nextlevel'] && $arr['level']==2) || 
($arr['win']>=$arr['nextlevel'] && $arr['level']==3) ||
($arr['win']>=$arr['nextlevel'] && $arr['level']==4)){
mysql_query("UPDATE `racing` SET `level`=`level`+1, `nextlevel`=`nextlevel`*3 WHERE `id_u`='".$user['id']."'");
msg('Уровень успешно повышен');
}
else
{
echo "Обновление не доступно<br/>";
}
echo "<div class='aut'><a style='display:block;' href='index.php'><img src='ico/back.png' alt=''/> Назад</a></div>";






include_once '../sys/inc/tfoot.php';
?>