12.05.2010, 00:53
Well i have a code here. It works, but i have 4 teams and i do not know how to set the Count1. Count2 Count3 Count4 to make it work for 4 teams
EX. Count1 > Count2 Count2 > Count1
idk how to make it for make for 4 teams.. help
EX. Count1 > Count2 Count2 > Count1
idk how to make it for make for 4 teams.. help
Код:
new count1, count2, count3, count4; for(new p = 0; p < GetMaxPlayers(); p++) { if (gTeam[p] == TEAM_USA) { count1++; } else if (gTeam[p] == TEAM_CHINA) { count2++; } else if (gTeam[p] == TEAM_IRAN) { count3++; } else if (gTeam[p] == TEAM_RUSSIA) { count4++; } } if ((count1 > count2) && gTeam[playerid] == TEAM_USA) return SendClientMessage(playerid, COLOR_RED, " This team is full!"); else if ((count2 > count1) && gTeam[playerid] == TEAM_CHINA) return SendClientMessage(playerid, COLOR_RED, " This team is full!"); else if ((count2 > count1) && gTeam[playerid] == TEAM_IRAN) return SendClientMessage(playerid, COLOR_RED, " This team is full!");