Advertisement
Guest User

Untitled

a guest
Oct 28th, 2011
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. <?php
  2. header("Content-Type: image/gif");
  3.  
  4.  
  5.  
  6. $string= $_REQUEST['ip'];
  7. $split = explode('_',$string);
  8. $ip = $split[0];
  9. $port = $split[1];
  10.  
  11.  
  12. require("SampQueryAPI.php");
  13. $query = new SampQueryAPI($ip, $port);
  14.  
  15. if($query->isOnline())
  16. {
  17. $aInformation = $query->getInfo();
  18. $aServerRules = $query->getRules();
  19.  
  20. $hostname = $aInformation['hostname'];
  21. $players = $aInformation['players'].' / '.$aInformation['maxplayers'];
  22. $website = $aServerRules['weburl'];
  23. }
  24. else{
  25. $hostname='Server ist Offline';
  26. $players='Server ist Offline';
  27. $website='Server ist Offline';}
  28.  
  29. $im = imagecreatefrompng('sig/bg.png');
  30.  
  31. $white = imagecolorallocate($im, 255, 255, 255);
  32. $width = imagesx($im);
  33. $height = imagesy($im);
  34. $font = 5;
  35. $font2 = 3;
  36.  
  37. $leftTextPos = ( $width - imagefontwidth(5)*strlen($name)-30);
  38. $leftTextPos2 = ( $width - imagefontwidth(5)*strlen($gilde)-150);
  39. $leftTextPos3 = ( $width - imagefontwidth(5)*strlen($level)-150);
  40. $leftTextPos4 = ( $width - imagefontwidth(5)*strlen($rang)-150);
  41. $leftTextPos5 = ( $width - imagefontwidth(5)*strlen($reich)-150);
  42.  
  43. imagestring($im, $font2, "320", $height-135, $ip.':'.$port, $white);
  44. imagestring($im, $font2, "320", $height-100, $players, $white);
  45. imagestring($im, $font2, "320", $height-65, $website, $white);
  46. imagestring($im, $font, "10", $height-27, $hostname, $white);
  47. imagepng($im);
  48. imagedestroy($im);
  49. ?>
  50.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement