11.03.2017, 12:55
Hello,
Recently i've been working on a small function that check if the team which's ID is passed as parameter is full (has more members then others?), but i literally failed as i am really bad at maths, would anyone mind giving me a hand?
This the function that i made which i dont think is good / accurate:
Recently i've been working on a small function that check if the team which's ID is passed as parameter is full (has more members then others?), but i literally failed as i am really bad at maths, would anyone mind giving me a hand?
This the function that i made which i dont think is good / accurate:
PHP код:
IsTeamFull(TeamID)
{
new Teams[MAX_TEAMS], bool:rt;
for(new i =0; i< MAX_PLAYERS; i++)
{
for(new k = 0; k < MAX_TEAMS; k++)
{
if((GetPlayerTeam(i) == k)
{
Teams[k]++;
}
}
}
for(new i = 0; i< MAX_TEAMS; i++)
{
if(Teams[i] < Teams[TeamID])
{
rt = true;
}
else
{
rt = false;
}
}
return rt;
}