View Single Post
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 07-22-2019 , 01:45   Re: [HELP] help with int, for loop...
Reply With Quote #18

Quote:
Originally Posted by Neuro Toxin View Post
Add variables for lowest/highest score of each team for the client loop.

Code:
int i_TMin, i_TMax;
int i_TMinClient, i_TMaxClient
Initialise the mins to a high value a player couldn't get.

Code:
i_TMin = 9999;
Check and store...

Code:
if (GetClientTeam(i) == CS_TEAM_T)
{
    i_TCount += g_playerspoints[i];
    
    if (g_playerspoints[i] < i_TMin)
    {
        i_TMin = g_playerspoints[i];
        i_TMinClient = i;
    }
    else if (g_playerspoints[i] == i_TMin)
    {
        // you probably want to figure out who will be based lower on another stat
    }
}
And print.

Code:
PrintToChatAll("Team T: player %N has the lowest points (%d points).", i_TMinClient, i_TMin);
Do the opposite for max.

Do it again for CS_TEAM_CT.
thanks.
iskenderkebab33 is offline