самый просто :
<?PHP
$server="79.165.189.224";
$port='27015';
$map_images_path='/mon/maps/';
// hl new query part
$qw=chr(32);
$fp = fsockopen ("udp://".$server,$port);
if (!$fp)
{
echo "ERROR: $errno - $errstr<br>\n";
}
else
{
fwrite($fp,"\xFF\xFF\xFF\xFFTSource Engine Query\x00");
$st=fread($fp,1);
if (!$st)
{
echo("<b>Сервер отключен</b>");
$address=$server.$port;
$max="0";
$current="0";
$name="Unknown";
$map="unknownmap";
}
else
{
$r=socket_get_status($fp);
$r=$r["unread_bytes"];
$st.=fread($fp,$r);
$st=substr($st,5);
$address=SubStr($st,0,StrPos($st,chr(0)));
$address=str_replace(chr(0),"|",$address);
$st=SubStr($st,StrPos($st,chr(0))+1);
$name=SubStr($st,0,StrPos($st,chr(0)));
$st=SubStr($st,StrPos($st,chr(0))+1);
$map=SubStr($st,0,StrPos($st,chr(0)));
$st=SubStr($st,StrPos($st,chr(0))+1);
$st=SubStr($st,StrPos($st,chr(0))+1);
$st=SubStr($st,StrPos($st,chr(0))+1);
$current=ord(SubStr($st,0,1));
$max=ord(SubStr($st,1,1));
};
};
fclose($fp);
$fp = fsockopen ("udp://".$server,$port);
if (!$fp)
{
echo "ERROR: $errno - $errstr<br>\n";
}
else
{
fwrite($fp,"\xFF\xFF\xFF\xFFW\x00".chr(10));
$st=fread($fp,1);
if ($st)
{
$r=socket_get_status($fp);
$r=$r["unread_bytes"];
$st.=fread($fp,$r);
$sbstr=substr($st,5,5);
fwrite($fp,"\xFF\xFF\xFF\xFFU".$sbstr."\x00".chr(10));
$st=fread($fp,1);
if ($st)
{
$r=socket_get_status($fp);
$r=$r["unread_bytes"];
$st.=fread($fp,$r);
$playersn=ord(substr($st,5,1));
$st=substr($st,6);
if (file_exists("/mon/maps/".$map.".jpg")) $show_map = "<img src=\"/mon/maps/".$map.".jpg\">";
else $show_map = "<img src=\"/mon/maps/$map.jpg\">";
echo("<body> \n \n");
echo(" <table>\n\n");
echo(" <tr>\n");
echo(" <table border=1 borderColor=#E6E9EA cellspacing=0 cellpadding=0 >\n\n");
echo(" <td width=\"85\"><b>Сервер:</b></td><td width=\"180\">".$name."</td>\n");
echo(" </tr>\n");
echo(" <tr>\n");
echo(" <td width=\"85\"><b>IP:</b></td><td>".$address."</td>\n");
echo(" </tr>\n");
echo(" <tr>\n");
echo(" <td width=\"85\"><b>Карта:</b></td><td>".$map."</td>\n");
echo(" </tr>\n");
echo(" <tr>\n");
echo(" <td width=\"85\"><b>Игроков:</b></td><td>".$current."/".$max."</td>\n");
echo(" </tr>\n\n");
echo(" </table>\n\n");
echo("<br> <p>$show_map</p><br>\n\n");
echo(" <table border=1 borderColor=#E6E9EA cellspacing=0 cellpadding=0 >\n\n");
echo(" <tr>\n");
echo(" <td align=\"center\" width=\"15\">#</td>\n");
echo(" <td align=\"center\" width=\"250\"><b>Имя игрока</b></td>\n");
echo(" <td align=\"center\" width=\"70\"><b>Фрагов</b></td>\n");
echo(" </tr>\n");
for ($i=1;$i<=$playersn;$i++)
{
$n=ord(substr($st,0,1));
$st=substr($st,1);
$name=SubStr($st,0,StrPos($st,chr(0)));
$kills=ord(substr($st,StrPos($st,chr(0))+1,1));
if ($kills==255){$kills=-1;}
if ($kills==254){$kills=-2;}
if ($kills==253){$kills=-3;}
if ($kills==252){$kills=-4;}
$st=substr($st,StrPos($st,chr(0)));
$st=substr($st,9);
echo(" <tr>\n");
echo(" <td width=\"15\">$n</td>\n");
echo(" <td width=\"250\"> $name</td>\n");
echo(" <td align=\"center\" width=70>$kills</td>\n");
echo(" </tr>\n");
};
echo("\n </table>\n\n");
echo("</body>\n");
};
};
};
fclose($fp);
?>