Файл: world-faces.ru/world-faces.ru/chat/inc/barmen.php
Строк: 23
<?php
include_once 'bar.php';
$botB = new barmen($user['alcohol'], $user['posts'], $user['id'], $user['pol']);
$zps = 'УуУуф, сЁтА я НаЖрАл'.($user['pol']==1?'Ся':'АсЬ').'.. Ик..Ик..Ик..';
if ($user['alcohol'] > $botB->config['ik'] && (time() - $botB->config['ik_time']) > $_SESSION['last_ik_bot']) {
mysql_query("INSERT INTO `chat_post` (`id_user`, `time`, `msg`, `room`, `privat`) values('$user[id]', '$time', '$zps', '$room[id]', 0)");
$_SESSION['last_ik_bot'] = time();
}
if ($user['alcohol'] && (time() - $botB->config['time']) > $_SESSION['bot_cron']) {
$user['alcohol'] = $user['alcohol'] ? ($user['alcohol'] - $botB->config['percentage']) : 0;
if (0 > $user['alcohol']) $user['alcohol'] = 0;
mysql_query("UPDATE user SET alcohol ='".abs((int)$user['alcohol'])."' WHERE id='".abs((int)$user['id'])."'");
$_SESSION['bot_cron'] = time();
}
switch ($botB->analysis($msg)) {
case '1':
$mess = '[b]' . $user['nick'] . '[/b], ' . $botB->youDrunk();
mysql_query("INSERT INTO `chat_post` (`barmen`, `time`, `msg`, `room`, `privat`) values('1', '$time', '$mess', '$room[id]', 0)");
break;
case '2':
$mess = '[b]' . $user['nick'] . '[/b], У тебя не достаточно Постов!';
mysql_query("INSERT INTO `chat_post` (`barmen`, `time`, `msg`, `room`, `privat`) values('1', '$time', '$mess', '$room[id]', 0)");
break;
case '3':
mysql_query("UPDATE user SET `posts`='".$botB->posts."', `alcohol`='".$botB->alcohol."' WHERE id ='$user[id]' LIMIT 1");
$_SESSION['bot_cron'] = time();
$tost = !$botB->eda ? '[b]Тост:[/b] ' . $botB->toast() : '';
$mess = "[b]" . $user['nick'] . "[/b], заказал".($user['pol']==0?'a':'')." " . $botB->team . ". Заказ выполнен.".$tost;
mysql_query("INSERT INTO `chat_post` (`barmen`, `time`, `msg`, `room`, `privat`) values('1', '$time', '$mess', '$room[id]', 0)");
break;
}
$msg = $botB->msg;
?>