SA-MP Forums Archive
[FilterScript] Very simple Score Textdraw - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Very simple Score Textdraw (/showthread.php?tid=461882)



Very simple Score Textdraw - 007Skyfall - 04.09.2013

Hello everyone Here a simple Score Textdraw Made 100% By ME


IMAGES:




[B]
The Image is in Spanish.
[/B
]

AND: THE CODE


Код:
#include <a_samp>
#pragma tabsize  0
new Text:ScoreTd[MAX_PLAYERS];
#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Blank Filterscript by your name here");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print(" Blank Gamemode by your name here");
	print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
	SetTimer("timersc", 1000, true);//1 SECOND TO ACTUALIZE THE TEXTDRAW
	return 1;
}

public OnPlayerConnect(playerid)
{
new score[128];
format(score, sizeof(score), "Score:%d",GetPlayerScore(playerid));
    ScoreTd[playerid] = TextDrawCreate(419 ,6, score);
    TextDrawColor(ScoreTd[playerid], 0x33AA33AA); 
    TextDrawAlignment(ScoreTd[playerid],0); 
    TextDrawFont(ScoreTd[playerid], 3);
    TextDrawShowForPlayer(playerid, ScoreTd[playerid]); 
    TextDrawSetOutline(ScoreTd[playerid],1);
    TextDrawSetProportional(ScoreTd[playerid],1);
    TextDrawSetShadow(ScoreTd[playerid],0);
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
TextDrawDestroy(ScoreTd[playerid]);
	return 1;
}

forward timersc(playerid);
public timersc()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            new score2[128];
            format(score2, sizeof(score2), "%d",GetPlayerScore(i));
            TextDrawSetString(ScoreTd[i], score2);
        }
    }
    return 1;
}


I know that the FS is Simple, but i do this for NEWBIES, THANKS


Re: Very simple Score Textdraw - Sting. - 04.09.2013

Be proud, its still some good code. Good job on the textdraw.


Re: Very simple Score Textdraw - 007Skyfall - 04.09.2013

Thanks and the textdraw is not difficulty


Re: Very simple Score Textdraw - Sting. - 05.09.2013

I know but still it might be useful for someone. Keep that in mind and be proud.