Parakoopa
Tribute
- Joined
- May 20, 2012
- Messages
- 40
- Reaction score
- 7
Parakoopa's Stat Signature Version 0.9:
Quick preview - Please click on the link below for more details!:
Click here to see it in action!
(You can even make your own!)
Example Code used by me, you might want to look at it if you use it:
PS: I don't like the "Plays" on it very much. Is that even correct? I may change it in later versions.
Quick preview - Please click on the link below for more details!:
Click here to see it in action!
(You can even make your own!)
Example Code used by me, you might want to look at it if you use it:
PHP:
<?php
/* Sample Script for Parakoopa's MCSG Stat Signature */
// PHP Stuff
error_reporting(E_ERROR | E_WARNING | E_PARSE);
Header ("Content-type: image/png");
// %donation background modifier
if ($_GET['donation'] == "IRON") $donation_bg = "iron";
elseif ($_GET['donation'] == "GOLD") $donation_bg = "gold";
elseif ($_GET['donation'] == "DIAMOND") $donation_bg = "diamond";
else $donation_bg = "normal";
// %points background modifier
if ($_GET['points'] < 100) $points_bg = "0";
elseif ($_GET['points'] >= 100 and $_GET['points'] < 200) $points_bg = "1";
elseif ($_GET['points'] >= 200 and $_GET['points'] < 400) $points_bg = "2";
elseif ($_GET['points'] >= 400 and $_GET['points'] < 600) $points_bg = "3";
elseif ($_GET['points'] >= 600 and $_GET['points'] < 1000) $points_bg = "4";
elseif ($_GET['points'] >= 1000 and $_GET['points'] < 1500) $points_bg = "5";
elseif ($_GET['points'] >= 1500) $points_bg = "6";
// Image loader
$url = "./sigformcsg".$donation_bg."_".$points_bg.".png";
$im = imagecreatefrompng ($url);
// Ressource loader
$cblack = ImageColorAllocate ($im, 0, 0, 0);
$cdarkgrey = ImageColorAllocate ($im, 10, 10, 10);
$cred = ImageColorAllocate ($im, 255, 0, 0);
$cwhite = ImageColorAllocate ($im, 255, 255, 255);
$fbavaria = "./BAVARG.TTF";
$feurostile = "./EUROSTI.TTF";
$feurostile_bold = "./EUROSTI.TTF";
$ftrebuchet = "./TREBUC.TTF";
$ftrebuchet_bold = "./TREBUCBD.TTF";
// Print Avatar. If something goes wrong, Steve will help.
$ava = @imagecreatefrompng ("http://minotar.net/avatar/".$_GET['username']."/80.png");
@imagecopymerge($im, $ava, 5, 5, 0, 0, 80, 80, 100);
// Print %username. Make text smaller if name too long
if (strlen($_GET['username']) < 10) ImageTTFText ($im, 24, 0, 95,32, $cblack, $ftrebuchet_bold,$_GET['username']);
elseif (strlen($_GET['username']) < 12) ImageTTFText ($im, 20, 0, 95,32, $cblack, $ftrebuchet_bold,$_GET['username']);
elseif (strlen($_GET['username']) < 16) ImageTTFText ($im, 18, 0, 95,32, $cblack, $ftrebuchet_bold,$_GET['username']);
else ImageTTFText ($im, 16, 0, 95,32, $cblack, $ftrebuchet_bold,$_GET['username']);
// Print %points. Automatically moving to the right
if ($_GET['points'] < 100000 and $_GET['points'] >= 10000)$ppos = 228;
if ($_GET['points'] < 10000 and $_GET['points'] >= 1000) $ppos = 248;
if ($_GET['points'] < 1000 and $_GET['points'] >= 100) $ppos = 268;
if ($_GET['points'] < 100 and $_GET['points'] >= 10) $ppos = 287;
if ($_GET['points'] < 10 and $_GET['points'] >= 0) $ppos = 307;
ImageTTFText ($im, 24, 0, $ppos,82, $cblack, $feurostile/*_bold*/, $_GET['points']);
ImageTTFText ($im, 10, 0, 295,93, $cblack, $feurostile, "/POINTS");
// Print %victories
if ($_GET['victories'] > 10 and $_GET['victories'] < 100) $_GET['victories'] = "0".$_GET['victories'];
if ($_GET['victories'] < 10) $_GET['victories'] = "00".$_GET['victories'];
ImageTTFText ($im, 12, 0, 370,32, $cblack, $feurostile, $_GET['victories']);
ImageTTFText ($im, 10, 0, 300,30, $cblack, $feurostile, "/VICTORIES");
// Print %games_played.
if ($_GET['games_played'] > 10 and $_GET['games_played'] < 100) $_GET['games_played'] = "0".$_GET['games_played'];
if ($_GET['games_played'] < 10) $_GET['games_played'] = "00".$_GET['games_played'];
ImageTTFText ($im, 12, 0, 370,15, $cblack, $feurostile, $_GET['games_played']);
ImageTTFText ($im, 10, 0, 300,13, $cblack, $feurostile, "/");
ImageTTFText ($im, 8, 0, 308,11, $cblack, $feurostile, "GAMES");
ImageTTFText ($im, 8, 0, 308,19, $cblack, $feurostile, "PLAYED");
// Print %total_kills. Automatically moving to the right
//ImageTTFText ($im, 12, 0, 370,15, $cblack, $feurostile, $_GET['total_kills']);
//ImageTTFText ($im, 10, 0, 300,15, $cblack, $feurostile, "/VICTORIES");
// Print %total_lifespan
// Assuming %total_lifespan is in seconds!
if ($_GET['total_lifespan'] < 60) $ptext = $_GET['total_lifespan']." seconds";
if ($_GET['total_lifespan'] >= 60 and $_GET['total_lifespan'] < 3600) $ptext = round($_GET['total_lifespan']/60)." minutes";
if ($_GET['total_lifespan'] >= 3600 and $_GET['total_lifespan'] < 86400) $ptext = round($_GET['total_lifespan']/60/60)." hours";
if ($_GET['total_lifespan'] >= 86400 and $_GET['total_lifespan'] < 2629743) $ptext = round($_GET['total_lifespan']/60/60/24)." days";
if ($_GET['total_lifespan'] >= 2629743 and $_GET['total_lifespan'] < 31556926) $ptext = round($_GET['total_lifespan']/60/60/24/30)." months";
if ($_GET['total_lifespan'] >= 31556926) $ptext = round($_GET['total_lifespan']/60/60/24/30/12)." years";
ImageTTFText ($im, 15, 0, 105,56, $cblack, $ftrebuchet, $ptext);
ImageTTFText ($im, 10, 0, 200,56, $cblack, $feurostile, "/LIFETIME");
// Print Copyright.
ImageTTFText ($im, 6, 0, 227,119, $cwhite, $fbavaria,"Minecraft Survival Games · mcsg.in");
// Print Random Stat and Rank.
ImageTTFText ($im, 6, 0, 5,119, $cwhite, $fbavaria,$_GET['server']."-Rank: #".$_GET['rank']." | Random Stat: %RANDOM");
// WIP TEXT I used while making changes: ImageTTFText ($im, 29, -11, 56,42, $cred, $ftrebuchet_bold,"WIP - RIGHT NOW!!");
// Print image and destroy it.
Imagepng ($im);
ImageDestroy ($im);
//And we are done. Hooray!
?>