Quote:
Originally Posted by dor123
What do you mean the second argument is optional? I couldn't use cs_get_user_team() without it. :O
|
The second argument to cs_get_user_team returns the player's model index by reference, and it is optional. The second and third arguments to get_user_team returns the player's team name by reference, and are optional.
Quote:
Originally Posted by dor123
And besides, I wanted it to return the team's NAME not NUMBER.
So I did needed to use the second argument?
|
If you want the name, then you could either check the value and make your own conclusions:
Code:
new name[10];
switch(cs_get_user_team(id))
{
case CS_TEAM_T: name = "TERRORIST";
case CS_TEAM_CT: name = "CT";
default: name = "SPECTATOR";
}
Or you could use the regular get_user_team:
Code:
new name[10];
get_user_team(id,name,9);
This would be how to set the team:
Code:
cs_set_user_team(id,CS_TEAM_T); // or CS_TEAM_CT, CS_TEAM_SPECTATOR, CS_TEAM_UNASSIGNED
Vet: I don't believe that pev_team is always updated properly. It's best to use cs_get_user_team, which checks the private data field that CS sets.
__________________