LMAO. Doesnt think optimisation is a big deal.
There have been numerous threads around the bad habit of a ValidClient function.
Just dont be lazy!
Code:
public void PrintScores()
{
int i_CTCount, i_TCount;
for (int i = 1; i <= MaxClients; i++)
{
if (!IsClientInGame(i))
continue;
if (IsFakeClient(i))
continue;
if(GetClientTeam(i) == 2) // Terror
i_TCount += g_playerspoints[i];
if(GetClientTeam(i) == 3) // CT
i_CTCount += g_playerspoints[i];
}
PrintToChatAll("Team Terror has total %d points.", i_TCount);
PrintToChatAll("Team CT has total %d points.", i_CTCount);
}
__________________