IsTeamFull
#6

PHP код:
IsTeamFull(TeamID

    new 
Teams[MAX_TEAMS],i,k
    for(
=0iMAX_PLAYERSi++) 
            for(
0MAX_TEAMSk++) 
                    if((
GetPlayerTeam(i) == k
                             
Teams[k]++; 
        
    for(
0iMAX_TEAMSi++) 
            if(
Teams[i] < Teams[TeamID]) 
                    return 
true
               
    return 
false

More effiicient will be storing count upon joining instead of looping and do the last check.
Reply


Messages In This Thread
IsTeamFull - by iLearner - 11.03.2017, 12:55
Re: IsTeamFull - by SyS - 11.03.2017, 13:09
Re: IsTeamFull - by TitanX - 11.03.2017, 13:10
Re: IsTeamFull - by iLearner - 11.03.2017, 13:12
Re: IsTeamFull - by TopShooter2 - 11.03.2017, 13:14
Re: IsTeamFull - by SyS - 11.03.2017, 13:22
Re: IsTeamFull - by TitanX - 11.03.2017, 13:27
Re: IsTeamFull - by SyS - 11.03.2017, 13:46
Re: IsTeamFull - by TitanX - 11.03.2017, 13:54
Re: IsTeamFull - by Trucido - 11.03.2017, 16:35

Forum Jump:


Users browsing this thread: 1 Guest(s)