t1 = SetTimer("AntiCheatUpdate",8000,true); t2 = SetTimer("AutoMessage", 60000, true); t6 = SetTimer("Anticheat", 1000, true); this onplayer spawn statstimer[playerid] = SetTimerEx("StatsInfromation", 15000, true, "u", playerid); but this timer got kill on player death and start again on player spawn. I'm using this to update player stats textdraws.
Hello I'm using only 4 timers in server but the server is lagging hard when we have more players like more than 50.
I'm using nothing on OnPlayerUpdate Код:
t1 = SetTimer("AntiCheatUpdate",8000,true); t2 = SetTimer("AutoMessage", 60000, true); t6 = SetTimer("Anticheat", 1000, true); this onplayer spawn statstimer[playerid] = SetTimerEx("StatsInfromation", 15000, true, "u", playerid); but this timer got kill on player death and start again on player spawn. I'm using this to update player stats textdraws. |
stock StatsInfromation(playerid) { if (IsPlayerConnected(playerid)) { format(Jstring, sizeof(Jstring), "~y~Rank : ~w~%s" , GetRankName(playerid)); PlayerTextDrawSetString(playerid,Rank[playerid],Jstring); format(Jstring, sizeof(Jstring), "~b~Score : ~w~%d" , GetPlayerScore(playerid)); PlayerTextDrawSetString(playerid,Stats[playerid],Jstring); format(Jstring, sizeof(Jstring), "~g~Kills : ~w~%d" , pInfo[playerid][Kills]); PlayerTextDrawSetString(playerid,kills[playerid],Jstring); format(Jstring, sizeof(Jstring), "~r~Deaths : ~w~%d" , pInfo[playerid][Deaths]); PlayerTextDrawSetString(playerid,pDeaths[playerid],Jstring); format(Jstring, sizeof(Jstring), "~b~Headshots : ~w~%d" , pInfo[playerid][Headshot]); PlayerTextDrawSetString(playerid,HEADSHOTS[playerid],Jstring); format(Jstring, sizeof(Jstring), "~r~Streak : ~w~%d" , Streaks[playerid]); PlayerTextDrawSetString(playerid,KS[playerid],Jstring); format(Jstring, sizeof(Jstring), "~y~Ratio : ~w~%.2f" ,Float:pInfo[playerid][Kills]/Float:pInfo[playerid][Deaths]); PlayerTextDrawSetString(playerid,RATIO[playerid],Jstring); } return 1; }