Thread: Banning players
View Single Post
Old 27.06.2007, 14:42   #12
Guaresnay
Архивный участник
 
Join Date: Oct 2005
Posts: 113
Default

PHP Code:
<?
function DisableCharacterPacket($char_id, $status){
    include(
"config.php"); // which include cached info
    
$buf=pack("cVV",20,$char_id,$status).tounicode("admin");
    
$cachedsocket=@fsockopen($cached['host'],$cached['port'],$errno,$errstr,1) or die($notconnected);
    
fwrite($cachedsocket,pack("s",(strlen($buf)+2)).$buf);
    
$len=unpack("v",fread($cachedsocket,2));
    
$rid=unpack("c",fread($cachedsocket,1));
        for(
$i=0;$i<(($len[1]-4)/4);$i++){
            
$read=unpack("i",fread($cachedsocket,4));$rs.=$read[1];
        }
    
fclose($cachedsocket);
    return 
GetError($rs); // GetError func is the errors array
}
?>
Guaresnay is offline