<?

////////////////////////////////////////////////////////////////////////

						/////////////////////////
						//1-я глава
						////////////////////////
$task_id=9;// Убей 3 волков
$req = mysql_query('select * from `task_user` WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'") AND (`complete`="0")');
    if (mysql_num_rows ($req) != 0) {
while ($t = mysql_fetch_array ($req)) {
if($user['lair']>1){$lair=1;}
if($user['lair']>2){$lair=2;}
if($user['lair']>3){$lair=3;}
$task = mysql_fetch_array(mysql_query ('SELECT * FROM `task` WHERE (`id`="'.$task_id.'")'));
if ($t['how'] < $task['how']){                          
mysql_query ('UPDATE `task_user` SET `how`="'.$lair.'" WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}}}
/////////////////////////									 
$task_id=10;// Улучши амулет
$req = mysql_query('select * from `task_user` WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'") AND (`complete`="0")');
    if (mysql_num_rows ($req) != 0) {
while ($t = mysql_fetch_array ($req)) {
$task = mysql_fetch_array(mysql_query ('SELECT * FROM `task` WHERE (`id`="'.$task_id.'")'));
if ($t['how'] < $task['how']){                          
mysql_query ('UPDATE `task_user` SET `how`="'.$user['amulet'].'" WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}}}
/////////////////////////	
$task_id=12;// Тренируй силу до 15
$req = mysql_query('select * from `task_user` WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'") AND (`complete`="0")');
    if (mysql_num_rows ($req) != 0) {
while ($t = mysql_fetch_array ($req)) {
$task = mysql_fetch_array(mysql_query ('SELECT * FROM `task` WHERE (`id`="'.$task_id.'")'));
if ($t['how'] < $task['how']){ 
if($user['_str'] < '15'){                           
mysql_query ('UPDATE `task_user` SET `how`="'.($user['_str']*3).'" WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}else{
mysql_query ('UPDATE `task_user` SET `how`=15 WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}}}}
/////////////////////////
$item_13=mysql_result(mysql_query('SELECT COUNT(*) FROM `inv` WHERE `user`= "'.$user['id'].'" AND `quality` >= "1" AND `equip`="1" '),0);
$task_id=13;// Надень 8 простых вещей
$req = mysql_query('select * from `task_user` WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'") AND (`complete`="0")');
    if (mysql_num_rows ($req) != 0) {
while ($t = mysql_fetch_array ($req)) {
$task = mysql_fetch_array(mysql_query ('SELECT * FROM `task` WHERE (`id`="'.$task_id.'")'));
if ($t['how'] < $task['how']){                          
mysql_query ('UPDATE `task_user` SET `how`="'.$item_13.'" WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}}}
/////////////////////////
$task_id=15;// Набери 125 здоровья
$req = mysql_query('select * from `task_user` WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'") AND (`complete`="0")');
    if (mysql_num_rows ($req) != 0) {
while ($t = mysql_fetch_array ($req)) {
$task = mysql_fetch_array(mysql_query ('SELECT * FROM `task` WHERE (`id`="'.$task_id.'")'));
if ($t['how'] < $task['how']){ 
if($user['vit'] < '125'){                           
mysql_query ('UPDATE `task_user` SET `how`="'.$user['vit'].'" WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}else{
mysql_query ('UPDATE `task_user` SET `how`=125 WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}}}}
/////////////////////////
$item_16=mysql_result(mysql_query('SELECT COUNT(*) FROM `inv` WHERE `user`= "'.$user['id'].'" AND `smith` >= "1" AND `equip`="1" '),0);
$task_id=16;// Заточи все вещи на +1
$req = mysql_query('select * from `task_user` WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'") AND (`complete`="0")');
    if (mysql_num_rows ($req) != 0) {
while ($t = mysql_fetch_array ($req)) {
$task = mysql_fetch_array(mysql_query ('SELECT * FROM `task` WHERE (`id`="'.$task_id.'")'));
if ($t['how'] < $task['how']){                          
mysql_query ('UPDATE `task_user` SET `how`="'.$item_16.'" WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}}}
////////////////////////////
$task_id=17;// Убей оборотня в пещере
$req = mysql_query('select * from `task_user` WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'") AND (`complete`="0")');
    if (mysql_num_rows ($req) != 0) {
while ($t = mysql_fetch_array ($req)) {
if($user['lair']>4){$lair=1;}
$task = mysql_fetch_array(mysql_query ('SELECT * FROM `task` WHERE (`id`="'.$task_id.'")'));
if ($t['how'] < $task['how'] AND $user['lair'] > '4'){                          
mysql_query ('UPDATE `task_user` SET `how`="'.$lair.'" WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}}}
						/////////////////////////
						//2-я глава
						////////////////////////


$task_id=18;// Убей 3 орков
$req = mysql_query('select * from `task_user` WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'") AND (`complete`="0")');
    if (mysql_num_rows ($req) != 0) {
while ($t = mysql_fetch_array ($req)) {
if($user['lair']>5){$lair=1;}
if($user['lair']>6){$lair=2;}
if($user['lair']>7){$lair=3;}
$task = mysql_fetch_array(mysql_query ('SELECT * FROM `task` WHERE (`id`="'.$task_id.'")'));
if ($t['how'] < $task['how']){                          
mysql_query ('UPDATE `task_user` SET `how`="'.$lair.'" WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}}}
/////////////////////////	
$task_id=20;// Тренируй броню до 30
$req = mysql_query('select * from `task_user` WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'") AND (`complete`="0")');
    if (mysql_num_rows ($req) != 0) {
while ($t = mysql_fetch_array ($req)) {
$task = mysql_fetch_array(mysql_query ('SELECT * FROM `task` WHERE (`id`="'.$task_id.'")'));
if ($t['how'] < $task['how']){ 
if($user['_def'] < '30'){                           
mysql_query ('UPDATE `task_user` SET `how`="'.($user['_def']*3).'"  WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}else{
mysql_query ('UPDATE `task_user` SET `how`=30 WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}}}}
/////////////////////////
$item_21=mysql_result(mysql_query('SELECT COUNT(*) FROM `inv` WHERE `user`= "'.$user['id'].'" AND `smith` >= "2" AND `equip`="1" '),0);
$task_id=21;// Заточи все вещи на +2
$req = mysql_query('select * from `task_user` WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'") AND (`complete`="0")');
    if (mysql_num_rows ($req) != 0) {
while ($t = mysql_fetch_array ($req)) {
$task = mysql_fetch_array(mysql_query ('SELECT * FROM `task` WHERE (`id`="'.$task_id.'")'));
if ($t['how'] < $task['how']){                          
mysql_query ('UPDATE `task_user` SET `how`="'.$item_21.'" WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}}}
/////////////////////////
$task_id=23;// Прокачай умение Ярость до 1 уровня
$req = mysql_query('select * from `task_user` WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'") AND (`complete`="0")');
    if (mysql_num_rows ($req) != 0) {
while ($t = mysql_fetch_array ($req)) {
$task = mysql_fetch_array(mysql_query ('SELECT * FROM `task` WHERE (`id`="'.$task_id.'")'));
if ($t['how'] < $task['how']){ 
if($user['ability_1'] >= '1'){                           
mysql_query ('UPDATE `task_user` SET `how`=1 WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}}}}
/////////////////////////
$task_id=24;// Набери 330 здоровья
$req = mysql_query('select * from `task_user` WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'") AND (`complete`="0")');
    if (mysql_num_rows ($req) != 0) {
while ($t = mysql_fetch_array ($req)) {
$task = mysql_fetch_array(mysql_query ('SELECT * FROM `task` WHERE (`id`="'.$task_id.'")'));
if ($t['how'] < $task['how']){ 
if($user['vit'] < '330'){                           
mysql_query ('UPDATE `task_user` SET `how`="'.$user['vit'].'" WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}else{
mysql_query ('UPDATE `task_user` SET `how`=330 WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}}}}
/////////////////////////
$task_id=27;// Убей горного троля
$req = mysql_query('select * from `task_user` WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'") AND (`complete`="0")');
    if (mysql_num_rows ($req) != 0) {
while ($t = mysql_fetch_array ($req)) {
if($user['lair']>8){$lair=1;}
$task = mysql_fetch_array(mysql_query ('SELECT * FROM `task` WHERE (`id`="'.$task_id.'")'));
if ($t['how'] < $task['how'] AND $user['lair'] > '8'){                                
mysql_query ('UPDATE `task_user` SET `how`="'.$lair.'" WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}}}
						/////////////////////////
						//3-я глава
						////////////////////////

$task_id=28;// Убей 3 зомби
$req = mysql_query('select * from `task_user` WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'") AND (`complete`="0")');
    if (mysql_num_rows ($req) != 0) {
while ($t = mysql_fetch_array ($req)) {
if($user['lair']>9){$lair=1;}
if($user['lair']>10){$lair=2;}
if($user['lair']>11){$lair=3;}
$task = mysql_fetch_array(mysql_query ('SELECT * FROM `task` WHERE (`id`="'.$task_id.'")'));
if ($t['how'] < $task['how']){                          
mysql_query ('UPDATE `task_user` SET `how`="'.$lair.'" WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}}}
/////////////////////////						
$task_id=29;// Улучши амулет до 5
$req = mysql_query('select * from `task_user` WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'") AND (`complete`="0")');
    if (mysql_num_rows ($req) != 0) {
while ($t = mysql_fetch_array ($req)) {
$task = mysql_fetch_array(mysql_query ('SELECT * FROM `task` WHERE (`id`="'.$task_id.'")'));
if ($t['how'] < $task['how']){                          
mysql_query ('UPDATE `task_user` SET `how`="'.$user['amulet'].'" WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}}}
/////////////////////////
$task_id=30;// Набери 500 брони
$req = mysql_query('select * from `task_user` WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'") AND (`complete`="0")');
    if (mysql_num_rows ($req) != 0) {
while ($t = mysql_fetch_array ($req)) {
$task = mysql_fetch_array(mysql_query ('SELECT * FROM `task` WHERE (`id`="'.$task_id.'")'));
if ($t['how'] < $task['how']){ 
if($user['def'] < '500'){                           
mysql_query ('UPDATE `task_user` SET `how`="'.$user['def'].'" WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}else{
mysql_query ('UPDATE `task_user` SET `how`=500 WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}}}}
/////////////////////////
$task_id=31;// Прокачай все умения до 1 уровня
$req = mysql_query('select * from `task_user` WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'") AND (`complete`="0")');
    if (mysql_num_rows ($req) != 0) {
while ($t = mysql_fetch_array ($req)) {
if($user['ability_1']>=1){$ability+=1;}
if($user['ability_2']>=1){$ability+=1;}
if($user['ability_3']>=1){$ability+=1;}
if($user['ability_4']>=1){$ability+=1;}
$task = mysql_fetch_array(mysql_query ('SELECT * FROM `task` WHERE (`id`="'.$task_id.'")'));
if ($t['how'] < $task['how']){                          
mysql_query ('UPDATE `task_user` SET `how`="'.$ability.'" WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}}}
/////////////////////////
$item_32=mysql_result(mysql_query('SELECT COUNT(*) FROM `inv` WHERE `user`= "'.$user['id'].'" AND `quality` >= "3" AND `equip`="1" '),0);
$task_id=32;// Надень 6 вещей редкого качества и выше
$req = mysql_query('select * from `task_user` WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'") AND (`complete`="0")');
    if (mysql_num_rows ($req) != 0) {
while ($t = mysql_fetch_array ($req)) {
$task = mysql_fetch_array(mysql_query ('SELECT * FROM `task` WHERE (`id`="'.$task_id.'")'));
if ($t['how'] < $task['how']){                          
mysql_query ('UPDATE `task_user` SET `how`="'.$item_32.'" WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}}}
/////////////////////////
$item_34=mysql_result(mysql_query('SELECT COUNT(*) FROM `inv` WHERE `user`= "'.$user['id'].'" AND `smith` >= "5" AND `equip`="1" '),0);
$task_id=34;// Заточи все вещи на +5
$req = mysql_query('select * from `task_user` WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'") AND (`complete`="0")');
    if (mysql_num_rows ($req) != 0) {
while ($t = mysql_fetch_array ($req)) {
$task = mysql_fetch_array(mysql_query ('SELECT * FROM `task` WHERE (`id`="'.$task_id.'")'));
if ($t['how'] < $task['how']){                          
mysql_query ('UPDATE `task_user` SET `how`="'.$item_34.'" WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}}}
///////////////////////
$item_36=mysql_result(mysql_query('SELECT COUNT(*) FROM `inv` WHERE `user`= "'.$user['id'].'" AND `rune` >= "1" AND `equip`="1" '),0);
$task_id=36;// Установи 2 руны обычного качества и выше
$req = mysql_query('select * from `task_user` WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'") AND (`complete`="0")');
    if (mysql_num_rows ($req) != 0) {
while ($t = mysql_fetch_array ($req)) {
if($item_36 <= 2){$run=item_36;}else{$run=2;}
$task = mysql_fetch_array(mysql_query ('SELECT * FROM `task` WHERE (`id`="'.$task_id.'")'));
if ($t['how'] < $task['how']){                          
mysql_query ('UPDATE `task_user` SET `how`="'.$run.'" WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}}}
/////////////////////////////
$task_id=37;// Набери 600 силы
$req = mysql_query('select * from `task_user` WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'") AND (`complete`="0")');
    if (mysql_num_rows ($req) != 0) {
while ($t = mysql_fetch_array ($req)) {
$task = mysql_fetch_array(mysql_query ('SELECT * FROM `task` WHERE (`id`="'.$task_id.'")'));
if ($t['how'] < $task['how']){ 
if($user['str'] < '600'){                           
mysql_query ('UPDATE `task_user` SET `how`="'.$user['def'].'" WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}else{
mysql_query ('UPDATE `task_user` SET `how`=600 WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}}}}
/////////////////////////
$task_id=38;// Тренируй здоровье до 35
$req = mysql_query('select * from `task_user` WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'") AND (`complete`="0")');
    if (mysql_num_rows ($req) != 0) {
while ($t = mysql_fetch_array ($req)) {
$task = mysql_fetch_array(mysql_query ('SELECT * FROM `task` WHERE (`id`="'.$task_id.'")'));
if ($t['how'] < $task['how']){ 
if($user['_vit'] < '35'){                           
mysql_query ('UPDATE `task_user` SET `how`="'.($user['_vit']*3).'"  WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}else{
mysql_query ('UPDATE `task_user` SET `how`=35 WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}}}}
/////////////////////////
$task_id=39;// Найди и убей Вампира
$req = mysql_query('select * from `task_user` WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'") AND (`complete`="0")');
    if (mysql_num_rows ($req) != 0) {
while ($t = mysql_fetch_array ($req)) {
if($user['lair']>12){$lair=1;}
$task = mysql_fetch_array(mysql_query ('SELECT * FROM `task` WHERE (`id`="'.$task_id.'")'));
if ($t['how'] < $task['how'] AND $user['lair'] > '12'){                                 
mysql_query ('UPDATE `task_user` SET `how`="'.$lair.'" WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}}}

						/////////////////////////
						//4-я глава
						////////////////////////
$task_id=40;// Прокачай 4 умения до 3 уровня
$req = mysql_query('select * from `task_user` WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'") AND (`complete`="0")');
    if (mysql_num_rows ($req) != 0) {
while ($t = mysql_fetch_array ($req)) {
if($user['ability_1']>=3){$ability+=1;}
if($user['ability_2']>=3){$ability+=1;}
if($user['ability_3']>=3){$ability+=1;}
if($user['ability_4']>=3){$ability+=1;}
$task = mysql_fetch_array(mysql_query ('SELECT * FROM `task` WHERE (`id`="'.$task_id.'")'));
if ($t['how'] < $task['how']){                          
mysql_query ('UPDATE `task_user` SET `how`="'.$ability.'" WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}}}
/////////////////////////
$item_41=mysql_result(mysql_query('SELECT COUNT(*) FROM `inv` WHERE `user`= "'.$user['id'].'" AND `quality` >= "4" AND `equip`="1" '),0);
$task_id=41;// Надень 6 вещей эпического качества и выше
$req = mysql_query('select * from `task_user` WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'") AND (`complete`="0")');
    if (mysql_num_rows ($req) != 0) {
while ($t = mysql_fetch_array ($req)) {
$task = mysql_fetch_array(mysql_query ('SELECT * FROM `task` WHERE (`id`="'.$task_id.'")'));
if ($t['how'] < $task['how']){                          
mysql_query ('UPDATE `task_user` SET `how`="'.$item_41.'" WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}}}
/////////////////////////
$item_42=mysql_result(mysql_query('SELECT COUNT(*) FROM `inv` WHERE `user`= "'.$user['id'].'" AND `smith` >= "6" AND `equip`="1" '),0);
$task_id=42;// Заточи все вещи на +6
$req = mysql_query('select * from `task_user` WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'") AND (`complete`="0")');
    if (mysql_num_rows ($req) != 0) {
while ($t = mysql_fetch_array ($req)) {
$task = mysql_fetch_array(mysql_query ('SELECT * FROM `task` WHERE (`id`="'.$task_id.'")'));
if ($t['how'] < $task['how']){                          
mysql_query ('UPDATE `task_user` SET `how`="'.$item_42.'" WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}}}
///////////////////////
$task_id=44;// Убей 3 гончих
$req = mysql_query('select * from `task_user` WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'") AND (`complete`="0")');
    if (mysql_num_rows ($req) != 0) {
while ($t = mysql_fetch_array ($req)) {
if($user['lair']>13){$lair=1;}
if($user['lair']>14){$lair=2;}
if($user['lair']>15){$lair=3;}
$task = mysql_fetch_array(mysql_query ('SELECT * FROM `task` WHERE (`id`="'.$task_id.'")'));
if ($t['how'] < $task['how']){                          
mysql_query ('UPDATE `task_user` SET `how`="'.$lair.'" WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}}}
/////////////////////////	
$task_id=45;// Убей цербера
$req = mysql_query('select * from `task_user` WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'") AND (`complete`="0")');
    if (mysql_num_rows ($req) != 0) {
while ($t = mysql_fetch_array ($req)) {
if($user['lair']>16){$lair=1;}
$task = mysql_fetch_array(mysql_query ('SELECT * FROM `task` WHERE (`id`="'.$task_id.'")'));
if ($t['how'] < $task['how'] AND $user['lair'] > '16'){                               
mysql_query ('UPDATE `task_user` SET `how`="'.$lair.'" WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}}}
/////////////////////////	
$task_id=46;// Улучши амулет до 7
$req = mysql_query('select * from `task_user` WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'") AND (`complete`="0")');
    if (mysql_num_rows ($req) != 0) {
while ($t = mysql_fetch_array ($req)) {
$task = mysql_fetch_array(mysql_query ('SELECT * FROM `task` WHERE (`id`="'.$task_id.'")'));
if ($t['how'] < $task['how']){                          
mysql_query ('UPDATE `task_user` SET `how`="'.$user['amulet'].'" WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}}}
/////////////////////////
$task_id=48;// Тренируй силу до 40
$req = mysql_query('select * from `task_user` WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'") AND (`complete`="0")');
    if (mysql_num_rows ($req) != 0) {
while ($t = mysql_fetch_array ($req)) {
$task = mysql_fetch_array(mysql_query ('SELECT * FROM `task` WHERE (`id`="'.$task_id.'")'));
if ($t['how'] < $task['how']){ 
if($user['_str'] < '40'){                           
mysql_query ('UPDATE `task_user` SET `how`="'.($user['_str']*3).'"  WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}else{
mysql_query ('UPDATE `task_user` SET `how`=40 WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}}}}
/////////////////////////
$task_id=49;// Прокачай здоровье до 1100
$req = mysql_query('select * from `task_user` WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'") AND (`complete`="0")');
    if (mysql_num_rows ($req) != 0) {
while ($t = mysql_fetch_array ($req)) {
$task = mysql_fetch_array(mysql_query ('SELECT * FROM `task` WHERE (`id`="'.$task_id.'")'));
if ($t['how'] < $task['how']){ 
if($user['vit'] < '1100'){                           
mysql_query ('UPDATE `task_user` SET `how`="'.$user['vit'].'" WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}else{
mysql_query ('UPDATE `task_user` SET `how`=1100 WHERE (`user`="'.$user['id'].'") AND (`task`="'.$task_id.'")');
}}}}
/////////////////////////
?>