Вход Регистрация
Файл: tankon.mobi/tanks/boyuser.php
Строк: 743
<?
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/user.php';

include_once 
'../sys/inc/thead.php';
title();err();aut();
include_once 
'function.php';





if(
mysql_result(mysql_query("SELECT COUNT(*) FROM `tanks_boy` WHERE `uid` = '".$tanks_code['id_u']."' AND `vkl` < '3'"), 0)==0){    
if(
$tanks_code['boy_pokaz']!=0){        
if(
$tanks_code['boy_play']=='Поражение'){
err_game('<img src="tanks/images/icons/defeat.png"> <span>Ваш танк уничтожен, поражение!</span> <img src="tanks/images/icons/defeat.png"><span class="nwr">
<br><img class="ico vm" src="tanks/images/icons/exp.png" alt="опыт" title="опыт">'
.$tanks_code['boy_experience'].'</span><span class="nwr">
 <img class="ico vm" src="tanks/images/icons/silver.png" alt="Серебро" title="Серебро">-'
.$tanks_code['boy_serebro'].'</span></span</span>
 <img class="ico vm" src="tanks/images/exps.png" >'
.$tanks_code['boy_seropit'].'</span></span</span>

'
);   
}
elseif(
$tanks_code['boy_play']=='Победа'){
err_game('<img src="tanks/images/icons/victory.png"> <span>Вы одержали победу!</span> <img src="tanks/images/icons/victory.png"><span class="nwr">
<br><img class="ico vm" src="tanks/images/icons/exp.png" alt="опыт" title="опыт"> '
.$tanks_code['boy_experience'].'</span><span class="nwr">
 <img class="ico vm" src="tanks/images/icons/silver.png" alt="Серебро" title="Серебро">+'
.$tanks_code['boy_serebro'].'</span></span</span>
 <img class="ico vm" src="tanks/images/exps.png" >'
.$tanks_code['boy_seropit'].'</span></span</span>
'
); 

    
}
elseif(
$tanks_code['boy_play']=='Ничья'){
err_game('<img src="tanks/images/icons/victory.png"> <span>Танки не уничтожены, ничья!</span> <img src="tanks/images/icons/defeat.png"><span class="nwr">
<br><img class="ico vm" src="tanks/images/icons/exp.png" alt="опыт" title="опыт">'
.$tanks_code['boy_experience'].'</span><span class="nwr">
 <img class="ico vm" src="tanks/images/icons/silver.png" alt="Серебро" title="Серебро">+'
.$tanks_code['boy_serebro'].'</span></span</span>
 <img class="ico vm" src="tanks/images/exps.png" >'
.$tanks_code['boy_seropit'].'</span></span</span>
'
);   


elseif(
$tanks_code['boy_play']=='Техпоражение'){
err_game('<img src="tanks/images/icons/defeat.png"> <span>Техническое поражение!</span> <img src="tanks/images/icons/defeat.png">');
   

    

elseif(
$tanks_code['boy_play']=='Техпобеда'){
err_game('<img src="tanks/images/icons/defeat.png"> <span>Техническая победа!</span> <img src="tanks/images/icons/defeat.png">');

mysql_querll("UPDATE `tanks` SET `boy_pokaz`='0' WHERE `id_u`='".$user['id']."'");

}

if (
$tanks_code['leveltank']==1){$carses=mysql_query("SELECT * FROM `tanks` WHERE `leveltank` = '1' AND `id`!='".$user['id']."' AND `tank` > 0 AND `bans`='0' ORDER BY RAND() LIMIT 3");}
if (
$tanks_code['leveltank']==2){$carses=mysql_query("SELECT * FROM `tanks` WHERE `leveltank` = '2' AND `id`!='".$user['id']."' AND `tank` > 0  AND `bans`='0' ORDER BY RAND() LIMIT 3");}
if (
$tanks_code['leveltank']==3){$carses=mysql_query("SELECT * FROM `tanks` WHERE `leveltank` = '3' AND `id`!='".$user['id']."' AND `tank` > 0  AND `bans`='0' ORDER BY RAND() LIMIT 3");}
if (
$tanks_code['leveltank']==4){$carses=mysql_query("SELECT * FROM `tanks` WHERE `leveltank` = '4' AND `id`!='".$user['id']."' AND `tank` > 0  AND `bans`='0' ORDER BY RAND() LIMIT 3");}
if (
$tanks_code['leveltank']==5){$carses=mysql_query("SELECT * FROM `tanks` WHERE `leveltank` = '5' AND `id`!='".$user['id']."' AND `tank` > 0  AND `bans`='0' ORDER BY RAND() LIMIT 3");}
if (
$tanks_code['leveltank']==6){$carses=mysql_query("SELECT * FROM `tanks` WHERE `leveltank` = '6' AND `id`!='".$user['id']."' AND `tank` > 0  AND `bans`='0' ORDER BY RAND() LIMIT 3");}
if (
$tanks_code['leveltank']==7){$carses=mysql_query("SELECT * FROM `tanks` WHERE `leveltank` = '7' AND `id`!='".$user['id']."' AND `tank` > 0  AND `bans`='0' ORDER BY RAND() LIMIT 3");}
if (
$tanks_code['leveltank']==8){$carses=mysql_query("SELECT * FROM `tanks` WHERE `leveltank` = '8' AND `id`!='".$user['id']."' AND `tank` > 0  AND `bans`='0' ORDER BY RAND() LIMIT 3");}
if (
$tanks_code['leveltank']==9){$carses=mysql_query("SELECT * FROM `tanks` WHERE `leveltank` = '9' AND `id`!='".$user['id']."' AND `tank` > 0  AND `bans`='0' ORDER BY RAND() LIMIT 3");}
if (
$tanks_code['leveltank']==10){$carses=mysql_query("SELECT * FROM `tanks` WHERE `leveltank` = '10' AND `id`!='".$user['id']."' AND `tank` > 0  AND `bans`='0' ORDER BY RAND() LIMIT 3");}


if(isset(
$_GET['ok'])){
if(
$tanks_code['fuel']>=15){
$tanks_boy mysql_fetch_array(mysql_query("SELECT * FROM `tanks` WHERE `id`='".intval($_GET['ok'])."'"));
if (
$tanks_code['id']!=$tanks_boy['id']){
if (
$tanks_code['leveltank']>=$tanks_boy['leveltank']){    
mysql_query("DELETE FROM `tanks_boy` WHERE `uid` = '".$tanks_code['id']."'");

mysql_query("INSERT INTO `tanks_boy` (`uid`,`id_user`,`vkl`,`id_usert`,`uidt`) VALUES ('".$tanks_code['id']."','".intval($_GET['ok'])."','0','".$tanks_boy['tank']."','".$tanks_code['tank']."')");
header("Location: /boyuser");   
}else {
err_game('Ваш уровень мал');}
}else {
err_game('Вы не можете играть с самим собой');}
}else{
err_game('Не хватает топлива');}
}

while(
$carsmysql_fetch_array($carses)) {

$rasdmysql_fetch_array(mysql_query("SELECT * FROM `tanks` WHERE `id`='".$cars['id']."'"));
$rdnmysql_fetch_array(mysql_query("SELECT * FROM `tanks_magazin` WHERE `id`='".$rasd['tank']."'"));
$rkdmysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id`='".$rasd['id']."'"));

$mscus mysql_fetch_array(mysql_query("SELECT * FROM `collective_user` WHERE `id_user` = '$cars[id]'"));
$mscs mysql_fetch_array(mysql_query("SELECT * FROM `collective` WHERE `id` = '$mscus[id_collective]'"));

$atakas=atack($cars['id']);
$brons=bron($cars['id']);
$tochs=toch($cars['id']);
$prochs=proch($cars['id']);


echo 
'<div class="trnt-block" style="margin-bottom:15px">
  <div class="wrap1">
    <div class="wrap2">
      <div class="wrap3">
        <div class="wrap4">
          <div class="wrap5">
            <div class="wrap6">
              <div class="wrap7">
                <div class="wrap8">
                  <div class="wrap-content">
                    <table><tbody><tr>                    <div class="small bold green2 cntr sh_b pb5 pt5">'
.$rkd['nick'].'</div>

<td><img class="tank-img" alt="tank" width="175" height="175" src="/web/tanks/'
.$rdn['screen'].'"></td>
<td style = " width :  125px ; "><div class="white small sh_b bold mb10"><img src="/images/levels.png" width="14" height="14"> '
.$cars['leveltank'].' уровень<br><img src="/tanks/images/atack.png" width="14" height="14"> '.$atakas.' атака<br><img src="/tanks/images/bron.png" width="14" height="14"> '.$brons.' броня<br><img src="/tanks/images/toch.png" width="14" height="14"> '.$tochs.' точность<br><img src="/tanks/images/proch.png" width="14" height="14"> '.$prochs.' прочность<br>'.$cars['type'].'</div></td></tr></tbody></table>
   
                    <div class="bot">
                      <a class="simple-but border" href="?ok='
.$cars['id'].'">
                        <span>
                          <span>Атаковать</span>
                        </span>
                      </a>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>'
;


}


    
    
    
    
}else{

if(
$tanks_code['boy_pokaz']!=0){        
if(
$tanks_code['boy_play']=='Поражение'){
err_game('<img src="tanks/images/icons/defeat.png"> <span>Ваш танк уничтожен, поражение!</span> <img src="tanks/images/icons/defeat.png"><span class="nwr">
<br><img class="ico vm" src="tanks/images/icons/exp.png" alt="опыт" title="опыт">'
.$tanks_code['boy_experience'].'</span><span class="nwr">
 <img class="ico vm" src="tanks/images/icons/silver.png" alt="Серебро" title="Серебро">-'
.$tanks_code['boy_serebro'].'</span></span</span>
 <img class="ico vm" src="tanks/images/exps.png" alt="Серебро" title="Серебро">'
.$tanks_code['boy_seropit'].'</span></span</span>
'
);
}
elseif(
$tanks_code['boy_play']=='Победа'){
err_game('<img src="tanks/images/icons/victory.png"> <span>Вы одержали победу!</span> <img src="tanks/images/icons/victory.png"><span class="nwr">
<br><img class="ico vm" src="tanks/images/icons/exp.png" alt="опыт" title="опыт">'
.$tanks_code['boy_experience'].'</span><span class="nwr">
 <img class="ico vm" src="tanks/images/icons/silver.png" alt="Серебро" title="Серебро">+'
.$tanks_code['boy_serebro'].'</span></span</span>
 <img class="ico vm" src="tanks/images/exps.png" alt="Серебро" title="Серебро">'
.$tanks_code['boy_seropit'].'</span></span</span>
'
);

    
}
elseif(
$tanks_code['boy_play']=='Ничья'){
err_game('<img src="tanks/images/icons/victory.png"> <span>Танки не уничтожены, ничья!</span> <img src="tanks/images/icons/defeat.png"><span class="nwr">
<br><img class="ico vm" src="tanks/images/icons/exp.png" alt="опыт" title="опыт">'
.$tanks_code['boy_experience'].'</span><span class="nwr">
 <img class="ico vm" src="tanks/images/icons/silver.png" alt="Серебро" title="Серебро">+'
.$tanks_code['boy_serebro'].'</span></span</span>
 <img class="ico vm" src="tanks/images/exps.png" alt="Серебро" title="Серебро">'
.$tanks_code['boy_seropit'].'</span></span</span>
'
);



mysql_querll("UPDATE `tanks` SET `boy_pokaz`='0' WHERE `id_u`='".$user['id']."'");
}


$tanks_boy_table mysql_fetch_array(mysql_query("SELECT * FROM `tanks_boy` WHERE `uid` = '".$tanks_code['id']."' AND `vkl` < '3'"));
$tanks_boy mysql_fetch_array(mysql_query("SELECT * FROM `tanks` WHERE `id`='".$tanks_boy_table['id_user']."'"));

if (
$tanks_boy_table['uidt']!=$tanks_code['tank']){
mysql_query("UPDATE `tanks` SET `lose`=`lose`+'1',`boy_play`='Техпоражение',`battle`=`battle`+'1',`boy_pokaz`='1'  WHERE `id_u`='".$tanks_code['id']."'");
mysql_query("UPDATE `tanks_boy` SET `vkl`='3'  WHERE `id`='".$tanks_boy_table['id']."'");

header("Location: /boyuser");
}
elseif (
$tanks_boy_table['id_usert']!=$tanks_boy['tank']){
mysql_query("UPDATE `tanks` SET `win`=`win`+'1',`boy_play`='Техпобеда',`battle`=`battle`+'1',`boy_pokaz`='1'  WHERE `id_u`='".$tanks_code['id']."'");
mysql_query("UPDATE `tanks_boy` SET `vkl`='3'  WHERE `id`='".$tanks_boy_table['id']."'");
header("Location: /boyuser");
}
elseif(
$tanks_boy_table['id_usert']==$tanks_boy['tank'] && $tanks_boy_table['uidt']==$tanks_code['tank']){


if(
$tanks_boy_table['vkl']==1){
if(
$tanks_code['boy_play']=='Поражение'){$boyka="Взять реванш!";}
elseif(
$tanks_code['boy_play']=='Победа'){$boyka="В том же духе!";}
elseif(
$tanks_code['boy_play']=='Ничья'){$boyka="Рискнуть в бой!";} 
}
elseif(
$tanks_boy_table['vkl']==2){
if(
$tanks_code['boy_play']=='Поражение'){$boyka="Из последних сил!";}
elseif(
$tanks_code['boy_play']=='Победа'){$boyka="Добить противника!";}
elseif(
$tanks_code['boy_play']=='Ничья'){$boyka="Стрелять!";}     
}
else{
$boyka="Стрелять!";}


if(isset(
$_GET['boy'])){
if(
$tanks_code['fuel']>=15){

$mscu mysql_fetch_array(mysql_query("SELECT * FROM `collective_user` WHERE `id_user` = '$cars[id]'"));
$msc mysql_fetch_array(mysql_query("SELECT * FROM `collective` WHERE `id` = '$mscu[id_collective]'"));

$atakas=atack($tanks_boy['id']);
$brons=bron($tanks_boy['id']);
$tochs=toch($tanks_boy['id']);
$prochs=proch($tanks_boy['id']);


$ataka=atack($tanks_code['id']);
$bron=bron($tanks_code['id']);
$toch=toch($tanks_code['id']);
$proch=proch($tanks_code['id']);



/*Все*/     
if ($ataka>=$atakas && $bron>=$brons && $toch>=$tochs && $proch>=$prochs){$rand=rand(1,41);}
/*С одним нет*/
elseif ($ataka>$atakas && $bron>$brons && $toch<$tochs && $proch>$prochs){$rand=rand(10,50);}
elseif (
$ataka>$atakas && $bron>$brons && $toch>$tochs && $proch<$prochs){$rand=rand(10,50);}
elseif (
$ataka>$atakas && $bron<$brons && $toch>$tochs && $proch>$prochs){$rand=rand(10,50);}
elseif (
$ataka<$atakas && $bron>$brons && $toch>$tochs && $proch>$prochs){$rand=rand(10,50);}
/*С двумя нет*/
elseif ($ataka>$atakas && $bron>$brons && $toch<$tochs && $proch<$prochs){$rand=rand(20,75);}
elseif (
$ataka>$atakas && $bron<$brons && $toch>$tochs && $proch<$prochs){$rand=rand(20,75);}
elseif (
$ataka<$atakas && $bron>$brons && $toch>$tochs && $proch<$prochs){$rand=rand(20,75);}
elseif (
$ataka<$atakas && $bron<$brons && $toch>$tochs && $proch>$prochs){$rand=rand(20,75);}
/*С всемя нет*/
elseif ($ataka<$atakas && $bron<$brons && $toch<$tochs && $proch<$prochs){$rand=rand(50,100);}
/*С тремя нет*/
elseif ($ataka<$atakas && $bron<$brons && $toch<$tochs && $proch>$prochs){$rand=rand(35,80);}
elseif (
$ataka<$atakas && $bron<$brons && $toch>$tochs && $proch<$prochs){$rand=rand(35,80);}
elseif (
$ataka<$atakas && $bron>$brons && $toch<$tochs && $proch<$prochs){$rand=rand(35,80);}
elseif (
$ataka>$atakas && $bron<$brons && $toch<$tochs && $proch<$prochs){$rand=rand(35,80);}





/*Победа*/
if($rand<40){
mysql_query("UPDATE `tanks` SET `lose`=`lose`+1 WHERE `id_u`='".$tanks_boy['id']."'");
mysql_query("UPDATE `tanks` SET `battle`=`battle`+1 WHERE `id_u`='".$tanks_boy['id']."'");
mysql_query("UPDATE `tanks` SET `boy`=`boy`+1 WHERE `id_u`='".$tanks_code['id']."'");

mysql_query("UPDATE `zadan` SET `nachalo`=`nachalo`+1 WHERE `id_user`='".$user['id']."' AND `type`='1'");

mysql_query("UPDATE `zadan` SET `nachalo`=`nachalo`+1 WHERE `id_user`='".$user['id']."' AND `type`='2'");

mysql_query("UPDATE `tanks_boy` SET `vkl`=`vkl`+'1'  WHERE `id`='".$tanks_boy_table['id']."'");

mysql_query("UPDATE `tanks` SET `serrating`='".($tanks_code['serrating']+100)."' WHERE `id_u`='".$user['id']."'");

mysql_query("UPDATE `tanks` SET `battle`=`battle`+1 WHERE `id_u`='".$user['id']."'");

mysql_query("UPDATE `tanks` SET `win`=`win`+1 WHERE `id_u`='".$user['id']."'");

/*Медали*/

if ($tanks_code['leveltank']>=&& $tanks_code['leveltank']<=2){$serebro=1000$opt=500;}
elseif (
$tanks_code['leveltank']>=&& $tanks_code['leveltank']<=4){$serebro=1250$opt=750;}
elseif (
$tanks_code['leveltank']>=&& $tanks_code['leveltank']<=7){$serebro=1500$opt=1000;}
elseif (
$tanks_code['leveltank']==){$serebro=2500$opt=2500;}
elseif (
$tanks_code['leveltank']>=&& $tanks_code['leveltank']<=10){$serebro=5000$opt=5000;}
if (
$tanks_code['prem']>0){
$serebros=$serebro*1.5;
$opts=$opt*1.5;
mysql_querll("UPDATE `tanks` SET `race_kol`=`race_kol`+1,`battle`=`battle`+1,`serebro`=`serebro`+$serebros,`rating` = `rating`+$opts,`fuel` = `fuel`-15 WHERE `id_u`='".$user['id']."'");
mysql_querll("UPDATE `tanks` SET `boy_serebro`='".$serebros."',`boy_experience`='".$opts."',`boy_play`='Победа',`boy_seropit`='100',`boy_pokaz`='1' WHERE `id_u`='".$user['id']."'");
mysql_query("UPDATE `zadan` SET `nachalo`=`nachalo`+'".$opts."' WHERE `id_user`='".$user['id']."' AND `type`='6'");

if (
$tanks_code['clan']>0){
mysql_query("UPDATE `collective` SET `rating` = `rating`+'".$opts."' WHERE `id`='".$mc['id']."'");mysql_query("UPDATE `collective_user` SET `rating` = `rating`+'".$opts."' WHERE `id_user`='".$tanks_code['id']."'");
}
}
else{
mysql_querll("UPDATE `tanks` SET `race_kol`=`race_kol`+1,`battle`=`battle`+1,`serebro`=`serebro`+$serebro,`rating` = `rating`+$opt,`fuel` = `fuel`-15 WHERE `id_u`='".$user['id']."'");
mysql_querll("UPDATE `tanks` SET `boy_serebro`='".$serebro."',`boy_experience`='".$opt."',`boy_play`='Победа',`boy_seropit`='100',`boy_pokaz`='1' WHERE `id_u`='".$user['id']."'");
mysql_query("UPDATE `zadan` SET `nachalo`=`nachalo`+'".$opt."' WHERE `id_user`='".$user['id']."' AND `type`='6'");


if (
$tanks_code['clan']>0){
mysql_query("UPDATE `collective` SET `rating` = `rating`+'".$opt."' WHERE `id`='".$mc['id']."'");
mysql_query("UPDATE `collective_user` SET `rating` = `rating`+'".$opt."' WHERE `id_user`='".$tanks_code['id']."'");

}
}
header("Location:/boyuser");

}
/*Победа*/

/*Поражение*/
elseif($rand 70)
{   
    
mysql_query("UPDATE `tanks_boy` SET `vkl`=`vkl`+'1'  WHERE `id`='".$tanks_boy_table['id']."'");

mysql_query("UPDATE `tanks` SET `serrating`='".($tanks_code['serrating']+50)."' WHERE `id_u`='".$user['id']."'");


mysql_query("UPDATE `zadan` SET `nachalo`=`nachalo`+1 WHERE `id_user`='".$user['id']."' AND `type`='2'");
mysql_query("UPDATE `zadan` SET `nachalo`=`nachalo`+1 WHERE `id_user`='".$user['id']."' AND `type`='3'");

mysql_query("UPDATE `tanks` SET `win`=`win`+1 WHERE `id_u`='".$tanks_boy['id']."'");
mysql_query("UPDATE `tanks` SET `battle`=`battle`+1 WHERE `id_u`='".$tanks_boy['id']."'");
mysql_query("UPDATE `user` SET `win`=`win`+1 WHERE `id_u`='".$tanks_boy['id']."'");
mysql_query("UPDATE `tanks` SET `battle`=`battle`+1 WHERE `id_u`='".$user['id']."'");

mysql_query("UPDATE `tanks` SET `boy`=`boy`+1 WHERE `id_u`='".$tanks_code['id']."'");

mysql_query("UPDATE `tanks` SET `lose`=`lose`+1 WHERE `id_u`='".$user['id']."'");

/*Розница уровней*/
if ($tanks_code['leveltank']>=&& $tanks_code['leveltank']<=2){$serebro=200$opt=50;}
elseif (
$tanks_code['leveltank']>=&& $tanks_code['leveltank']<=4){$serebro=250$opt=75;}
elseif (
$tanks_code['leveltank']>=&& $tanks_code['leveltank']<=7){$serebro=500$opt=100;}
elseif (
$tanks_code['leveltank']==){$serebro=750$opt=125;}
elseif (
$tanks_code['leveltank']>=&& $tanks_code['leveltank']<=10){$serebro=1000$opt=150;}

if (
$tanks_code['prem']>0){
$serebros=$serebro*0.8;
$opts=$opt*1.2;
mysql_querll("UPDATE `tanks` SET `race_kol`=`race_kol`+1,`battle`=`battle`+1,`serebro`=`serebro`-$serebros,`rating` = `rating`+$opts,`fuel` = `fuel`-15 WHERE `id_u`='".$user['id']."'");
mysql_querll("UPDATE `tanks` SET `boy_serebro`='".$serebros."',`boy_experience`='".$opts."',`boy_play`='Поражение',`boy_seropit`='50',`boy_pokaz`='1' WHERE `id_u`='".$user['id']."'");
mysql_query("UPDATE `zadan` SET `nachalo`=`nachalo`+'".$opts."' WHERE `id_user`='".$user['id']."' AND `type`='6'");


if (
$tanks_code['clan']>0){
mysql_query("UPDATE `collective` SET `rating` = `rating`+$opts WHERE `id`='".$mc['id']."'");mysql_query("UPDATE `collective_user` SET `rating` = `rating`+'".$opts."' WHERE `id_user`='".$tanks_code['id']."'");
}
}
else{
mysql_querll("UPDATE `tanks` SET `race_kol`=`race_kol`+1,`battle`=`battle`+1,`serebro`=`serebro`-$serebro,`rating` = `rating`+$opt,`fuel` = `fuel`-15 WHERE `id_u`='".$user['id']."'");

mysql_querll("UPDATE `tanks` SET `boy_serebro`='".$serebro."',`boy_experience`='".$opt."',`boy_play`='Поражение',`boy_seropit`='50',`boy_pokaz`='1' WHERE `id_u`='".$user['id']."'");
mysql_query("UPDATE `zadan` SET `nachalo`=`nachalo`+'".$opt."' WHERE `id_user`='".$user['id']."' AND `type`='6'");

if (
$tanks_code['clan']>0){
mysql_query("UPDATE `collective` SET `rating` = `rating`+$opt WHERE `id`='".$mc['id']."'");mysql_query("UPDATE `collective_user` SET `rating` = `rating`+'".$opt."' WHERE `id_user`='".$tanks_code['id']."'");

}
}
header("Location:/boyuser");

}
/*Поражение*/

/*Ничья*/
elseif($rand >= 40 && $rand <= 70)
{
mysql_query("UPDATE `tanks` SET `serrating`='".($tanks_code['serrating']+75)."' WHERE `id_u`='".$user['id']."'");


mysql_query("UPDATE `zadan` SET `nachalo`=`nachalo`+1 WHERE `id_user`='".$user['id']."' AND `type`='2'");

mysql_query("UPDATE `tanks_boy` SET `vkl`=`vkl`+'1'  WHERE `id`='".$tanks_boy_table['id']."'");

mysql_query("UPDATE `tanks` SET `nich`=`nich`+1 WHERE `id_u`='".$tanks_boy['id']."' 1");
mysql_query("UPDATE `tanks` SET `battle`=`battle`+1 WHERE `id_u`='".$tanks_boy['id']."' ");

mysql_query("UPDATE `tanks` SET `boy`=`boy`+1 WHERE `id_u`='".$tanks_code['id']."' ");
mysql_query("UPDATE `tanks` SET `battle`=`battle`+1 WHERE `id_u`='".$user['id']."'");


mysql_query("UPDATE `tanks` SET `nich`=`nich`+1 WHERE `id_u`='".$user['id']."'");

/*Розница уровней*/
if ($tanks_code['leveltank']>=&& $tanks_code['leveltank']<=2){$serebro=100$opt=100;}
elseif (
$tanks_code['leveltank']>=&& $tanks_code['leveltank']<=4){$serebro=250$opt=250;}
elseif (
$tanks_code['leveltank']>=&& $tanks_code['leveltank']<=7){$serebro=500$opt=500;}
elseif (
$tanks_code['leveltank']==){$serebro=750$opt=750;}
elseif (
$tanks_code['leveltank']>=&& $tanks_code['leveltank']<=10){$serebro=1000$opt=1000;}

if (
$tanks_code['prem']>0){
$serebros=$serebro*1.2;
$opts=$opt*1.2;
mysql_querll("UPDATE `tanks` SET `race_kol`=`race_kol`+1,`battle`=`battle`+1,`serebro`=`serebro`+$serebros,`rating` = `rating`+$opts,`fuel` = `fuel`-15 WHERE `id_u`='".$user['id']."'");
mysql_querll("UPDATE `tanks` SET `boy_serebro`='".$serebros."',`boy_experience`='".$opts."',`boy_play`='Ничья',`boy_seropit`='75',`boy_pokaz`='1' WHERE `id_u`='".$user['id']."'");
mysql_query("UPDATE `zadan` SET `nachalo`=`nachalo`+'".$opts."' WHERE `id_user`='".$user['id']."' AND `type`='6'");

if (
$tanks_code['clan']>0){
mysql_query("UPDATE `collective` SET `rating` = `rating`+$opts WHERE `id`='".$mc['id']."'");mysql_query("UPDATE `collective_user` SET `rating` = `rating`+'".$opts."' WHERE `id_user`='".$tanks_code['id']."'");

}
}
else{
mysql_querll("UPDATE `tanks` SET `race_kol`=`race_kol`+1,`battle`=`battle`+1,`serebro`=`serebro`+$serebro,`rating` = `rating`+$opt,`fuel` = `fuel`-15 WHERE `id_u`='".$user['id']."'");
mysql_querll("UPDATE `tanks` SET `boy_serebro`='".$serebro."',`boy_experience`='".$opt."',`boy_play`='Ничья',`boy_seropit`='75',`boy_pokaz`='1' WHERE `id_u`='".$user['id']."'");
mysql_query("UPDATE `zadan` SET `nachalo`=`nachalo`+'".$opt."' WHERE `id_user`='".$user['id']."' AND `type`='6'");

if (
$tanks_code['clan']>0){
mysql_query("UPDATE `collective` SET `rating` = `rating`+$opt WHERE `id`='".$mc['id']."'");mysql_query("UPDATE `collective_user` SET `rating` = `rating`+'".$opt."' WHERE `id_user`='".$tanks_code['id']."'");

}
}

header("Location:/boyuser");
}
/*Ничья*/


}else{err_game('У вас не достаточно топлива');}

    
}

    
   
$rdnmysql_fetch_array(mysql_query("SELECT * FROM `tanks_magazin` WHERE `id`='".$tanks_boy['tank']."'"));
   
$rkdmysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id`='".$tanks_boy['id']."'"));

$mscus mysql_fetch_array(mysql_query("SELECT * FROM `collective_user` WHERE `id_user` = '$tanks_boy[id]'"));
$mscs mysql_fetch_array(mysql_query("SELECT * FROM `collective` WHERE `id` = '$mscus[id_collective]'"));




$atakas=atack($tanks_boy['id']);
$brons=bron($tanks_boy['id']);
$tochs=toch($tanks_boy['id']);
$prochs=proch($tanks_boy['id']);


echo 
'<div class="trnt-block" style="margin-bottom:15px">
  <div class="wrap1">
    <div class="wrap2">
      <div class="wrap3">
        <div class="wrap4">
          <div class="wrap5">
            <div class="wrap6">
              <div class="wrap7">
                <div class="wrap8">
                  <div class="wrap-content">
                    <table><tbody><tr>                    <div class="small bold green2 cntr sh_b pb5 pt5">'
.$rkd['nick'].'</div>

<td><img class="tank-img" alt="tank" width="175" height="175" src="/web/tanks/'
.$rdn['screen'].'"></td>
<td style = " width :  125px ; "><div class="white small sh_b bold mb10"><img src="/images/levels.png" width="14" height="14"> '
.$tanks_boy['leveltank'].' уровень<br><img src="/tanks/images/atack.png" width="14" height="14"> '.$atakas.' атака<br><img src="/tanks/images/bron.png" width="14" height="14"> '.$brons.' броня<br><img src="/tanks/images/toch.png" width="14" height="14"> '.$tochs.' точность<br><img src="/tanks/images/proch.png" width="14" height="14"> '.$prochs.' прочность<br>'.$cars['type'].'</div></td></tr></tbody></table>
                    <div class="bot">
                      <a class="simple-but border" href="?boy">
                        <span>
                          <span>'
.$boyka.'</span>
                        </span>
                      </a>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>'
;   
}    
}





include_once 
'foots.php';
?>
Онлайн: 1
Реклама