[Tutorial] Server stats signature
#1

Greetings, i decide to make a tutorial how to make the server stats signature.

I have to explain to you just one thing,that thing is "createsig.php" (HOW TO CREATE):

Quote:

<?php
include_once("functions.php");
$sign = !isset($_GET['s']) ? 1 : $_GET['s'];
$uname = !isset($_GET["name"]) ? "None" : $_GET['name'];
// Connection & Website Settings
$ftpad = "ip-adress";//Write IP Adress for server FTP
$ftpuser = "username";//Write username for server FTP
$ftppass = "pass";//write password for FTP server
$comm = "SAMP";
$weburl = "www.zbsamp.com";
$usersdir = "/scriptfiles";//Where are accounts...
//
$ftpcon = ftp_connect($ftpad,21) or die("ERROR");
$login = ftp_login($ftpcon,$ftpuser,$ftppass);
$uname = "";
* * * *$ime = $_GET['name'];
ftp_pasv($ftpcon,true);
$fhandle = fopen("tempsign_".hash('sha256',"$ime").".tmp","w+ ");
ftp_fget($ftpcon,$fhandle,"$usersdir/$ime.ini",FTP_ASCII);
$str = parse_ini_file2("tempsign_".hash('sha256',"$ime"). ".tmp");
fclose($fhandle);
* * * *$skin = $str['pSkin'];//Definition of players skin in .ini file
$rImg = ImageCreateFromPNG("./signs/1.png");//Signature piceture
if (file_exists("./signs/skins/$skin.jpg"))
{
* *$skinImg = ImageCreateFromjpeg("./signs/skins/$skin.jpg");//Create piceture of players skin in signature
}
else
{
* *$skinImg = ImageCreateFromjpeg("./signs/skins/0.jpg");//else if skin doesen't exist
} *
$cor_black = imagecolorallocate($rImg,0,0,0);
$cor_blue = imagecolorallocate($rImg,0,0,255);
$cor_lblue = imagecolorallocate($rImg,30,144,255);
$cor_green = imagecolorallocate($rImg,69,139,116);
$cor_red = imagecolorallocate($rImg,220,20,65);
$cor_wh = imagecolorallocate($rImg,255,255,255);
if(ftp_size($ftpcon,"$usersdir/$ime.ini") == -1 || $ime == "None")//Checks if player account exist
{
* * echo "<center><br/><br/><br/><br/><font color='#FF3333'>That player doesen't exist<br/><br/></font></center>";
return 1;
}
else//if exist
{
ftp_pasv($ftpcon,true);
$fhandle = fopen("tempsign_".hash('sha256',"$ime").".tmp","w+ ");
ftp_fget($ftpcon,$fhandle,"$usersdir/$ime.ini",FTP_ASCII);
$str = parse_ini_file2("tempsign_".hash('sha256',"$ime"). ".tmp");
fclose($fhandle);
imagettftext($rImg,11,0,127,48,$cor_wh,"gothicb.TT F",urldecode($ime));//Players name
imagettftext($rImg,11,0,139,66,$cor_wh,"gothicb.TT F",urldecode($str['pLevel']));
* * * * * * * *imagettftext($rImg,11,0,172,85,$cor_wh,"gothicb.T TF",urldecode($str['pExp']));
* * * * * * * *imagettftext($rImg,11,0,140,104,$cor_wh,"gothicb. TTF",urldecode($str['pDeaths']));
* * * * * * * *imagettftext($rImg,11,0,310,67,$cor_wh,"gothicb.T TF",urldecode($str['pTimeOnline']));
* * * * * * * *imagettftext($rImg,11,0,313,85,$cor_wh,"gothicb.T TF",urldecode($str['pKills']));
* * * * * * * *imagettftext($rImg,11,0,286,104,$cor_wh,"gothicb. TTF",urldecode($str['pRatio']));
* * * * * * * *imagecopymerge($rImg, $skinImg, 6,6,0,0,80,100,100);
//Writes players information on signature

}
ftp_close($ftpcon);
unset($str);
unset($ftpad);
unset($ftpuser);
unset($ftppass);
unset($ftpcon);
unset($login);
header('Content-type: image/png');
imagepng($rImg);
* * * *imagepng($skinImg);
?>

How looks empty signature:



[size=12pt]Download .rar:[/size] http://www.solidfiles.com/d/dd60b04009/ (Croatian language,just copy ENG version of createsig.php (izradapotpisa.php)
[size=12pt]Demo:[/size] www.xeptic.info/dmpotpisi
Reply


Messages In This Thread
Server stats signature - by vB - 16.03.2013, 18:58
Re: Server stats signature - by gtakillerIV - 16.03.2013, 19:28
Re : Server stats signature - by thegreathom - 16.03.2013, 19:45
Re: Server stats signature - by kamzaf - 16.03.2013, 20:01
Re: Server stats signature - by thistooshallpass93 - 16.03.2013, 20:34
Re: Server stats signature - by vB - 16.03.2013, 22:05
Re: Server stats signature - by Vince - 16.03.2013, 22:29
Re: Server stats signature - by TheArcher - 16.03.2013, 22:57
Re: Server stats signature - by Black Wolf - 17.03.2013, 02:41
Re: Server stats signature - by RajatPawar - 17.03.2013, 04:01

Forum Jump:


Users browsing this thread: 1 Guest(s)