18.04.2017, 13:26
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:
stock:
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; } |
Quote:
stock GetTeamMembers(teamid) { new tmemb = 0; for(new t; t < MAX_PLAYERS; t++) { if(IsPlayerConnected(t) && PlayerInfo[t][pMember] == teamid) { tmemb++; } } return tmemb; } |