View Single Post
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 07-21-2019 , 06:33   Re: [HELP] help with int, for loop...
Reply With Quote #16

Quote:
Originally Posted by Neuro Toxin View Post
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); 
}
and how to get the highst and the lowest points from the team like: PrinToChatAll "Team CT: Player X has the highst points (X points) and Player X has the lowest ponit (X points)" and the same from Team Terror...
iskenderkebab33 is offline