Файл: region_clean/umnikmat2.php
Строк: 133
<?
#######################################
## Mod By KoT (borispol) [76-75-072] ##
#######################################
require_once 'inc.php';
$a = mysql_query("Select * from vopros where klu4='2'");
$b = mysql_fetch_array($a);
$nom = $b['number'];
$vr = $b['time'];
$answ = $b['answer'];
$tran = $b['tran'];
#$amsg = rus_to_k($msg); //сообщение
#$kansw = rus_to_k($answ); //сообщение = ответу
$amsg = $msg; //сообщение
$kansw = $answ; //сообщение = ответу
$p = intval($p);
///////////////////////////////////
$selBOT = mysql_fetch_array(mysql_query("SELECT `user` FROM `users` WHERE `id`='8'"));
$b1 = mysql_fetch_array(mysql_query("SELECT `user` FROM `users` WHERE `id`='1'"));
$b2 = mysql_fetch_array(mysql_query("SELECT `user` FROM `users` WHERE `id`='2'"));
$b3 = mysql_fetch_array(mysql_query("SELECT `user` FROM `users` WHERE `id`='3'"));
$b4 = mysql_fetch_array(mysql_query("SELECT `user` FROM `users` WHERE `id`='4'"));
$b5 = mysql_fetch_array(mysql_query("SELECT `user` FROM `users` WHERE `id`='5'"));
$b6 = mysql_fetch_array(mysql_query("SELECT `user` FROM `users` WHERE `id`='6'"));
$b7 = mysql_fetch_array(mysql_query("SELECT `user` FROM `users` WHERE `id`='7'"));
$b9 = mysql_fetch_array(mysql_query("SELECT `user` FROM `users` WHERE `id`='9'"));
$sozd = mysql_fetch_array(mysql_query("SELECT `user` FROM `users` WHERE `id`='10'"));
$result = substr($msg, 0, 3);
if ($result == "fas") {
$stsus = mysql_escape_string(substr($msg, 4));
$stsus = substr($msg,4,strlen($msg)-4);
$a = mysql_query("Select credits from users where user='".mysql_real_escape_string($stsus)."'");
$st = getmicrotime();
$today = date ("H:i");
$rnd = mt_rand(0,99999999);
if (mysql_num_rows($a) == 0) {
$message = '<b>'.$us.'</b>, уебок, такого ника не существует...';
mysql_query ("Insert into room11 set klu4= '".$rnd."', time='".$today."', who='".$uus."', message='".$message."', id='".$st."', towhom='', hid='0', usid='".$uid."'");
} elseif (empty($stsus)) {
$message = '<b>'.$us.'</b>, ты не ввел ник, дебил!';
mysql_query ("Insert into room11 set klu4= '".$rnd."', time='".$today."', who='".$uus."', message='".$message."', id='".$st."', towhom='', hid='0', usid='".$uid."'");
} else {
if ($stsus == $selBOT[0]) {
$message = '<b>'.$us.'</b>, а не охуел? я сам на себя наезжать не собираюсь!';
mysql_query ("Insert into room11 set klu4= '".$rnd."', time='".$today."', who='".$uus."', message='".$message."', id='".$st."', towhom='', hid='0', usid='".$uid."'");
} elseif ($stsus == $b1[0] or $stsus == $b2[0] or $stsus == $b3[0] or $stsus == $b4[0] or $stsus == $b5[0] or $stsus == $b6[0] or $stsus == $b7[0] or $stsus == $b9[0]) {
$message = '<b>'.$us.'</b>, вообще-то я на друзей не наезжаю, не трогай бота!';
mysql_query ("Insert into room11 set klu4= '".$rnd."', time='".$today."', who='".$uus."', message='".$message."', id='".$st."', towhom='', hid='0', usid='".$uid."'");
} elseif ($stsus == $sozd['user']) {
$message = '<b>'.$us.'</b>, иди в задницу, сука опущенная! '.$sozd['user'].' это создатель чата, мудила!';
mysql_query ("Insert into room11 set klu4= '".$rnd."', time='".$today."', who='".$uus."', message='".$message."', id='".$st."', towhom='', hid='0', usid='".$uid."'");
} else {
$sql = mysql_query("SELECT * FROM `bot_dialog` ORDER BY RAND() LIMIT 1;");
$bad_answer = mysql_result($sql, 0, 'message');
$message = "$stsus, $bad_answer";
mysql_query ("Insert into room11 set klu4= '".$rnd."', time='".$today."', who='".$uus."', message='".$message."', id='".$st."', towhom='', hid='0', usid='".$uid."'");
}
}
}
///////////////////////////////////
if ($msg == "!вопрос" or $msg == "!vopros") {
$r = mysql_query("select * from vopros where klu4='2'");
$a = mysql_fetch_array($r);
$vp = $a['question'];
$otvet = $a['answer'];
if ($otvet != '') {
$i = $a ['number'];
if ($i != 5) {
$st = getmicrotime();
$today = date("H:i");
$a = mysql_query("Select posts from users where id='".$uid."'");
$b = mysql_fetch_array($a);
$p = $b['posts'];
$p++;
mysql_query("Update users set posts='".$p."', onl='".$st."', room='11' where id ='".$uid."'");
$rnd = mt_rand(0,99999999);
mysql_query("Insert into room11 set klu4= '".$rnd."', time='".$today."', who='".$uus."', message='".$us.", ".$vp."', id='".$st."', towhom='', hid='0', usid='".$uid."', komu=''");
}
} else {
$vp = $us . ', блять! Для тупых повторяю: время вышло! Жди следующего вопроса!';
$st = getmicrotime();
$today = date("H:i");
$a = mysql_query("Select posts from users where id='".$uid."'");
$b = mysql_fetch_array($a);
$p = $b['posts'];
$p++;
mysql_query("Update users set posts='".$p."', onl='".$st."', room='11' where id ='".$uid."'");
$rnd = mt_rand(0,99999999);
mysql_query("Insert into room11 set klu4= '".$rnd."', time='".$today."', who='".$uus."', message='".$vp."', id='".$st."', towhom='', hid='0', usid='".$uid."', komu=''");
}
}
$s = mb_substr($msg,0,5);
if (($s == "stats") and (strlen($msg) > 6)) {
$stsus = substr($msg,6,strlen($msg)-6);
$a = mysql_query("Select credits from users where user='".mysql_real_escape_string($stsus)."'");
if (mysql_affected_rows() != 0) {
$st = getmicrotime();
$today = date ("H:i");
$b = mysql_fetch_array($a);
$i = $b['credits'];
$a = mysql_query("Select user from users order by credits desc LIMIT 101");
$j = 1;
$b = mysql_fetch_array($a);
while (($b['user'] != $stsus) and ($j <= 100)) {
$b = mysql_fetch_array($a);
$j++;
}
if ($j <= 31) {
if ($row['sex'] == "М") $mes = "Уёбище ".col_n($stsus)." успешно отсосало ".$i." хуев, и оно занимает в рейтинге хуесосов ".$j." место.";
else $mes = "Уёбище ".col_n($stsus)." успешно отсосало ".$i." хуев, и оно занимает в рейтинге хуесосов ".$j." место.";
} else {
if ($row['sex'] == "М") $mes = "В рейтинге этот гандон занимает место за пределами первых трех десятков хуюмников.";
else $mes = "В рейтинге эта сука занимает место за пределами первых трех десятков хуюмников.";
}
$rnd = mt_rand(0,99999999);
if ($towhom == $uid) $th = $id; else $th = '';
mysql_query("Insert into room11 set klu4= '".$rnd."', time='".$today."', who='".$uus."', message='".$mes."', id='".$st."', towhom='".$th."', hid='0', usid='".$uid."'");
$a = mysql_query("Select posts from users where id='".$uid."'");
$b = mysql_fetch_array($a);
$p = $b['posts'];
$p++;
mysql_query("Update users set posts='".$p."', onl='".$st."', room='11' where id ='".$uid."'");
} else {
$st = getmicrotime();
$today = date("H:i");
$mes = 'Хуюмника с ником '.$stsus.' нет в базе данных!';
$rnd = mt_rand(0,99999999);
if ($towhom == $uid) $th = $id; else $th = '';
mysql_query ("Insert into room11 set klu4= '".$rnd."', time='".$today."', who='".$uus."', message='".$mes."', id='".$st."', towhom='".$th."', hid='0', usid='".$uid."', komu=''");
$a = mysql_query("Select posts from users where id='".$uid."'");
$b = mysql_fetch_array($a);
$p = $b['posts'];
$p++;
mysql_query ("Update users set posts='".$p."', onl='".$st."', room='11' where id ='".$uid."'");
}
}
$agent = htmlentities(addslashes($HTTP_USER_AGENT));
if (((strpos($agent,"M3Gate") !== false) or (strpos($agent,"Opera") !== false) or (strpos($agent,"emulator") !== false) or (strpos($agent,"WinWAP") !== false) or (strpos($agent,"Wapsilon") !== false) or (strpos($agent,"Mozilla") !== false) or (strpos($agent,"M3GATE") !== false)) and ($rm == 0) and ($set['vict'] == 0)) {
#$search = mb_stripos($amsg, $answ, 0, 'UTF8');
#if ($search !== false or $amsg == $tran and $nom != 5) {
$amsg = trim(strip_tags($amsg));
$amsg = preg_replace("/[(.*)] /", "", $amsg);
if (($amsg == $kansw or $amsg == $tran) and $nom != 5) {
$st = time();
$today = date("H:i");
$mes = "Вы великолепно отсосали хуй. Но у хуесосов отвечающих с компа ответы не засчитываются.";
$rnd = mt_rand(0,99999999);
mysql_query ("Insert into room11 set klu4= '".$rnd."', time='".$today."', who='".$uus."', message='".$mes."', id='".$st."', towhom='".$id."', hid='".$id."', usid='".$uid."', komu='".$us."'");
}
} else {
#$search = mb_stripos($amsg, $answ, 0, 'UTF8');
#if ($search !== false or $amsg == $tran and $nom != 5) {
$amsg = trim(strip_tags($amsg));
$amsg = preg_replace("/[(.*)] /", "", $amsg);
if (($amsg == $kansw or $amsg == $tran) and $nom != 5) {
$st = time();
$victint = $set['victint'];
$st = $st + $victint;
if ($victint == 10) $interval = "10 секунд";
elseif ($victint == 30) $interval = "30 секунд";
elseif ($victint == 60) $interval = "минуту";
else $interval = "2 минуты";
mysql_query("Update vopros set number = '5', time = '".$st."', answer = ' ', tran = ' ' WHERE klu4 ='2'");
$a = mysql_query("Select posts from users where id='".$uid."'");
$b = mysql_fetch_array($a);
$p = $b['posts'];
$p++;
mysql_query("Update users set posts='".$p."', onl='".$st."', room='11' where id ='".$uid."'");
$a = mysql_query("Select posts from users where id='".$uid."'");
$b = mysql_fetch_array($a);
$p = $b['posts'];
$p++;
mysql_query("Update users set posts='".$p."', onl='".$st."', room='11' where id ='".$uid."'");
$p = $row['credits'];
$p++;
mysql_query("Update users set credits='".$p."' where id ='".$id."'");
$st = getmicrotime();
$today = date("H:i");
$mes = rand(1,2);
$mes = str_replace(1,"Заебись, ".col_n($us)."! Ты хуйнул в тему, баклан! ".col_n($us)." виртуозно отсосал ".$p." хуёв! Следующий вопрос, когда я вас всех выебу.",$mes);
$mes = str_replace(2,"Ну ты ".col_n($us)." и ботаник. Что типа умный? Дай другим ответить гандон. Следующий вопрос через ".$interval.".",$mes);
$mes = str_replace(3,'', $mes);
$mes = str_replace(4,'', $mes);
$mes = str_replace(5,'', $mes);
$mes = str_replace(6,'', $mes);
$mes2 = $mes;
$rnd = mt_rand(0,99999999);
mysql_query ("Insert into room11 set klu4= '".$rnd."', time='".$today."', who='".$uus."', message='".$mes2."', id='".$st."', towhom='".$towhom."', hid='0', usid='".$uid."', komu=''");
}
}
?>