IsTeamFull
#8

Quote:
Originally Posted by TitanX
Посмотреть сообщение
PHP код:
#define MAX_PLAYERS_IN_TEAM 15
IsTeamFull(TeamID

    static 
Countbool:rt
    for(new 
=0iMAX_PLAYERSi++) 
    { 
        if(
GetPlayerTeam(i) == TeamID
        { 
            
Count++; 
        } 
    } 
    if(
Count == MAX_PLAYERS_IN_TEAM)
    { 
        return 
true;  
    }
    else return 
false;

something like that ?
Don't unnecessarily put static key word to every declaration if you actually don't know what it does. Your code wont work as the variable count being a static variable will be stored on data section and will be remembered on each overhead. That means the count variable never be reset.
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)