cawte,
Jak mam prosim vas udelat vycteni ze samp socketu dalsi kraviny ? toto my moc nejde tak bych potreboval radu ...mam to takto ( v echo je to co uz sem zjistil na precteni ) ...ale jak trebas prectu : gravity, weather, weburl, verzi samp, ping,worldtime ...? nevi my s tim nekdo pomoct jak to mam udelat ? dik .. tady je co mam ..
<?php
$ip = "server_ip";
$port = "server_port";
$fp = fsockopen('udp://' . $ip, $port, $errno, $errstr,0.0);
if (!$fp)
{
ImageString($img, 3, 50, 45, "Server Offline", $colorhost);
}
else
{
$packet = 'SAMP';
$packet .= chr(strtok($ip, '.'));
$packet .= chr(strtok('.'));
$packet .= chr(strtok('.'));
$packet .= chr(strtok('.'));
$packet .= chr($port & 0xFF);
$packet .= chr($port >> 8 & 0xFF);
fwrite($fp, $packet.'i');
fread($fp, 11);
$is_passworded = ord(fread($fp, 1));
$plr_count = ord(fread($fp, 2));
$max_plrs = ord(fread($fp, 2));
$strlen = ord(fread($fp, 4));
$hostname = htmlentities(fread($fp, $strlen));
$strlen = ord(fread($fp, 4));
$gamemode = htmlentities(fread($fp, $strlen));
$strlen = ord(fread($fp, 4));
$mapname = htmlentities(fread($fp, $strlen));
echo "nazev: $hostname";
echo "mod: $gamemode";
echo "online: $pls_count/$max_plrs";
echo "mapa: $mapname";
fwrite($fp, $packet.'c');
fread($fp, 11);
fclose($fp);
}
?>