Guest User

Untitled

a guest
Feb 9th, 2014
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.41 KB | None | 0 0
  1. <?php
  2.  
  3. $query = $database->prepare("SELECT * FROM `mmo_accounts` WHERE `Username` = ?"); // Gets all the information about the player.
  4.  
  5. $query->bindValue(1, $userData['Username']);
  6.  
  7. try
  8. {
  9. $query->execute();
  10.  
  11. $row = $query->fetch();
  12.  
  13. $Playername= $row["Username"]; // Gets the username of the player and put it in the variable $Playername.
  14. $Money=$row["pLevel"]; // Gets the money of the player and put it in the variable $Money.
  15. $Kills=$row["pCurrentEXP"]; // Gets the score of the player and put it in the variable $Kills.
  16. $Deaths =$row["pHP"];
  17. $level=$row["pMP"];
  18. $dlevel=$row["pDamage"];
  19. $rwon = $row["pResistance"];
  20. $rlost = $row["pLuck"];
  21. $skin = $row["pSkinID"];
  22.  
  23. $im = @imagecreatefrompng('../signature/image.png') or die("ERROR: Inform the administrator."); // Don't forget to put your picture there.
  24. $text_color = imagecolorallocate($im, 197,197,199);// RED, GREEN, BLUE --> Go to www.colorpicker.com, select a nice color. Copy the R/G/B letters provided by colorpicker and put them here.
  25. $white = imagecolorallocate($im, 255, 255, 255);
  26. $Playername = strtoupper($Playername);
  27. $text_username = "$Playername"; // This gets the information about player name to be showed in the picture.
  28. $text_kills = "Kills: $Kills"; // Same as above ^^
  29. $text_money = "Cash: $$Money"; // Same as above ^^
  30. $text_deaths = "Deaths: $Deaths";
  31. $text_rwon = "Rounds won: $rwon";
  32. $text_rlost = "Rounds lost: $rlost";
  33. $text_god = "(Ban hammer guy)";
  34.  
  35. $fontname = '../signature/FarCry.TTF';
  36.  
  37. if($level > 0 )
  38. $text_alevel = "Admin: Yes";
  39. else $text_alevel = "Admin: No";
  40. if($dlevel > 0 )
  41. {
  42. $text_dlevel = "Donator: Yes";
  43. }
  44. else $text_dlevel = "Donator: No";
  45. $skinS = "../resources/Skins/Skin_$skin.png";
  46.  
  47. $skinImg = @imagecreatefrompng($skinS);//Create picture of players skin in signature
  48.  
  49. $font = '../signature/font.ttf'; //Upload your custum font to the directory where this file is placed. Then change the name here.
  50. /* USAGE OF THE imagettftext: First ($im) shouldn't be changed. (16) is the text-size. (0) is the angle of your text. Change it, and you'll see what's going on. (20) is de X-coordinate of the text.
  51. (36) is the Y-coordinate of the text. */
  52. imagettftext($im, 22, 0, 61, 43 , $white, $fontname, $text_username);
  53. if($level > 0 )
  54. {
  55. imagettftext($im, 22, 0, 240, 43 , $text_color, $font, $text_god);
  56. imagettftext($im, 22, 0, 241, 44 , $text_color, $font, $text_god);
  57. }
  58. imagettftext($im, 22, 0, 60, 42 , $text_color, $fontname, $text_username); // Prints the username in the picture. // Prints the score in the picture.
  59. imagettftext($im, 16, 0, 230, 72 , $text_color, $font, $text_kills);
  60. imagettftext($im, 16, 0, 230, 102 , $text_color, $font, $text_deaths);
  61. imagettftext($im, 16, 0, 230, 132 , $text_color, $font, $text_rwon);
  62.  
  63. imagettftext($im, 16, 0, 365, 72 , $text_color, $font, $text_alevel);
  64. imagettftext($im, 16, 0, 365, 102, $text_color, $font, $text_dlevel);
  65. imagettftext($im, 16, 0, 365, 132 , $text_color, $font, $text_rlost);
  66. imagettftext($im, 16, 0, 365, 162 , $text_color, $font, $text_money); // Prints the money in the picture.
  67.  
  68. imagecopymerge($im, $skinImg, 505, 56,0,0,55,99,100);
  69.  
  70. ob_start();
  71.  
  72. imagepng($im);
  73.  
  74. $stringdata = ob_get_contents();
  75.  
  76. ob_end_clean();
  77.  
  78. imagedestroy($im);
  79. }
  80.  
  81. catch( PDOException $e )
  82. {
  83. echo $e->getMessage();
  84. }
  85.  
  86. ?>
Advertisement
Add Comment
Please, Sign In to add comment