Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- error_reporting(E_ALL);
- $username=""; //Your MySQL Username.
- $password=""; // Your MySQL Pass.
- $database=""; // Your MySQL database.
- $host=""; // Your MySQL host. This is "localhost" or the IP specified by your hosting company.
- $player_name=$_GET['player_name']; // This gets the player his name from the previous page.
- mysql_connect($host,$username,$password); // Connection to the database.
- @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.
- /* To protect MySQL injection. */
- $player_name = stripslashes($player_name);
- $player_name = mysql_real_escape_string($player_name);
- $query="SELECT * FROM zaidejai WHERE Name = '$player_name'"; // Gets all the information about the player.
- $result=mysql_query($query);
- $i=mysql_num_rows($result); // Here we are counting how many rows this result gives us.
- 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.
- {
- $Playername=mysql_result($result,0,"Name"); // Gets the username of the player and put it in the variable $Playername.
- $Money=mysql_result($result,0,"Money"); // Gets the money of the player and put it in the variable $Money.
- $Score=mysql_result($result,0,"Xp"); // Gets the score of the player and put it in the variable $Score.
- $Job=mysql_result($result,0,"darbas"); // Gets the score of the player and put it in the variable $Score.
- $adminas=mysql_result($result,0,"AdminLvl"); // Gets the score of the player and put it in the variable $Score.
- $vipas=mysql_result($result,0,"Vip"); // Gets the score of the player and put it in the variable $Score.
- $viptime=mysql_result($result,0,"viplaikas"); // Gets the score of the player and put it in the variable $Score.
- if( $vipas > 0 )
- {
- $vipux = "Yra( iki ".date('Y/m/d', $viptime)." )";
- }
- else
- {
- $vipux = "Nëra";
- }
- if( $adminas == 4 )
- {
- $adminaslvl = "Savininkas";
- }
- if( $adminas == 3 )
- {
- $adminaslvl = "III lygio";
- }
- if( $adminas == 2 )
- {
- $adminaslvl = "II lygio";
- }
- if( $adminas == 1 )
- {
- $adminaslvl = "I lygio";
- }
- if( $adminas == 0 )
- {
- $adminaslvl = "Nëra";
- }
- if( $Job == 0)
- {
- $darbas = "Bedarbis";
- }
- if( $Job == 1)
- {
- $darbas = "Policininkas";
- }
- if( $Job == 2)
- {
- $darbas = "Medikas";
- }
- if( $Job == 3)
- {
- $darbas = "Mechanikas";
- }
- if( $Job == 4)
- {
- $darbas = "Fûristas";
- }
- if( $Job == 5)
- {
- $darbas = "Taksistas";
- }
- if( $Job == 6)
- {
- $darbas = "Ðlavëjas";
- }
- if( $Job == 7)
- {
- $darbas = "Aras";
- }
- if( $Job == 8)
- {
- $darbas = "Ûkininkas";
- }
- // Creating of the .png image.
- header('Content-Type: image/png');
- $im = @imagecreatefrompng('sig.png') or die("Cannot select the correct image. Please contact the webmaster."); // Don't forget to put your picture there.
- $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.
- $text_username = "Vardas: "."$Playername"; // This gets the information about player name to be showed in the picture.
- $text_score = "Patirtis: "."$Score"."XP"; // Same as above ^^
- $text_money = "Pinigai: "."$Money"."$"; // Same as above ^^
- $text_job = "Darbas: "."$darbas"; // Same as above ^^
- $text_lastdate = "Admin: "."$adminaslvl"; // Same as above ^^
- $text_vip = "VIP: "."$vipux"; // Same as above ^^
- $font = 'arial.ttf';
- imagettftext($im, 10, 0, 30, 42, $text_color, $font, $text_username); // Prints the username in the picture.
- imagettftext($im, 10, 0, 30, 71, $text_color, $font, $text_score); // Prints the score in the picture.
- imagettftext($im, 10, 0, 30, 102, $text_color, $font, $text_money); // Prints the money in the picture.
- imagettftext($im, 10, 0, 300, 42, $text_color, $font, $text_job); // Prints the money in the picture.
- imagettftext($im, 10, 0, 300, 71, $text_color, $font, $text_lastdate); // Prints the money in the picture.
- imagettftext($im, 10, 0, 300, 102, $text_color, $font, $text_vip); // Prints the money in the picture.
- imagepng($im);
- imagedestroy($im);
- }
- else
- echo ' Tokio zaidejo nera! ';
- mysql_close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement