<?php header( \"Content-type: image/png\" ); if( !isset( $ip ) ) { $ip = \"87.229.103.208\"; } if( !isset( $port ) ) { $port = \"7857\"; } $udp = fsockopen( \'udp://\'. $ip, $port, $errno, $errstr ); $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( $udp, $packet.\'i\' ); fread ( $udp, 11 ); $is_passworded = ord( fread( $udp, 1 ) ); $plr_count = ord( fread( $udp, 2 ) ); $max_plrs = ord( fread( $udp, 2 ) ); $strlen = ord ( fread( $udp, 4 ) ); $hostname = fread( $udp, $strlen ); $strlen = ord ( fread( $udp, 4 ) ); $gamemode = fread( $udp, $strlen ); $strlen = ord ( fread( $udp, 4 ) ); $mapname = fread( $udp, $strlen ); fwrite( $udp, $packet.\'c\' ); fread ( $udp, 11 ); $image = imagecreatefrompng( \"image.png\" ); $white = imagecolorallocate( $image, 255, 255, 255 ); $grey = imagecolorallocate( $image, 180, 180, 180 ); $green = imagecolorallocate( $image, 0, 180, 0 ); if( $udp ) { if( !$is_passworded ) { imagettftext( $image, \'8\', 0, 25, 35, $white, \"font.ttf\", $hostname ); imagettftext( $image, \'7\', 0, 25, 49, $grey, \"font.ttf\", \"Players: \".$plr_count.\"/\".$max_plrs.\", Gamemode: \".$gamemode ); imagettftext( $image, \'6\', 0, 25, 65, $grey, \"font.ttf\", \"Mapname: \".$mapname ); } else { imagettftext( $image, \'8\', 0, 25, 35, $white, \"font.ttf\", $hostname.\" ( Lezárva )\" ); imagettftext( $image, \'7\', 0, 25, 49, $grey, \"font.ttf\", \"Players: \".$plr_count.\"/\".$max_plrs.\", Gamemode: \".$gamemode ); imagettftext( $image, \'6\', 0, 25, 65, $grey, \"font.ttf\", \"Mapname: \".$mapname ); } } else { imagettftext( $image, \'7\', 0, 30, 47, $white, \"font.ttf\", \"Szerver nem elérhetõ.\" ); } imagepng( $image ); ?>
<?php header( \"Content-type: image/png\" ); if( !isset( $ip ) ) { $ip = \"87.229.103.208\"; } if( !isset( $port ) ) { $port = \"7857\"; } $udp = fsockopen( \'udp://\'. $ip, $port, $errno, $errstr ); $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( $udp, $packet.\'i\' ); fread ( $udp, 11 ); $is_passworded = ord( fread( $udp, 1 ) ); $plr_count = ord( fread( $udp, 2 ) ); $max_plrs = ord( fread( $udp, 2 ) ); $strlen = ord ( fread( $udp, 4 ) ); $hostname = fread( $udp, $strlen ); $strlen = ord ( fread( $udp, 4 ) ); $gamemode = fread( $udp, $strlen ); $strlen = ord ( fread( $udp, 4 ) ); $mapname = fread( $udp, $strlen ); fwrite( $udp, $packet.\'c\' ); fread ( $udp, 11 ); $image = imagecreatefrompng( \"imagebig.png\" ); $white = imagecolorallocate( $image, 255, 255, 255 ); $grey = imagecolorallocate( $image, 180, 180, 180 ); $green = imagecolorallocate( $image, 0, 180, 0 ); if( $udp ) { if( !$is_passworded ) { imagettftext( $image, \'8\', 0, 100, 15, $white, \"font.ttf\", $hostname ); imagettftext( $image, \'8\', 0, 110, 45, $white, \"font.ttf\", \"Játékosok: \".$plr_count.\"/\".$max_plrs ); imagettftext( $image, \'8\', 0, 110, 61, $white, \"font.ttf\", \"Játékmód: \".$gamemode ); imagettftext( $image, \'8\', 0, 110, 77, $white, \"font.ttf\", \"Pályanév: \".$mapname ); } else { imagettftext( $image, \'8\', 0, 100, 15, $white, \"font.ttf\", $hostname.\" ( Lezárva )\" ); imagettftext( $image, \'8\', 0, 103, 45, $white, \"font.ttf\", \"Játékosok: \".$plr_count.\"/\".$max_plrs ); imagettftext( $image, \'8\', 0, 103, 61, $white, \"font.ttf\", \"Játékmód: \".$gamemode ); imagettftext( $image, \'8\', 0, 103, 77, $white, \"font.ttf\", \"Pályanév: \".$mapname ); } } else { imagettftext( $image, \'8\', 0, 100, 15, $white, \"font.ttf\", \"Szerver nem elérhetÅ?.\" ); } imagepng( $image ); ?>