CS 1.6
PHP скрипт
Код:
<?php if (!defined('BLOCK_FILE')) { Header("Location: ../index.php"); exit; } $server="217.24.113.205"; //сдесь ip сервера $qw=chr(32); $fp = fsockopen ("udp://".$server,"27015"); if (!$fp) { echo "ERROR: $errno - $errstr<br>\n"; } else { fwrite($fp,"\377\377\377\377details".chr(10)); $st=fread($fp,1); $r=socket_get_status($fp); $r=$r["unread_bytes"]; $st.=fread($fp,$r); fclose($fp); $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)); } $show_map="<img align=\"center\" src=http://localhost/images/CS_maps/".$map.".jpg width=\"140\" height=\"120\" >"; $content=(" <br> <table width=\"101%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" bgcolor=\"#FFFFFF\"> <tr> <td bgcolor=\"#FFFFFF\" width=\"60\"><b><font color=\"#8c7952\">Карта:</font></b></td> <td bgcolor=\"#FFFFFF\"><b><font color=\"#8c7952\">$map</font></b></td> </table> <table width=\"101%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" bgcolor=\"#FFFFFF\"> </tr> <td bgcolor=\"#FFFFFF\" rowspan=\"7\" align=\"center\"><center><font color=\"#8c7952\">$show_map</font></center></td> </table> <table width=\"101%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" bgcolor=\"#FFFFFF\"> <tr> <td bgcolor=\"#FFFFFF\" width=\"60\"><b><font color=\"#8c7952\">Играет:</font></b></td> <td bgcolor=\"#FFFFFF\"><b><font color=\"#8c7952\">$current / $max </font></b></td> </tr> </table> <head> <!-- HEAD START HERE --> <script language=\"JavaScript\"> <!-- function winop() { windop = window.open(\"http://games.usinsknet.ru/stat/cs/hlstat/index.php?mode=live_stats&server=1\",\"mywin\" ,\"height=450,width=300 ,scrollbars=yes\"); } --> </script> <!-- HEAD END HERE --> </head> <body bgcolor=\"#EDEDED\" text=\"#FFFFFF\" link=\"#000000\" topmargin=\"0\" leftmargin=\"0\"> <center> <!-- BODY START HERE --> <a href=\"javascript:winop();\"><b><font color=\"blue\">Кто играет ?</font></b></a> "); if($current==0){$content= "<table width=\"101%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" bgcolor=\"FFFFFF\"> <tr> <td colspan=\"1\"><center><b>Сервер в данный момент пуст!</b></center></td> </tr> </table>"; $content .= "<table border=\"0\"><tr valign=\"middle\"><td><img src=\"images/CS_maps/cstrike_grenade.jpg\" border=\"0\"></td><td></td></tr></table>"; } $fp = fsockopen ("udp://".$server,"27015"); if (!$fp) { echo "ERROR: $errno - $errstr<br>\n"; } else { fwrite($fp,"\377\377\377\377players".chr(10)); $st=fread($fp,1); $r=socket_get_status($fp); $r=$r["unread_bytes"]; $st.=fread($fp,$r); fclose($fp); $playersn=ord(substr($st,5,1)); $st=substr($st,6); if ($playersn !=0 ) Echo("</body></html>"); } ?>