Advertisement
LawyerMorty

Untitled

May 1st, 2014
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. <?php
  2. // The script is created by Jarno Sulmann (a.k.a Pilovali/pity123)
  3. // Contact: jarnosulmann@gmail.com
  4. // All rights reserved. Created on: 1-5-2014
  5.  
  6. // if the image won't load proper, put a // before the header to show the error
  7. header ("Content-type: image/png");
  8.  
  9. // Turn off error reporting, so the fucking script does not show notices
  10. error_reporting(0);
  11.  
  12. // Image create shit
  13. $imgname = "background.png";
  14. $im = @imagecreatefrompng ($imgname);
  15.  
  16. // Create some colors
  17. $white = imagecolorallocate($im, 255, 255, 255);
  18. $grey = imagecolorallocate($im, 128, 128, 128);
  19. $black = imagecolorallocate($im, 0, 0, 0);
  20.  
  21. // MySQL
  22. $base = mysql_connect ('127.0.0.1', 'u247734055_***', '*******');
  23. mysql_select_db ('u247734055_***', $base);
  24.  
  25. $sql = 'SELECT * FROM accounts';
  26. $req = mysql_query($sql);
  27. while($data = mysql_fetch_array($req)){
  28. $playername = $data['player'];
  29. $cash = $data['cash'];
  30.  
  31. // You can use any .tff font
  32. $font = './font.ttf';
  33. //$cash = 5000;
  34. $money = 'Money: $'.number_format($cash);
  35.  
  36. // The text here, there are 2 one is for shadow.
  37. // imagettftext(image, font size, angle, x, y, color, font, "text");
  38. imagettftext($im, 24, 0, 4, 22, $black, $font, "gti");
  39. imagettftext($im, 24, 0, 6, 22, $white, $font, "gti");
  40. imagettftext($im, 18, 0, 175, 32, $black, $font, $money);
  41. imagettftext($im, 18, 0, 177, 32, $white, $font, $money);
  42.  
  43. // Some stuff
  44. imagepng($im);
  45. imagedestroy($im);
  46. mysql_close();
  47. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement