Use get_user_team() to determine which team the player is on and then you'll know the other team (there are mod-specific versions of get_user_team for Counter-Strike and Day of Defeat IIRC that might be better for clarity if you're playing one of those). Then, you'll know the opposite team.
Psuedocode:
Code:
if team == TeamA then
TeamB
else
TeamA
or, just replace "Team" in the get_players() function with the ternary operation:
Code:
get_user_team(id) == TeamA ? "TeamB" : "TeamA"
no need for an extra function unless you're trying to do something fancy with it.
__________________