SA-MP Forums Archive
[Tutorial] Server stats signature - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] Server stats signature (/showthread.php?tid=423140)



Server stats signature - vB - 16.03.2013

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


Re: Server stats signature - gtakillerIV - 16.03.2013

Meh, this ain't a Tutorial man.


Re : Server stats signature - thegreathom - 16.03.2013

[Tutorial] How to write a tutorial


Re: Server stats signature - kamzaf - 16.03.2013

Quote:
Originally Posted by gtakillerIV
View Post
Meh, this ain't a Tutorial man.
^^. Learn to write a tutorial first dude.


Re: Server stats signature - thistooshallpass93 - 16.03.2013

Um, Thank You. However, this isn't a tutorial. If i didn't know PHP I'd be looking at a bunch of random numbers, symbols, and letters.

I can't even say you tried, Sorry mate.


Re: Server stats signature - vB - 16.03.2013

My apologises !

I will make a new one or edit this one a soon as possible.


And i'm sorry for croatian language in the signature...



Re: Server stats signature - Vince - 16.03.2013

tags exist. Use them!


Re: Server stats signature - TheArcher - 16.03.2013

You should've post it here

http://forum.sa-mp.com/forumdisplay.php?f=82


Re: Server stats signature - Black Wolf - 17.03.2013

Also can you make with mysql please.


Re: Server stats signature - RajatPawar - 17.03.2013

I made one similar to this, you just made it better and secure and nice ! Congrats for that. But yes, explanations needed.