<?
if ($say) {
if ($say=='to') {
if ( $player["say"]>time() ) msg("Я те пофлужу! Я те пофлужу!!! Скажешь через ".($player["say"]-time())." сек.");
$player["say"] = time()+5;
if ($tran=='1') {
$c1eng = "ABCDEFGHIJKLMNOPRSTUVWXYZQabcdefghijklmnoprstuvwxyzq";
$c1rus = "АБЦДЕФГХИЖКЛМНОПРСТУВШЫЙЗЬабцдефгхижклмнопрстувшыйзь";
$search = array ("'QQ'","'qq'","'CSH'","'SH'","'CH'","'YA'","'YU'","'YE'","'csh'","'sh'","'ch'","'ya'","'yu'","'ye'");
$replace = array ("Ъ","ъ","Щ","Ш","Ч","Я","Ю","Э","щ","ш","ч","я","ю","э");
$skaz = preg_replace ($search, $replace, $skaz);
for ($i=0;$i<strlen($c1eng);$i++) $skaz=str_replace($c1eng{$i},$c1rus{$i},$skaz);
}
$s=$to.$skaz;
// UTF-8 русские буквы
$s=str_replace('\\',"",$s);
$s=str_replace('"',"",$s);
$s=str_replace("'","",$s);
$s=preg_replace('/(с|c)(у|y)(ч)?(к|k)(а|a)/i',"[мат]",$s);
$s=preg_replace('/пидор/i',"[мат]",$s);
$s=preg_replace('/пид(о|o|a|а)(р|p)(а|a)(з|c|с)/i',"[мат]",$s);
$s=preg_replace('/\w*(х|x)(у|y)\w*/i',"[мат]",$s);
$s=preg_replace('/\w*пизд\w*/i',"[мат]",$s);
$s=preg_replace('/\w*(е|e)б(а|a)\w*/i',"[мат]",$s);
$s=preg_replace('/\w*бля\w*/i',"[мат]",$s);
$s=str_replace("|","",$s);
$s=str_replace("<","",$s);
$s=str_replace(">","",$s);
$s=str_replace(".ru","",$s);
$s=str_replace(".org","",$s);
$s=str_replace(".net","",$s);
$s=str_replace(".com","",$s);
$s=str_replace(".ua","",$s);
$skaz=substr($s,0,250);
// добавим всем, включая себя, в журнал что сказали
if ($player["ban"]) msg("ВАШ ЧАТ ЗАБАНЕН!!!"); else
if (!$player["ghost"]) addjournalall($player["loc"],$player["title"]." говорит $tosp: ".$skaz);
else foreach (array_keys($game["loc"][$player["loc"]]) as $i) if (substr($i,0,5)=='user.'){
$skills=split("\|",$game["loc"][$player["loc"]][$i]["skills"]);
if (rand(0,100)<=$skills[21]*20) addjournal($i,$player["title"]." говорит:".$skaz);
else {
$stmp = preg_replace("/[A-ZА-Я]/","O",$skaz);
$stmp = preg_replace("/[a-zа-я]/","o",$stmp);
addjournal($i,$player["title"].": ".$stmp);
}
}
}
}
?>