Raised This Month: $ Target: $400
 0% 

How to use cs_get_user_team() and what is the name of a player entity?(ALMOST SOLVED)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 08-06-2008 , 13:40   Re: How to use cs_get_user_team() and what is the name of a player entity?
Reply With Quote #9

Quote:
Originally Posted by dor123 View Post
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 View Post
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.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:40.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode