level file data ex txt exp trim level user level exp_gold user level 1

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
$level = file(H."data/ex.txt");
$exp = trim($level[$user['level']+1]);
$exp_gold = (5 + $user['level'])*100;
if($user['exp'] >= $exp and $user['level'] < 105){
mysql_query("update `user` set `level` = '".($user['level']+1)."', `exp`='0', `gold`='".($user['gold']+$exp_gold)."', `health`='".($user['max_health'])."' where `id` = '".$user['id']."' LIMIT 1");
$l=$user['level']+1;
$_SESSION['light'] = "<font color='#FE642E'>Вы получили ".$l." уровень!</font><div class='empty'></div><span class='blue'>Ваша награда:</span> <img src='/images/icon/gold.png' alt=''/> ".($exp_gold/100)." </div>";
header('location: ?');
exit;
}