nick7() functions replaced by nick class
This commit is contained in:
+34
-34
@@ -49,7 +49,7 @@ class TTournament {
|
||||
for($j=1;$j<=($kol-$cop);$j++){
|
||||
$res=mysql_fetch_row($uch);
|
||||
mysql_query("delete from turnamuser where id=".$res[0]);
|
||||
addchp ('<font color=red>Внимание!</font> На этой неделе Вам не нашлелся противник в турнире.<BR>','{[]}'.nick7 ($res[1]).'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font> На этой неделе Вам не нашлелся противник в турнире.<BR>','{[]}'.nick::id($res[1])->short().'{[]}');
|
||||
}
|
||||
mysql_query("update turnament set kolvo=kolvo-".($kol-$cop)." where old=0 and level=".$i);
|
||||
break;
|
||||
@@ -66,15 +66,15 @@ class TTournament {
|
||||
$user1=$CountUser[$ii];
|
||||
$user2=$CountUser[++$ii];
|
||||
mysql_query("insert into turnirbattle(userid,userid1,level,idtur) values(".$user1.",".$user2.",".$i.",(select id from turnament where old=0 and level=".$i."))");
|
||||
addchp ('<font color=red>Внимание!</font> Подготовтесь к турниру.<BR>','{[]}'.nick7 ($user1).'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font> Подготовтесь к турниру.<BR>','{[]}'.nick7 ($user2).'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font> Подготовтесь к турниру.<BR>','{[]}'.nick::id($user1)->short().'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font> Подготовтесь к турниру.<BR>','{[]}'.nick::id($user2)->short().'{[]}');
|
||||
}
|
||||
}
|
||||
else{
|
||||
//Если команда не набралась удалить из таблицы и поставить турниру статус 2
|
||||
while ($res=mysql_fetch_row($uch)){
|
||||
mysql_query("delete from turnamuser where id=".$res['0']);
|
||||
addchp ('<font color=red>Внимание!</font>На этой неделе команда для турнира не набралась.<BR>','{[]}'.nick7 ($res[1]).'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>На этой неделе команда для турнира не набралась.<BR>','{[]}'.nick::id($res[1])->short().'{[]}');
|
||||
}
|
||||
mysql_query("delete from turnament where old=0 and level=".$i);
|
||||
}
|
||||
@@ -88,31 +88,31 @@ class TTournament {
|
||||
if ((time()-$res['badmaxweap1'])>120){
|
||||
mysql_query("update turnamuser set loose=2, place=".time()." where iduser=".$user1." and idturnam=".$res['idtur']);
|
||||
mysql_query("delete from turnirbattle where userid1=".$user1);
|
||||
addchp ('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>','{[]}'.nick7 ($user1).'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>','{[]}'.nick7 ($user2).'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>','{[]}'.nick::id($user1)->short().'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>','{[]}'.nick::id($user2)->short().'{[]}');
|
||||
}
|
||||
}elseif ($res['userid']==$user2 && $res['badmaxweap']!=0){
|
||||
if ((time()-$res['badmaxweap'])>120){
|
||||
mysql_query("update turnamuser set loose=2, place=".time()." where iduser=".$user2." and idturnam=".$res['idtur']);
|
||||
mysql_query("delete from turnirbattle where userid=".$user2);
|
||||
addchp ('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>','{[]}'.nick7 ($user2).'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>','{[]}'.nick7 ($user1).'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>','{[]}'.nick::id($user2)->short().'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>','{[]}'.nick::id($user1)->short().'{[]}');
|
||||
}
|
||||
}
|
||||
elseif ($res['userid']==$user1 && $res['badmaxweap']!=0){
|
||||
if ((time()-$res['badmaxweap'])>120){
|
||||
mysql_query("update turnamuser set loose=2, place=".time()." where iduser=".$user1." and idturnam=".$res['idtur']);
|
||||
mysql_query("delete from turnirbattle where userid=".$user1);
|
||||
addchp ('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>','{[]}'.nick7 ($user1).'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>','{[]}'.nick7 ($user2).'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>','{[]}'.nick::id($user1)->short().'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>','{[]}'.nick::id($user2)->short().'{[]}');
|
||||
}
|
||||
}
|
||||
elseif ($res['userid1']==$user2 && $res['badmaxweap1']!=0 ){
|
||||
if ((time()-$res['badmaxweap1'])>120){
|
||||
mysql_query("update turnamuser set loose=2, place=".time()." where iduser=".$user2." and idturnam=".$res['idtur']);
|
||||
mysql_query("delete from turnirbattle where userid1=".$user2);
|
||||
addchp ('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>','{[]}'.nick7 ($user2).'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>','{[]}'.nick7 ($user1).'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>','{[]}'.nick::id($user2)->short().'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>','{[]}'.nick::id($user1)->short().'{[]}');
|
||||
}
|
||||
}
|
||||
else{
|
||||
@@ -129,14 +129,14 @@ class TTournament {
|
||||
mysql_query("update turnirbattle set badmaxweap=".time()." , checkuser=0 where userid=".$user1);
|
||||
if ($res['userid1']==$user1)
|
||||
mysql_query("update turnirbattle set badmaxweap1=".time()." , checkuser2=0 where userid1=".$user1);
|
||||
addchp ('<font color=red>Внимание!</font>Оставьте оружие только до 16экр или оставьте только оружие.<BR>','{[]}'.nick7 ($user1).'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Оставьте оружие только до 16экр или оставьте только оружие.<BR>','{[]}'.nick::id($user1)->short().'{[]}');
|
||||
}
|
||||
elseif ($PriceWeap1[0]>16 || $Shmotuser1['sergi']!=0 || $Shmotuser1['kulon']!=0 || $Shmotuser1['perchi']!=0 || $Shmotuser1['bron']!=0 || $Shmotuser1['r1']!=0 || $Shmotuser1['r2']!=0 || $Shmotuser1['r3']!=0 || $Shmotuser1['helm']!=0 || $Shmotuser1['shit']!=0 || $Shmotuser1['boots']!=0 || $Shmotuser1['stats']!=0 || $Shmotuser1['m1']!=0 || $Shmotuser1['m2']!=0 || $Shmotuser1['m3']!=0 || $Shmotuser1['m4']!=0 || $Shmotuser1['m5']!=0 || $Shmotuser1['m6']!=0 || $Shmotuser1['m7']!=0 || $Shmotuser1['m8']!=0 || $Shmotuser1['m9']!=0 || $Shmotuser1['m10']!=0){
|
||||
if ($res['userid']==$user2)
|
||||
mysql_query("update turnirbattle set badmaxweap=".time()." , checkuser=0 where userid=".$user2);
|
||||
if ($res['userid1']==$user2)
|
||||
mysql_query("update turnirbattle set badmaxweap1=".time()." , checkuser2=0 where userid1=".$user2);
|
||||
addchp ('<font color=red>Внимание!</font>Оставьте оружие только до 16экр или оставьте только оружие.<BR>','{[]}'.nick7 ($user2).'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Оставьте оружие только до 16экр или оставьте только оружие.<BR>','{[]}'.nick::id($user2)->short().'{[]}');
|
||||
}
|
||||
else{
|
||||
// генерим массив с командами
|
||||
@@ -156,7 +156,7 @@ class TTournament {
|
||||
mysql_query("UPDATE `users` SET `battle` = {$id} WHERE `id` = ".$user1." OR `id` = ".$user2);
|
||||
// создаем лог
|
||||
$rr = "<b>".nick::id($user['id'])->full(1)."</b> и <b>".nick::id($jert['id'])->full(1)."</b>";
|
||||
addch ("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <B><b>".nick7($user['id'])."</b> и <b>".nick7($jert['id'])."</b> начался. ",$user['room']);
|
||||
addch ("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <B><b>".nick::id($user['id'])->short()."</b> и <b>".nick::id($jert['id'])->short()."</b> начался. ",$user['room']);
|
||||
addlog($id,"Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." решили выяснить кто из них сильнее. <i>(турнир)</i><BR>");
|
||||
return $id;
|
||||
}
|
||||
@@ -217,7 +217,7 @@ class TTournament {
|
||||
@shuffle($CountUser);
|
||||
|
||||
if (count($ArrayUsers)==1) $CheckFinal[]=$ArrayUsers[0];
|
||||
if (count($ArrayUsers)==1 && $i==0) addchp ('<font color=red>Внимание!</font> Вы вышли в финал. Дождитесь второго финалиста.<BR>','{[]}'.nick7 ($ArrayUsers[0]).'{[]}');
|
||||
if (count($ArrayUsers)==1 && $i==0) addchp ('<font color=red>Внимание!</font> Вы вышли в финал. Дождитесь второго финалиста.<BR>','{[]}'.nick::id($ArrayUsers[0])->short().'{[]}');
|
||||
|
||||
if ($this->fract(count($ArrayUsers)/2)!=false)
|
||||
$countUs=count($ArrayUsers)-1;
|
||||
@@ -230,8 +230,8 @@ class TTournament {
|
||||
//Востанавливаем HP
|
||||
mysql_query("update users set hp=maxhp where id=".$user1." or id=".$user2);
|
||||
mysql_query("insert into turnirbattle(userid,userid1,level,idtur) values(".$user1.",".$user2.",".$level.",(select id from turnament where old=0 and level=".$level."))");
|
||||
addchp ('<font color=red>Внимание!</font> Подготовтесь к следующему туру.<BR>','{[]}'.nick7 ($user1).'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font> Подготовтесь к следующему туру.<BR>','{[]}'.nick7 ($user2).'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font> Подготовтесь к следующему туру.<BR>','{[]}'.nick::id($user1)->short().'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font> Подготовтесь к следующему туру.<BR>','{[]}'.nick::id($user2)->short().'{[]}');
|
||||
}
|
||||
}
|
||||
if (count($CheckFinal)==2) $this->TournirFinal($level,$CheckFinal);
|
||||
@@ -258,7 +258,7 @@ class TTournament {
|
||||
while ($res=mysql_fetch_array($sql)){
|
||||
if ($i==1 || $i==2 || $i==3){
|
||||
mysql_query("INSERT INTO `delo`(`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','".$res['iduser']."','Выиграл в турнире ".$Priz[$i][$level]." кр.','1','".time()."');");
|
||||
addchp ('<font color=red>Внимание!</font> За '.$i.' место в турнире, Вы получили '.$Priz[$i][$level].' кр.<BR>','{[]}'.nick7 ($res['iduser']).'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font> За '.$i.' место в турнире, Вы получили '.$Priz[$i][$level].' кр.<BR>','{[]}'.nick::id($res['iduser'])->short().'{[]}');
|
||||
}
|
||||
fwrite($f, '<tr><td>'.$res['login'].'</td><td>'.$i++.'</td></tr>');
|
||||
|
||||
@@ -290,8 +290,8 @@ class TTournament {
|
||||
function TournirFinal($level,$masFinals){
|
||||
mysql_query("update turnamuser set place=0 where (iduser=".$masFinals[0]." or iduser=".$masFinals[1].") and idturnam=(select id from turnament where old=0 and level=".$level.")");
|
||||
mysql_query("insert into turnirbattle(userid,userid1,level,idtur) values(".$masFinals[0].",".$masFinals[1].",".$level.",(select id from turnament where old=0 and level=".$level."))");
|
||||
addchp ('<font color=red>Внимание!</font> Подготовтесь к финалу.<BR>','{[]}'.nick7 ($masFinals[0]).'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font> Подготовтесь к финалу.<BR>','{[]}'.nick7 ($masFinals[1]).'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font> Подготовтесь к финалу.<BR>','{[]}'.nick::id($masFinals[0])->short().'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font> Подготовтесь к финалу.<BR>','{[]}'.nick::id($masFinals[1])->short().'{[]}');
|
||||
}
|
||||
|
||||
function expectationenemy(){
|
||||
@@ -309,8 +309,8 @@ class TTournament {
|
||||
if ((time()-$res['badmaxweap'])>120){
|
||||
mysql_query("update turnamuser set loose=2, place=".time()." where iduser=".$res['userid']." and idturnam=".$res['idtur']);
|
||||
mysql_query("delete from turnirbattle where userid=".$res['userid']);
|
||||
addchp ('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>','{[]}'.nick7 ($res['userid']).'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>','{[]}'.nick7 ($res['userid1']).'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>','{[]}'.nick::id($res['userid'])->short().'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>','{[]}'.nick::id($res['userid1'])->short().'{[]}');
|
||||
}
|
||||
}
|
||||
if ($res['userid1']==$user['id'] && $res['checkuser2']==0 && $res['badmaxweap1']==0){
|
||||
@@ -324,8 +324,8 @@ class TTournament {
|
||||
if ((time()-$res['badmaxweap1'])>120){
|
||||
mysql_query("update turnamuser set loose=2, place=".time()." where iduser=".$res['userid']." and idturnam=".$res['idtur1']);
|
||||
mysql_query("delete from turnirbattle where userid1=".$res['userid1']);
|
||||
addchp ('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>','{[]}'.nick7 ($res['userid1']).'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>','{[]}'.nick7 ($res['userid']).'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>','{[]}'.nick::id($res['userid1'])->short().'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>','{[]}'.nick::id($res['userid'])->short().'{[]}');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -343,7 +343,7 @@ class TTournament {
|
||||
mysql_query("update turnirbattle set badmaxweap=".time()." , checkuser=0 where userid=".$user['id']);
|
||||
if ($res['userid1']==$user['id'] && $res['badmaxweap1']==0)
|
||||
mysql_query("update turnirbattle set badmaxweap1=".time()." , checkuser2=0 where userid1=".$user['id']);
|
||||
addchp ('<font color=red>Внимание!</font>Оставьте оружие только до 16экр или оставьте только оружие.<BR>','{[]}'.nick7 ($user['id']).'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Оставьте оружие только до 16экр или оставьте только оружие.<BR>','{[]}'.nick::id($user['id'])->short().'{[]}');
|
||||
}
|
||||
else{
|
||||
if ($res['userid']==$user['id']){
|
||||
@@ -361,16 +361,16 @@ class TTournament {
|
||||
if ((time()-$res['badmaxweap1'])>120){
|
||||
mysql_query("update turnamuser set loose=2, place=".time()." where iduser=".$res['userid1']." and idturnam=".$res['idtur']);
|
||||
mysql_query("delete from turnirbattle where userid1=".$res['userid1']);
|
||||
addchp ('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>','{[]}'.nick7 ($res['userid1']).'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>','{[]}'.nick7 ($res['userid']).'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>','{[]}'.nick::id($res['userid1'])->short().'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>','{[]}'.nick::id($res['userid'])->short().'{[]}');
|
||||
}
|
||||
}
|
||||
if($res['badmaxweap']!=0){
|
||||
if ((time()-$res['badmaxweap'])>120){
|
||||
mysql_query("update turnamuser set loose=2, place=".time()." where iduser=".$res['userid']." and idturnam=".$res['idtur']);
|
||||
mysql_query("delete from turnirbattle where userid=".$res['userid']);
|
||||
addchp ('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>','{[]}'.nick7 ($res['userid']).'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>','{[]}'.nick7 ($res['userid1']).'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>','{[]}'.nick::id($res['userid'])->short().'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>','{[]}'.nick::id($res['userid1'])->short().'{[]}');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -386,8 +386,8 @@ class TTournament {
|
||||
if ((time()-$res['badmaxweap'])>120){
|
||||
mysql_query("update turnamuser set loose=2, place=".time()." where iduser=".$res['userid']." and idturnam=".$res['idtur']);
|
||||
mysql_query("delete from turnirbattle where userid=".$res['userid']);
|
||||
addchp ('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>','{[]}'.nick7 ($res['userid']).'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>','{[]}'.nick7 ($res['userid1']).'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>','{[]}'.nick::id($res['userid'])->short().'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>','{[]}'.nick::id($res['userid1'])->short().'{[]}');
|
||||
}
|
||||
else echo "<form method='post'><input type='submit' name='expenemy' value='Я готов'> противник ".nick::id($res['useridl'])->full(1)."(поражений-".$looseL1[0].")</form>";
|
||||
}
|
||||
@@ -402,8 +402,8 @@ class TTournament {
|
||||
if ((time()-$res['badmaxweap1'])>120){
|
||||
mysql_query("update turnamuser set loose=2, place=".time()." where iduser=".$res['userid1']." and idturnam=".$res['idtur']);
|
||||
mysql_query("delete from turnirbattle where userid1=".$res['userid1']);
|
||||
addchp ('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>','{[]}'.nick7 ($res['userid1']).'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>','{[]}'.nick7 ($res['userid']).'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>','{[]}'.nick::id($res['userid1'])->short().'{[]}');
|
||||
addchp ('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>','{[]}'.nick::id($res['userid'])->short().'{[]}');
|
||||
}
|
||||
else echo "<form method='post'><input type='submit' name='expenemy' value='Я готов'>противник ".nick::id($res['userid'])->full(1)."(поражений-".$looseL[0].")</form>";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user