Файл: in4at/umnik2.php
Строк: 90
<?php
##################################################################################################
## Script name : In4at ##
## Version : Final ##
## Made by : XPYCT(Сергей Мищенко) ##
## E-mail : bce-ok@bk.ru ##
## ICQ : 447-50-50-62 ##
## Site : http://vkontakte.ru/id31604521 ##
## Внимание! Скрипт распространяется бесплатно! Модификация W4at by XPYCT ##
##################################################################################################
Error_Reporting(0);
if ($amsg=='!вопрос'||$amsg=='!vopros'){
$r = mysql_query("select * from vopros");
$a = mysql_fetch_array($r);
$vp = $a ['question'];
$vp = '<u>'.$vp.'</u>';
$i = $a ['number'];
if ($i!=5){
$st = getmicrotime();
$today = date("H:i");
$rnd = rand(0,99999999);
$rs = '<br/><u>Вопрос: </u> ';
mysql_query("Insert into room0 set klu4= '".$rnd."', time='".$today."', who='".$umnik."', message='".$rs."".$vp."', id='".$st."', towhom='', hid='0', usid='2'");
}
}
if ($amsg=='!ответ'||$amsg=='!otvet'){
$la = mysql_fetch_array(mysql_query("select lastanswer from vopros"));
$st = getmicrotime();
$today = date("H:i");
$rnd = rand(0,99999999);
$lasw = '<br/>Ответ на прошлый вопрос был: <u>'.$la["lastanswer"].'</u>.';
mysql_query("Insert into room0 set klu4= '".$rnd."', time='".$today."', who='".$umnik."', message='".$lasw."', id='".$st."', towhom='', hid='0', usid='2'");
}
$s = substr ($amsg,0,5);
if (($s == 'stats'||$s == 'статс')&&(strlen($amsg) > 6)){
$stsus = substr ($amsg,6,strlen($amsg)-6);
$a = mysql_query("Select credits from users where user='".$stsus."' LIMIT 1;");
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)&&($j <= 100)) {$b = mysql_fetch_array($a);$j++;}
if ($j<=100) $s= '<br/>И он занимает в рейтинге '.$j.' место.';
else $s = '<br/>И его место в рейтинге за пределами первой сотни.';
$mes = '<br/>У пользователя '.$stsus.' '.$i.' правильных ответов. '.$s;
$rnd = rand(0,99999999);
mysql_query("Insert into room0 set klu4= '".$rnd."', time='".$today."', who='".$umnik."', message='".$mes."', id='".$st."', towhom='', hid='0', usid='2'");
} else {
$st = getmicrotime();
$today = date("H:i");
$mes = '<br/>Игрока с ником '.$stsus.' нет в базе данных!';
$rnd = rand(0,99999999);
mysql_query("Insert into room0 set klu4= '".$rnd."', time='".$today."', who='".$umnik."', message='".$mes."', id='".$st."', towhom='', hid='0', usid='2'");
}
}
$setting = mysql_query("Select victint,vict from setting where klu4=1");
$set = mysql_fetch_array($setting);
$agent = $HTTP_USER_AGENT;
if (((strpos ($agent,'M3Gate') !== false)||(strpos ($agent,'Opera') !== false)||(strpos ($agent,'emulator') !== false)||(strpos ($agent,'WinWAP') !== false)||(strpos ($agent,'Wapsilon') !== false)||(strpos ($agent,'M3GATE') !== false))&&($rm==0)&&($set['vict'] == 0)){
if ((substr_count($amsg, '$kansw')!=0)&&$nom!=5){
$st = time();
$today = date("H:i");
$mes = '<br/>'.$us.'! Вы правильно ответили на этот вопрос. Но с компа ответы не засчитываются.';
$rnd = rand(0,99999999);
mysql_query("Insert into room0 set klu4= '".$rnd."', time='".$today."', who='".$umnik."', message='".$mes."', id='".$st."', towhom='".$id."', hid='".$id."', usid='2'");
}
}else{
if ((substr_count($amsg, $kansw)!=0)&&$nom!=5){
$st = getmicrotime();
$victint = $set["victint"];
$st = $st + $victint;
mysql_query("Update vopros set number = '5', time = '".$st."', answer = ' ', tran = ' ', lastanswer='".$answ."' WHERE klu4 ='1'");
$p = $row['credits'];
$o = $row['daya'];
$o2 = $row['daya']+1;
$p++;$o++;
mysql_query("Update users set credits='".$p."', daya='".$o."' where id ='".$id."' LIMIT 1;");
$st = getmicrotime();
$today = date("H:i");
$good=file('syst/goodumn.txt');
$vibor1=$good[rand(0,sizeof($good)-1)];
$vibor2=$good[rand(0,sizeof($good)-1)];
$vibor1 = str_replace("n", '', $vibor1);
$vibor2 = str_replace("n", '', $vibor2);
$vibor1 = str_replace("r", '', $vibor1);
$vibor2 = str_replace("r", '', $vibor2);
$mes = '<br/>'.$vibor1.', '.$us.'! '.$vibor2.'!!!';
$rnd = rand(0,99999999);
mysql_query("Insert into room0 set klu4= '".$rnd."', time='".$today."', who='".$umnik."', message='".$mes."', id='".$st."', towhom='".$id."', hid='".$id."', usid='2'");
$st = getmicrotime();
$today = date("H:i");
$la2 = mysql_fetch_array(mysql_query("select lastanswer from vopros"));
$mes = '<br/><u>'.$us.'</u> прaвильно отвечает на <u>'.$p.'</u> вопрос, сегодня на <u>'.$o2.'</u>! Правильный ответ: <u>'.$la2["lastanswer"].'</u>. Следующий вопрос через '.$victint.' секунд.';
$rnd = rand(0,99999999);
mysql_query("Insert into room0 set klu4= '".$rnd."', time='".$today."', who='".$umnik."', message='".$mes."', id='".$st."', towhom='', hid='0', usid='2'");
}
}
?>