Jump to content
  • 0

pomoc Nejde Vygenerovať url samp status


Marcelko

Dotaz

Nejde Vygenerovať get url statusu samp som to Spravil Url: http://gamehost.eu.nu/server.html . Ide tam všetko len okrem nejde <a href''><img ''> Toto len nejde Vygenerovať tu je PHP: obr.php

 

<?php

 

if ((isset($_GET[ipadresa]))and(isset($_GET[port]))) {

 

header("Content-type: image/png"); // MAME OBRAZOK

 

$ip= $_GET[ipadresa];

 

$port= $_GET[port];

 

$sirka = 360; // SIRKA OBRAZKU

 

$vyska = 96; // VYSKA OBRAZKU

 

$obrazok = ImageCreate ($sirka,$vyska); // VYPIS OBRAZKU

 

$farba_pozadia = ImageColorAllocate ($obrazok, 0, 0, 0); // 0 = cierna

 

$color = ImageColorAllocate($obrazok, 255, 255, 255); // farba pisma 1

 

$color_jakub = ImageColorAllocate ($obrazok, 102, 102, 102); // to iste co pred tym ale ina farba

 

$fp = @fsockopen('udp://' . $ip, $port, $errno, $errstr, 1);

 

 

 

if (!$fp)

 

{

 

ImageString($obrazok, 3, 50, 45, "Error: $errno - $errstr", $color);

 

}

 

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));

 

ImageString ($obrazok, 4, 5, 5, "$hostname", $color);

 

ImageString($obrazok, 3, 5, 32, "IP: $ip:$port", $color);

 

ImageString($obrazok, 3, 5, 46, "Players: $plr_count/$max_plrs", $color);

 

ImageString($obrazok, 3, 5, 61, "GameMode: $gamemode", $color);

 

ImageString($obrazok, 2, 265, 80, "super-portal.eu", $color_jakub);

 

if ($is_passworded)

 

{

 

ImageString($obrazok, 3, 5, 76, "Password: Yes", $color);

 

}

 

else

 

{

 

ImageString($obrazok, 3, 5, 76, "Password: No", $color);

 

}

 

fwrite($fp, $packet.'c');

 

fread($fp, 11);

 

fclose($fp);

 

}

 

imagepng($obrazok);

 

imagedestroy($obrazok);

 

} else {

 

header("Content-type: image/png");

 

$obrazok = ImageCreate (360,96); // VYPIS OBRAZKU

 

$farba_pozadia = ImageColorAllocate ($obrazok, 0, 0, 0); // 0 = cierna

 

$color = ImageColorAllocate($obrazok, 255, 255, 255); // farba pisma 1

 

ImageString($obrazok, 3, 50, 45, "Server nebol najdeny!", $color);

 

 

imagepng($obrazok);

 

imagedestroy($obrazok);

 

 

}

 

 

 

 

 

?>

Link to comment
Share on other sites

0 odpovědí na tuto otázku

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...