• Rejestracja
vBHELP.pl - polskie wsparcie vBulletin
  1. #1
    fir3xpl jest nieaktywny Stały bywalec
    Dołączył
    Jun 2011
    Posty
    124
    Przydatne posty
    1

    Domyślnie imagettftext

    Kod:
    <?
    header("Content-type: image/png");
    putenv('GDFONTPATH=' . realpath('.')); 
    if(isset($_GET['k'])) $kolor = $_GET['k'];
    	else $kolor = "255.255.255";
    if(isset($_GET['t'])) $tlo = $_GET['t'];
    	else $tlo = "1";
    
    $image = imagecreatefrompng("tla/".$tlo.".png");
    $colorobr =ImageColorAllocate($image, "0", "0", "0");
    $c = explode('.', $kolor);
    $color =ImageColorAllocate($image, $c[0], $c[1], $c[2]);
    $ip = $_GET['i'];
    $port = $_GET['p'];
    $fp = fsockopen('udp://' . $ip, $port, $errno, $errstr);
    if (!$fp)
    {
    	imagettftext($image, 14, 0, 49, 18, $colorobr, "arial.ttf", "Blad");
    	imagettftext($image, 14, 0, 51, 18, $colorobr, "arial.ttf", "Blad");
    	imagettftext($image, 14, 0, 50, 17, $colorobr, "arial.ttf", "Blad");
    	imagettftext($image, 14, 0, 50, 19, $colorobr, "arial.ttf", "Blad");
    	imagettftext($image, 14, 0, 51, 17, $colorobr, "arial.ttf", "Blad");
    	imagettftext($image, 14, 0, 51, 19, $colorobr, "arial.ttf", "Blad");
    	imagettftext($image, 14, 0, 49, 17, $colorobr, "arial.ttf", "Blad");
    	imagettftext($image, 14, 0, 49, 19, $colorobr, "arial.ttf", "Blad");
    	imagettftext($image, 14, 0, 50, 18, $color, "arial.ttf", "Blad");
    }
    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);
    	#pakiety
    	$is_passworded = ord(fread($fp, 1));
    	$plr_count   = ord(fread($fp, 2));
    	$max_plrs   = ord(fread($fp, 2));
    	$strlen    = ord(fread($fp, 4));
    	$hostname   = fread($fp, $strlen);
    	$strlen    = ord(fread($fp, 4));
    	$gamemode   = fread($fp, $strlen);
    	$strlen    = ord(fread($fp, 4));
    	$mapname    = fread($fp, $strlen);
    	$colorobr = ImageColorAllocate($image, 0, 0, 0);
    	#hostname
    	imagettftext($image, 14, 0, 49, 18, $colorobr, "arial.ttf", $hostname);
    	imagettftext($image, 14, 0, 51, 18, $colorobr, "arial.ttf", $hostname);
    	imagettftext($image, 14, 0, 50, 17, $colorobr, "arial.ttf", $hostname);
    	imagettftext($image, 14, 0, 50, 19, $colorobr, "arial.ttf", $hostname);
    	imagettftext($image, 14, 0, 51, 17, $colorobr, "arial.ttf", $hostname);
    	imagettftext($image, 14, 0, 51, 19, $colorobr, "arial.ttf", $hostname);
    	imagettftext($image, 14, 0, 49, 17, $colorobr, "arial.ttf", $hostname);
    	imagettftext($image, 14, 0, 49, 19, $colorobr, "arial.ttf", $hostname);
    	imagettftext($image, 14, 0, 50, 18, $color, "arial.ttf", $hostname);
    	#ip
    	imagettftext($image, 10, 0, 5, 31, $colorobr, "visitor.ttf", "IP: ".$ip.":".$port);
    	imagettftext($image, 10, 0, 7, 31, $colorobr, "visitor.ttf", "IP: ".$ip.":".$port);
    	imagettftext($image, 10, 0, 6, 29, $colorobr, "visitor.ttf", "IP: ".$ip.":".$port);
    	imagettftext($image, 10, 0, 6, 31, $colorobr, "visitor.ttf", "IP: ".$ip.":".$port);
    	imagettftext($image, 10, 0, 7, 29, $colorobr, "visitor.ttf", "IP: ".$ip.":".$port);
    	imagettftext($image, 10, 0, 7, 31, $colorobr, "visitor.ttf", "IP: ".$ip.":".$port);
    	imagettftext($image, 10, 0, 5, 29, $colorobr, "visitor.ttf", "IP: ".$ip.":".$port);
    	imagettftext($image, 10, 0, 5, 31, $colorobr, "visitor.ttf", "IP: ".$ip.":".$port);
    	imagettftext($image, 10, 0, 6, 30, $color, "visitor.ttf", "IP: ".$ip.":".$port);
    	#gra
    	imagettftext($image, 10, 0, 239, 30, $colorobr, "visitor.ttf", "Gra: ".$mapname." (Sa-MP)");
    	imagettftext($image, 10, 0, 241, 30, $colorobr, "visitor.ttf", "Gra: ".$mapname." (Sa-MP)");
    	imagettftext($image, 10, 0, 240, 29, $colorobr, "visitor.ttf", "Gra: ".$mapname." (Sa-MP)");
    	imagettftext($image, 10, 0, 240, 31, $colorobr, "visitor.ttf", "Gra: ".$mapname." (Sa-MP)");
    	imagettftext($image, 10, 0, 241, 29, $colorobr, "visitor.ttf", "Gra: ".$mapname." (Sa-MP)");
    	imagettftext($image, 10, 0, 241, 31, $colorobr, "visitor.ttf", "Gra: ".$mapname." (Sa-MP)");
    	imagettftext($image, 10, 0, 239, 29, $colorobr, "visitor.ttf", "Gra: ".$mapname." (Sa-MP)");
    	imagettftext($image, 10, 0, 239, 31, $colorobr, "visitor.ttf", "Gra: ".$mapname." (Sa-MP)");
    	imagettftext($image, 10, 0, 240, 30, $color, "visitor.ttf", "Gra: ".$mapname." (Sa-MP)");
    	#haslo
    	if ($is_passworded)
    	{
    		imagettftext($image, 10, 0, 239, 40, $colorobr, "visitor.ttf", "Haslo: Tak");
    		imagettftext($image, 10, 0, 241, 40, $colorobr, "visitor.ttf", "Haslo: Tak");
    		imagettftext($image, 10, 0, 240, 39, $colorobr, "visitor.ttf", "Haslo: Tak");
    		imagettftext($image, 10, 0, 240, 41, $colorobr, "visitor.ttf", "Haslo: Tak");
    		imagettftext($image, 10, 0, 241, 39, $colorobr, "visitor.ttf", "Haslo: Tak");
    		imagettftext($image, 10, 0, 241, 41, $colorobr, "visitor.ttf", "Haslo: Tak");
    		imagettftext($image, 10, 0, 239, 39, $colorobr, "visitor.ttf", "Haslo: Tak");
    		imagettftext($image, 10, 0, 239, 41, $colorobr, "visitor.ttf", "Haslo: Tak");
    		imagettftext($image, 10, 0, 240, 40, $color, "visitor.ttf", "Haslo: Tak");
    	} 
    	else
    	{
    		imagettftext($image, 10, 0, 239, 40, $colorobr, "visitor.ttf", "Haslo: Nie");
    		imagettftext($image, 10, 0, 241, 40, $colorobr, "visitor.ttf", "Haslo: Nie");
    		imagettftext($image, 10, 0, 240, 39, $colorobr, "visitor.ttf", "Haslo: Nie");
    		imagettftext($image, 10, 0, 240, 41, $colorobr, "visitor.ttf", "Haslo: Nie");
    		imagettftext($image, 10, 0, 241, 39, $colorobr, "visitor.ttf", "Haslo: Nie");
    		imagettftext($image, 10, 0, 241, 41, $colorobr, "visitor.ttf", "Haslo: Nie");
    		imagettftext($image, 10, 0, 239, 39, $colorobr, "visitor.ttf", "Haslo: Nie");
    		imagettftext($image, 10, 0, 239, 41, $colorobr, "visitor.ttf", "Haslo: Nie");
    		imagettftext($image, 10, 0, 240, 40, $color, "visitor.ttf", "Haslo: Nie");
    	}
    	#gracze
    	imagettftext($image, 10, 0, 5, 40, $colorobr, "visitor.ttf", "Graczy: ".$plr_count."/".$max_plrs);
    	imagettftext($image, 10, 0, 7, 40, $colorobr, "visitor.ttf", "Graczy: ".$plr_count."/".$max_plrs);
    	imagettftext($image, 10, 0, 6, 39, $colorobr, "visitor.ttf", "Graczy: ".$plr_count."/".$max_plrs);
    	imagettftext($image, 10, 0, 6, 41, $colorobr, "visitor.ttf", "Graczy: ".$plr_count."/".$max_plrs);
    	imagettftext($image, 10, 0, 7, 39, $colorobr, "visitor.ttf", "Graczy: ".$plr_count."/".$max_plrs);
    	imagettftext($image, 10, 0, 7, 41, $colorobr, "visitor.ttf", "Graczy: ".$plr_count."/".$max_plrs);
    	imagettftext($image, 10, 0, 5, 39, $colorobr, "visitor.ttf", "Graczy: ".$plr_count."/".$max_plrs);
    	imagettftext($image, 10, 0, 5, 41, $colorobr, "visitor.ttf", "Graczy: ".$plr_count."/".$max_plrs);
    	imagettftext($image, 10, 0, 6, 40, $color, "visitor.ttf", "Graczy: ".$plr_count."/".$max_plrs);
    	#mapa
    	imagettftext($image, 10, 0, 5, 50, $colorobr, "visitor.ttf", "Mapa: ".$gamemode);
    	imagettftext($image, 10, 0, 7, 50, $colorobr, "visitor.ttf", "Mapa: ".$gamemode);
    	imagettftext($image, 10, 0, 6, 49, $colorobr, "visitor.ttf", "Mapa: ".$gamemode);
    	imagettftext($image, 10, 0, 6, 51, $colorobr, "visitor.ttf", "Mapa: ".$gamemode);
    	imagettftext($image, 10, 0, 7, 49, $colorobr, "visitor.ttf", "Mapa: ".$gamemode);
    	imagettftext($image, 10, 0, 7, 51, $colorobr, "visitor.ttf", "Mapa: ".$gamemode);
    	imagettftext($image, 10, 0, 5, 49, $colorobr, "visitor.ttf", "Mapa: ".$gamemode);
    	imagettftext($image, 10, 0, 5, 51, $colorobr, "visitor.ttf", "Mapa: ".$gamemode);
    	imagettftext($image, 10, 0, 6, 50, $color, "visitor.ttf", "Mapa: ".$gamemode);
    	#strona
    	###############################################################################
    	$strona = "FullParty.xaa.pl";
    	###############################################################################
    	imagettftext($image, 10, 0, 344, 57, $colorobr, "visitor.ttf", $strona);
    	imagettftext($image, 10, 0, 346, 57, $colorobr, "visitor.ttf", $strona);
    	imagettftext($image, 10, 0, 345, 56, $colorobr, "visitor.ttf", $strona);
    	imagettftext($image, 10, 0, 345, 58, $colorobr, "visitor.ttf", $strona);
    	imagettftext($image, 10, 0, 346, 56, $colorobr, "visitor.ttf", $strona);
    	imagettftext($image, 10, 0, 346, 58, $colorobr, "visitor.ttf", $strona);
    	imagettftext($image, 10, 0, 344, 56, $colorobr, "visitor.ttf", $strona);
    	imagettftext($image, 10, 0, 344, 58, $colorobr, "visitor.ttf", $strona);
    	imagettftext($image, 10, 0, 345, 57, $color, "visitor.ttf", $strona);
    	#end tekstów
    	imagealphablending($image, false);
    	imagesavealpha($image, true);
    	imagepng($image);
    	ImageDestroy($image);
    	fclose($fp);
    }
    ?>
    Mam coś takiego :
    http://fullparty.xaa.pl/tracker/s.ph...&k=255.255.255

    A chciałbym żeby te info było jedno pod drugim. Jak to pozmieniać?



  2. #2
    Awatar WoG
    WoG
    WoG jest nieaktywny vB Specialist
    Dołączył
    Feb 2008
    Posty
    2 812
    Przydatne posty
    298
    Wpisów
    1

    Domyślnie

    Link do skryptu, który podałeś nic nie zwraca.
    Czekam na poprawny link
    Z poważaniem,
    WoG

    Ty też możesz pomóc spolszczać vBulletin 5: GitHub.com
    "Rozczarowanie spowodowane niską jakością pamięta się długo po przeminięciu radości spowodowanej niską ceną"


  3. #3
    fir3xpl jest nieaktywny Stały bywalec
    Dołączył
    Jun 2011
    Posty
    124
    Przydatne posty
    1

    Domyślnie

    Teraz już nie chodzi mi o przesunięcie , bo się z tym uporałem , lecz dodanie koloru do napisu : IP,GRACZE itp. Ale tylko do wybranych ten kolor , a nie całość. Więc może link nie będzie potrzebny , bo go już nie mam ;/


Chmurka.pl

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67