SA-MP Forums Archive
Stats TextDraw HELP :( - 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)
+--- Thread: Stats TextDraw HELP :( (/showthread.php?tid=524858)



Stats TextDraw HELP :( - SPA - 08.07.2014

Hi,
i'v stats textdraw (Kills deaths etc..) , well its working fine ,but after few hours it's disappear , some guy saied that because i must destroy it to avoid exced (limits) , i did that but it still disappear after few hours, anyone can help please


Код:
//stats
new Text:LoggedInAs[MAX_PLAYERS];
public OnPlayerDeath(playerid,killerid,reason)
{
	CheckLoggedInAs(playerid);
	if(killerid != INVALID_PLAYER_ID)
	{
	    CheckLoggedInAs(killerid);
	}
	return 1;
}
public OnFilterScriptExit()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
	{
        TextDrawDestroy(LoggedInAs[i]);
	}
}

public OnPlayerConnect(playerid)
{

    LoggedInAs[playerid] = TextDrawCreate(300.5,6, "www.spa-server.net");
    TextDrawBackgroundColor(LoggedInAs[playerid], 255);
    TextDrawFont(LoggedInAs[playerid], 3);
    TextDrawLetterSize(LoggedInAs[playerid], 0.350000, 1.000000);
    TextDrawColor(LoggedInAs[playerid], -5046017);
    TextDrawSetOutline(LoggedInAs[playerid], 0);
    TextDrawSetProportional(LoggedInAs[playerid], 1);
    TextDrawSetShadow(LoggedInAs[playerid], 1);
    TextDrawSetSelectable(LoggedInAs[playerid], 0);
    CheckLoggedInAs(playerid);
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    TextDrawDestroy(LoggedInAs[playerid]);
return 1;
}
public OnPlayerSpawn(playerid)
{
    CheckLoggedInAs(playerid);
    TextDrawShowForPlayer(playerid,LoggedInAs[playerid]);
return 1;
}
stock CheckLoggedInAs(playerid)
{
/*	if(pInfo[playerid][Kills] >= 1000) Rank[ playerid ] = 6;
	else if(pInfo[playerid][Kills] >= 700) Rank[ playerid ] = 5;
	else if(pInfo[playerid][Kills] >= 500) Rank[ playerid ] = 4;
	else if(pInfo[playerid][Kills] >= 200) Rank[ playerid ] = 3;
	else if(pInfo[playerid][Kills] >= 100) Rank[ playerid ] = 2;
	else if(pInfo[playerid][Kills] >= 10) Rank[ playerid ] = 1;
	else if(pInfo[playerid][Kills] >= 0) Rank[ playerid ] = 0;*/

	new string[450];
	format(string, sizeof(string), "~g~Kills: %d ~W~- ~r~Deaths: %d ~W~- ~y~DM Score: %d",pInfo[playerid][Kills],pInfo[playerid][Deaths],GetPlayerScore(playerid));
 	TextDrawSetString(Text:LoggedInAs[playerid], string);
	return 1;
}



Re: Stats TextDraw HELP :( - SPA - 08.07.2014

HELP!


Re : Stats TextDraw HELP :( - Clad - 08.07.2014

Can you show me the TextDraw ?


Re: Stats TextDraw HELP :( - SPA - 08.07.2014

DONE!


Re: Stats TextDraw HELP :( - BroZeus - 09.07.2014

not sure but try converting it to player text draws


Re: Stats TextDraw HELP :( - Jack_Leslie - 09.07.2014

Well this:
pawn Код:
TextDrawSetString(Text:LoggedInAs[playerid], string);
Should be:
pawn Код:
TextDrawSetString(LoggedInAs[playerid], string);



Re: Stats TextDraw HELP :( - SPA - 09.07.2014

Quote:
Originally Posted by Jack_Leslie
Посмотреть сообщение
Well this:
pawn Код:
TextDrawSetString(Text:LoggedInAs[playerid], string);
Should be:
pawn Код:
TextDrawSetString(LoggedInAs[playerid], string);
Ok thanks, i will try !


Re: Stats TextDraw HELP :( - SPA - 11.07.2014

Quote:
Originally Posted by Jack_Leslie
Посмотреть сообщение
Well this:
pawn Код:
TextDrawSetString(Text:LoggedInAs[playerid], string);
Should be:
pawn Код:
TextDrawSetString(LoggedInAs[playerid], string);
This does not helped again text destroyed after 1 day.


Re: Stats TextDraw HELP :( - BroZeus - 11.07.2014

maybe the the textdraw limit is exeeding not because of this but because of some other textdraw in server


Re: Stats TextDraw HELP :( - SPA - 11.07.2014

I'v 2 textdraws only which are static