The Problem is Textdraws making lag alot..
And using a timer of 1 sec to update it..
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;
}
You should make player textdraws instead of global if you are changing data depending on your player.