Hier hast ein Ansatz 
<?php
function imageTTFTextRight($im, $fontSize, $angle, $y, $color, $font, $text) {
$dimensions = imagettfbbox($fontSize, $angle, $font, $text);
$textWidth = abs($dimensions[4] - $dimensions[0]);
$x = imagesx($im) - 20 - $textWidth;
ImageTTFText ($im, $fontSize, $angle, $x, $y, $color, $font, $text);
}
mysql_connect("localhost","root","");
mysql_select_db("blabla");
$sql = mysql_query("SELECT username,Admin FROM `blabla` WHERE `Admin` > '1' ");
if(mysql_num_rows($sql) >= 1)
{
$im = imagecreatetruecolor(250, mysql_num_rows($sql) * 40 ); // 40 wird für jeden spieler eingerechnet.
$almostblack = imagecolorallocate($im,254,254,254);
imagefill($im,0,0,$almostblack);
imagecolortransparent($im,$almostblack);
$black = imagecolorallocate($im,0,0,0);
$font = "AGENCYR.TTF";
$id = 1;
while($userinfo = mysql_fetch_array($sql)) {
ImageTTFText($im, 14, 0, 20, $id * 40, $black, $font, $userinfo["username"]);
imageTTFTextRight($im, 14, 0, $id * 40, $black, $font, $userinfo["username"]);
$id++;
}
header("Content-Type: image/png");
imagepng($im);
imagedestroy($im);
}
else
{
return 0;
}
?>
Alles anzeigen
Musste natürlich alles anpassen usw.