Thank you very much for answering!
With this function you can do, I only need to add the turn of the subjob0_class, as I do?
function setCharacterData2($char_id, $genderId, $raceId, $classId, $faceId, $hairShapeId, $hairColorId)
{
global $cached_errors, $admin_name;
global $cached_ip, $cached_port;
$buf=pack("cVVVVVVV", 0x10, $char_id, $genderId, $raceId, $classId, $faceId, $hairShapeId, $hairColorId).tounicode_UA($admin_name);
$cachedsocket=@fsockopen($cached_ip, $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 $rs;
}