Esempio n. 1
0
 $timeactionf = $WSDB->selectCell("SELECT `timeaction` FROM `mwfe3_character_actions` WHERE account=?d and `guid`=?d and `action`=? ORDER BY `timeaction` DESC LIMIT 1", $user['id'], $guid, $action);
 $timeaction = strtotime($timeactionf);
 $timediffh = floor(($timecurr - $timeaction) / 3600);
 if ($action == 'rename') {
     if (!$config['chars_rename_enable']) {
         output_message('alert', 'Переименование персонажей запрещено!' . '<meta http-equiv=refresh content="2;url=index.php?n=account&sub=chars">');
     } else {
         if ($timediffh < $config['chars_rename_hdiff'] and !$isadmin) {
             $timenext = $timeaction + 3600 * $config['chars_rename_hdiff'];
             $timenextf = date('Y-m-d H:i:s', $timenext);
             output_message('alert', 'Слишком часто переименовываетесь! <br /> Следующий ренейм возможен: ' . $timenextf . '<meta http-equiv=refresh content="2;url=index.php?n=account&sub=chars">');
         } else {
             if ($my_char->money < $config['chars_rename_cost'] and !$isadmin) {
                 output_message('alert', 'Недостаточно средств для переименования персонажа!<br />Есть: ' . money($my_char->money) . '<br />Нужно: ' . money($config['chars_rename_cost']) . '<meta http-equiv=refresh content="2;url=index.php?n=account&sub=chars">');
             } else {
                 if ($my_char->RenameIsSet()) {
                     output_message('notice', 'Флаг переименования уже был установлен!' . '<meta http-equiv=refresh content="2;url=index.php?n=account&sub=chars">');
                 } else {
                     $WSDB->query("INSERT INTO `mwfe3_character_actions` \n                                (`guid`, `account`, `action`, `timeaction`, `data`) \n                                VALUES\n                                (?d,?d,?,?,?);", $my_char->guid, $user['id'], $action, $timecurrf, $my_char->name);
                     $my_char->RenameSet(1);
                     $my_char->MoneyAdd(-$config['chars_rename_cost'], $mangos_field);
                     $WSDB->query("UPDATE `characters` SET ?a WHERE account=?d and `guid`=?d LIMIT 1", $my_char->sqlinfo, $user['id'], $my_char->guid);
                     output_message('notice', 'Флаг переименования установлен!' . '<meta http-equiv=refresh content="2;url=index.php?n=account&sub=chars">');
                 }
             }
         }
     }
 } else {
     if ($action == 'changesex') {
         if (!$config['chars_changesex_enable']) {
             output_message('alert', 'Смена пола персонажей запрещена!' . '<meta http-equiv=refresh content="2;url=index.php?n=account&sub=chars">');