Advertisement
Guest User

Untitled

a guest
Apr 4th, 2016
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.64 KB | None | 0 0
  1. <?
  2.  
  3. error_reporting(E_ALL);
  4. $username=""; //Your MySQL Username.
  5. $password=""; // Your MySQL Pass.
  6. $database=""; // Your MySQL database.
  7. $host=""; // Your MySQL host. This is "localhost" or the IP specified by your hosting company.
  8.  
  9. $player_name=$_GET['player_name']; // This gets the player his name from the previous page.
  10.  
  11.  
  12.  
  13. mysql_connect($host,$username,$password); // Connection to the database.
  14. @mysql_select_db($database) or die( "Unable to select database. Be sure the databasename exists and online is."); //Selection of the database. If it can't read the database, it'll give an error.
  15.  
  16. /* To protect MySQL injection. */
  17. $player_name = stripslashes($player_name);
  18. $player_name = mysql_real_escape_string($player_name);
  19.  
  20.  
  21.  
  22. $query="SELECT * FROM zaidejai WHERE Name = '$player_name'"; // Gets all the information about the player.
  23. $result=mysql_query($query);
  24. $i=mysql_num_rows($result); // Here we are counting how many rows this result gives us.
  25.  
  26.  
  27. if ($i == 1) // If the user has been correct, then it'll give us 1 row. If its 1 row, then it'll proceed with the code.
  28. {
  29.  
  30. $Playername=mysql_result($result,0,"Name"); // Gets the username of the player and put it in the variable $Playername.
  31. $Money=mysql_result($result,0,"Money"); // Gets the money of the player and put it in the variable $Money.
  32. $Score=mysql_result($result,0,"Xp"); // Gets the score of the player and put it in the variable $Score.
  33. $Job=mysql_result($result,0,"darbas"); // Gets the score of the player and put it in the variable $Score.
  34. $adminas=mysql_result($result,0,"AdminLvl"); // Gets the score of the player and put it in the variable $Score.
  35. $vipas=mysql_result($result,0,"Vip"); // Gets the score of the player and put it in the variable $Score.
  36. $viptime=mysql_result($result,0,"viplaikas"); // Gets the score of the player and put it in the variable $Score.
  37. if( $vipas > 0 )
  38. {
  39. $vipux = "Yra( iki ".date('Y/m/d', $viptime)." )";
  40. }
  41. else
  42. {
  43. $vipux = "Nëra";
  44. }
  45. if( $adminas == 4 )
  46. {
  47. $adminaslvl = "Savininkas";
  48. }
  49. if( $adminas == 3 )
  50. {
  51. $adminaslvl = "III lygio";
  52. }
  53. if( $adminas == 2 )
  54. {
  55. $adminaslvl = "II lygio";
  56. }
  57. if( $adminas == 1 )
  58. {
  59. $adminaslvl = "I lygio";
  60. }
  61. if( $adminas == 0 )
  62. {
  63. $adminaslvl = "Nëra";
  64. }
  65. if( $Job == 0)
  66. {
  67. $darbas = "Bedarbis";
  68. }
  69. if( $Job == 1)
  70. {
  71. $darbas = "Policininkas";
  72. }
  73. if( $Job == 2)
  74. {
  75. $darbas = "Medikas";
  76. }
  77. if( $Job == 3)
  78. {
  79. $darbas = "Mechanikas";
  80. }
  81. if( $Job == 4)
  82. {
  83. $darbas = "Fûristas";
  84. }
  85. if( $Job == 5)
  86. {
  87. $darbas = "Taksistas";
  88. }
  89. if( $Job == 6)
  90. {
  91. $darbas = "Ðlavëjas";
  92. }
  93. if( $Job == 7)
  94. {
  95. $darbas = "Aras";
  96. }
  97. if( $Job == 8)
  98. {
  99. $darbas = "Ûkininkas";
  100. }
  101.  
  102. // Creating of the .png image.
  103. header('Content-Type: image/png');
  104.  
  105. $im = @imagecreatefrompng('sig.png') or die("Cannot select the correct image. Please contact the webmaster."); // Don't forget to put your picture there.
  106. $text_color = imagecolorallocate($im, 255,255,255); // RED, GREEN, BLUE --> Go to [url]www.colorpicker.com[/url], select a nice color. Copy the R/G/B letters provided by colorpicker and put them here.
  107. $text_username = "Vardas: "."$Playername"; // This gets the information about player name to be showed in the picture.
  108. $text_score = "Patirtis: "."$Score"."XP"; // Same as above ^^
  109. $text_money = "Pinigai: "."$Money"."$"; // Same as above ^^
  110. $text_job = "Darbas: "."$darbas"; // Same as above ^^
  111. $text_lastdate = "Admin: "."$adminaslvl"; // Same as above ^^
  112. $text_vip = "VIP: "."$vipux"; // Same as above ^^
  113. $font = 'arial.ttf';
  114. imagettftext($im, 10, 0, 30, 42, $text_color, $font, $text_username); // Prints the username in the picture.
  115. imagettftext($im, 10, 0, 30, 71, $text_color, $font, $text_score); // Prints the score in the picture.
  116. imagettftext($im, 10, 0, 30, 102, $text_color, $font, $text_money); // Prints the money in the picture.
  117. imagettftext($im, 10, 0, 300, 42, $text_color, $font, $text_job); // Prints the money in the picture.
  118. imagettftext($im, 10, 0, 300, 71, $text_color, $font, $text_lastdate); // Prints the money in the picture.
  119. imagettftext($im, 10, 0, 300, 102, $text_color, $font, $text_vip); // Prints the money in the picture.
  120. imagepng($im);
  121. imagedestroy($im);
  122. }
  123. else
  124. echo ' Tokio zaidejo nera! ';
  125. mysql_close();
  126.  
  127. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement