Need help Rep+1
#1

The Problem is Textdraws making lag alot..
I'm using the Textdraws Under OnGameInt
And using a timer of 1 sec to update it..
the Textdraws working fine but it making lot of
Lag.. How i can Fix that?

Код:
forward StatsInfromation();
public StatsInfromation()
{
	for(new i=0;i<MAX_PLAYERS;i++)
	{
	if (IsPlayerConnected(i))
  	{
  	new str[128];

	TextDrawHideForPlayer(i,Rank[i]);
    format(str, sizeof(str), "~y~Rank : ~w~%s" , GetRankName(i));
    TextDrawSetString(Rank[i],str);
    TextDrawShowForPlayer(i,Rank[i]);

	TextDrawHideForPlayer(i,Stats[i]);
    format(str, sizeof(str), "~b~Score : ~w~%d" , GetPlayerScore(i));
    TextDrawSetString(Stats[i],str);
    TextDrawShowForPlayer(i,Stats[i]);

	TextDrawHideForPlayer(i,kills[i]);
    format(str, sizeof(str), "~g~Kills : ~w~%d" , pInfo[i][Kills]);
    TextDrawSetString(kills[i],str);
    TextDrawShowForPlayer(i,kills[i]);

	TextDrawHideForPlayer(i,pDeaths[i]);
    format(str, sizeof(str), "~r~Deaths : ~w~%d" , pInfo[i][Deaths]);
    TextDrawSetString(pDeaths[i],str);
    TextDrawShowForPlayer(i,pDeaths[i]);

   	TextDrawHideForPlayer(i,HEADSHOTS[i]);
    format(str, sizeof(str), "~b~Headshots : ~w~%d" , pInfo[i][Headshot]);
    TextDrawSetString(HEADSHOTS[i],str);
    TextDrawShowForPlayer(i,HEADSHOTS[i]);

    TextDrawHideForPlayer(i,KILLINGSTREAK[i]);
    format(str, sizeof(str), "~r~Streak : ~w~%d" , Streaks[i]);
    TextDrawSetString(KILLINGSTREAK[i],str);
    TextDrawShowForPlayer(i,KILLINGSTREAK[i]);

    TextDrawHideForPlayer(i,RATIO[i]);
    format(str, sizeof(str), "~y~Ratio : ~w~%.2f" ,Float:pInfo[i][Kills]/Float:pInfo[i][Deaths]);
    TextDrawSetString(RATIO[i],str);
    TextDrawShowForPlayer(i,RATIO[i]);
	  }
	}
	return 1;
}
Reply


Messages In This Thread
Need help Rep+1 - by MBilal - 30.01.2015, 17:08
Re: Need help Rep+1 - by zaibaslr2 - 30.01.2015, 17:10
Re: Need help Rep+1 - by MBilal - 30.01.2015, 17:23
Re: Need help Rep+1 - by zaibaslr2 - 30.01.2015, 17:35
Re: Need help Rep+1 - by MBilal - 30.01.2015, 17:38

Forum Jump:


Users browsing this thread: 1 Guest(s)