Problem, please help
#1

Hello, I have problem with checking the players in the gang war! I made command and all works, but when I'm checking the players and if the players from the defender team are less then 2, it send me message! But now, when I write /GangWar, allways and anywhere I am and in the server are 2 players from the defender team, it send me the message! Please help me, here is the code:
Command:
Quote:

if(strcmp(cmd, "/GangWar", true) == 0)
{
for (new i = 0; i < MAX_TERRITORIES; i++)
{
if(GetTeamMembers(TerritoryInfo[i][TerritoryOwner]) < 2) return SendClientMessage(playerid, COLOR_RED, "No one is from the defender team!");
}
for (new i = 0; i < MAX_TERRITORIES; i++)
{
//Here is my code....
}
return 1;
}

stock:
Quote:

stock GetTeamMembers(teamid)
{
new tmemb = 0;
for(new t; t < MAX_PLAYERS; t++)
{
if(IsPlayerConnected(t) && PlayerInfo[t][pMember] == teamid)
{
tmemb++;
}
}
return tmemb;
}

Reply


Messages In This Thread
Problem, please help - by Kraeror - 18.04.2017, 13:26
Re: Problem, please help - by Marricio - 19.04.2017, 13:28
Re: Problem, please help - by Kraeror - 19.04.2017, 14:06

Forum Jump:


Users browsing this thread: 1 Guest(s)