Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- # Skrypt, sprawdzający status serwera
- # Skrypt wykonał: SiteFuture - sitefuture - Strona główna | Facebook
- # Pobieranie konfiguracji
- require_once 'include/GameQ.php';
- # Czcionka
- define('Rajdhani', 'assets/fonts/Rajdhani-Regular.ttf');
- $ip = $_GET['ip'];
- if (isset($ip) && !empty($ip)) {
- $server = array(
- 'type' => 'csgo',
- 'host' => $ip
- );
- $gq = new GameQ();
- $gq->setOption('timeout', 5);
- $gq->setOption('debug', TRUE);
- $gq->setFilter('normalise');
- $gq->addServer($server);
- $results = $gq->requestData();
- $online = $results[$ip]['gq_online'];
- if($online !="1")
- {
- $hostname = 'Serwer '.$ip.' jest OFFLINE';
- $players = "x";
- $playersmax = "x";
- $map = "OFFLINE";
- }
- else
- {
- $hostname= $results[$ip]['gq_hostname'];
- $playersmax = $results[$ip]['gq_maxplayers'];
- $players = $results[$ip]['gq_numplayers'];
- $map = $results[$ip]['gq_mapname'];
- }
- $znaki = strlen($hostname);
- if($znaki < 45){
- $tekst = $hostname;
- }
- else{
- $liczba = 45 - $test2;
- $nazwa = substr($hostname, 0, $liczba);
- $tekst = ''.$nazwa.'...';
- }
- $im = imagecreatefrompng("assets/images/mirage.png");
- $white = imagecolorallocate($im, 255, 255, 255);
- $info = $ip ." ". $players ." / ". $playersmax ." ". $map;
- imagettftext($im, 13, 0, 28, 93, $white, Rajdhani);
- imagettftext($im, 13, 0, 28, 118, $white, Rajdhani, $info);
- } else {
- $im = imagecreatefrompng("obrazy/cs.png");
- $white = imagecolorallocate($im, 255, 255, 255);
- $info = "123.456:27015 31 / 32 de_inferno";
- imagettftext($im, 7, 0, 10, 15, $white, Rajdhani, "AceGo.pl [Only Mirage]");
- imagettftext($im, 7, 0, 10, 30, $white, Rajdhani, $info);
- }
- header('Content-type: image/png');
- imagepng($im);
- imagedestroy($im);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment