Просмотр кода
Название: код
Описание: описание
Добавил: [PHP] scam
Дата: 9 мар 2015, в 21:00 Комментарии (0)
Описание: описание
<?
$id = _string(_num($_COOKIE['id']));
$password = _string($_COOKIE['password']);
if($id && $password) {
$q = mysql_query('SELECT * FROM `users` WHERE `id` = "'.$id.'" AND `password` = "'.$password.'"');
$user = mysql_fetch_array($q);
if(!$user) {
setCookie('id', '');
setCookie('password', '');
}
mysql_query('UPDATE `users` SET `online` = "'.time().'",
`ip` = "'.$_SERVER['REMOTE_ADDR'].'",
`ua` = "'.$_SERVER['HTTP_USER_AGENT'].'",
`self` = "'.$_SERVER['PHP_SELF'].'" WHERE `id` = "'.$user['id'].'"');
$_time = 2;
if($user['last_update'] < (time() - $_time)){
mysql_query('UPDATE `users` SET `last_update` = "'.time().'" WHERE `id` = "'.$user['id'].'"');
}
if((time() - $user['last_update']) > $_time) {
mysql_query('UPDATE `users` SET `last_update` = "'.time().'" WHERE `id` = "'.$user['id'].'"');
if($user['self'] != '/coliseum.php') {
$hp = $user['vit'] * 2;
if($user['hp'] < $hp) {
$_hp = (((time() - $user['last_update']) / $_time) - 1 );
if($_hp > $hp) {
$_hp = $hp - $user['hp'];
}
mysql_query('UPDATE `users` SET `hp` = "'.($user['hp'] + $_hp ).'" WHERE `id` = "'.$user['id'].'"');
}
if($user['mp'] < $user['mana']) {
$_mp = (((time() - $user['last_update']) / $_time) - 1 );
if($_mp > $user['mana']) {
$_mp = $user['mana'] - $user['mp'];
}
mysql_query('UPDATE `users` SET `mp` = "'.($user['mp'] +$_mp ).'" WHERE `id` = "'.$user['id'].'"');
}
}
}
if($user['last_update'] - $user['duel_last_update'] > (60 * 30)) {
mysql_query('UPDATE `users` SET `duel_last_update` = "'.($user['duel_last_update'] + (60 * 30)).'",
`duel_fights` = "'.($user['duel_fights'] + (($user['duel_fights'] < 11) ? 1:0)).'",
`duel_changes` = "'.($user['duel_changes'] + (($user['duel_changes'] < 11) ? 1:0)).'" WHERE `id` = "'.$user['id'].'"');
}
if($user['hp'] > $user['vit'] * 2) {
mysql_query('UPDATE `users` SET `hp` = "'.($user['vit'] * 2).'" WHERE `id` = "'.$user['id'].'"');
}
if($user['hp'] < 0) {
mysql_query('UPDATE `users` SET `hp` = "0" WHERE `id` = "'.$user['id'].'"');
}
if($user['mp'] > $user['mana']) {
mysql_query('UPDATE `users` SET `mp` = "'.$user['mana'].'" WHERE `id` = "'.$user['id'].'"');
}
if($user['mp'] < 0) {
mysql_query('UPDATE `users` SET `mp` = "0" WHERE `id` = "'.$user['id'].'"');
}
$clan_memb = mysql_query('SELECT * FROM `clan_memb` WHERE `user` = "'.$user['id'].'"');
$clan_memb = mysql_fetch_array($clan_memb);
function clan_buff($i) {
switch($i) {
case 0:
$buff = 4;
break;
case 1:
$buff = 4;
break;
case 2:
$buff = 8;
break;
case 3:
$buff = 12;
break;
case 4:
$buff = 24;
break;
case 5:
$buff = 28;
break;
case 6:
$buff = 32;
break;
case 7:
$buff = 36;
break;
case 8:
$buff = 48;
break;
case 9:
$buff = 52;
break;
Добавил: [PHP] scam
Дата: 9 мар 2015, в 21:00 Комментарии (0)