Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $query = $database->prepare("SELECT * FROM `mmo_accounts` WHERE `Username` = ?"); // Gets all the information about the player.
- $query->bindValue(1, $userData['Username']);
- try
- {
- $query->execute();
- $row = $query->fetch();
- $Playername= $row["Username"]; // Gets the username of the player and put it in the variable $Playername.
- $Money=$row["pLevel"]; // Gets the money of the player and put it in the variable $Money.
- $Kills=$row["pCurrentEXP"]; // Gets the score of the player and put it in the variable $Kills.
- $Deaths =$row["pHP"];
- $level=$row["pMP"];
- $dlevel=$row["pDamage"];
- $rwon = $row["pResistance"];
- $rlost = $row["pLuck"];
- $skin = $row["pSkinID"];
- $im = @imagecreatefrompng('../signature/image.png') or die("ERROR: Inform the administrator."); // Don't forget to put your picture there.
- $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.
- $white = imagecolorallocate($im, 255, 255, 255);
- $Playername = strtoupper($Playername);
- $text_username = "$Playername"; // This gets the information about player name to be showed in the picture.
- $text_kills = "Kills: $Kills"; // Same as above ^^
- $text_money = "Cash: $$Money"; // Same as above ^^
- $text_deaths = "Deaths: $Deaths";
- $text_rwon = "Rounds won: $rwon";
- $text_rlost = "Rounds lost: $rlost";
- $text_god = "(Ban hammer guy)";
- $fontname = '../signature/FarCry.TTF';
- if($level > 0 )
- $text_alevel = "Admin: Yes";
- else $text_alevel = "Admin: No";
- if($dlevel > 0 )
- {
- $text_dlevel = "Donator: Yes";
- }
- else $text_dlevel = "Donator: No";
- $skinS = "../resources/Skins/Skin_$skin.png";
- $skinImg = @imagecreatefrompng($skinS);//Create picture of players skin in signature
- $font = '../signature/font.ttf'; //Upload your custum font to the directory where this file is placed. Then change the name here.
- /* 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.
- (36) is the Y-coordinate of the text. */
- imagettftext($im, 22, 0, 61, 43 , $white, $fontname, $text_username);
- if($level > 0 )
- {
- imagettftext($im, 22, 0, 240, 43 , $text_color, $font, $text_god);
- imagettftext($im, 22, 0, 241, 44 , $text_color, $font, $text_god);
- }
- imagettftext($im, 22, 0, 60, 42 , $text_color, $fontname, $text_username); // Prints the username in the picture. // Prints the score in the picture.
- imagettftext($im, 16, 0, 230, 72 , $text_color, $font, $text_kills);
- imagettftext($im, 16, 0, 230, 102 , $text_color, $font, $text_deaths);
- imagettftext($im, 16, 0, 230, 132 , $text_color, $font, $text_rwon);
- imagettftext($im, 16, 0, 365, 72 , $text_color, $font, $text_alevel);
- imagettftext($im, 16, 0, 365, 102, $text_color, $font, $text_dlevel);
- imagettftext($im, 16, 0, 365, 132 , $text_color, $font, $text_rlost);
- imagettftext($im, 16, 0, 365, 162 , $text_color, $font, $text_money); // Prints the money in the picture.
- imagecopymerge($im, $skinImg, 505, 56,0,0,55,99,100);
- ob_start();
- imagepng($im);
- $stringdata = ob_get_contents();
- ob_end_clean();
- imagedestroy($im);
- }
- catch( PDOException $e )
- {
- echo $e->getMessage();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment