PHP Code:
stock get_team_playernum(iTeam) {
static players[32], num
static iNum
get_players(players, num)
for (new i = 0; i < num; i++) {
if (get_user_team(players[i]) == iTeam) {
iNum++
}
}
return iNum
}
un-test.
Quote:
|
should add a bool and set it true when he connects and false when he disconnects
|
you can do it like the following code, then, I think you needn't to check when player disconnect.
should work:
PHP Code:
const BOOL_ARRAY[33] = {false,...}
new bool:g_bvar[33]
public client_connect(id) {
g_bvar = BOOL_ARRAY
g_bvar[id] = true
}
__________________