battles/magic/un_sleep.php

21 lines
1.1 KiB
PHP
Raw Normal View History

2018-01-28 16:40:49 +00:00
<?php
$effect = mysql_fetch_array(mysql_query("SELECT `id` FROM `effects` WHERE `owner` = '{$user['id']}' AND `can` = '1' LIMIT 1"));
$vip = mysql_fetch_array(mysql_query('SELECT `id`, `uid`, `unsleep` FROM `abils_vip` WHERE `uid` = "'.$user['id'].'" LIMIT 1'));
if($vip['unsleep'] <= 0) {
echo 'Магия была исчерпана ...';
} elseif($_POST['target'] != $user['login']) {
echo 'Только на себя ...';
} elseif($user['battle'] > 0) {
echo "Не в бою ...";
} elseif(!isset($effect['id'])) {
echo "Нечего снимать...";
} else {
if($user['invis'] == 1) { $user['login'] = 'невидимка'; }
mysql_query("DELETE FROM `effects` WHERE `owner` = '".$user['id']."' AND `id` = '".$effect['id']."' LIMIT 1");
$vip['unsleep'] -= 1;
mysql_query('UPDATE `abils_vip` SET `unsleep` = "'.$vip['unsleep'].'" WHERE `id` = "'.$vip['id'].'" LIMIT 1');
echo "<font color=red><b>На персонажа \"{$user['login']}\" наложено заклятие \"Снять заклятие молчания\" </b></font>";
}
2019-01-16 17:45:30 +00:00