Raised This Month: $ Target: $400
 0% 

[solved] tag mismatch ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 05-16-2010 , 17:10   Re: [solved] tag mismatch ?
Reply With Quote #1

Already solved but, just to tell others: cs_get_user_team() returns a tagged value - such as CS_TEAM_T (see cstrike.inc for other values in the "class").

Code:
new CsTeams:iTeam = cs_get_user_team( iPlayer ); // iPlayer = index of a player // iTeam is now.. lets say.. CS_TEAM_CT (2) // this means you cannot check it like this: if( iTeam == 2 ) {     // code } // you need to check it like this: if( iTeam == CS_TEAM_CT ) {     // code }

That is how you check it - unless you de-tag iTeam / cs_get_user_team like this:

Code:
if( _:cs_get_user_team( iPlayer ) == 2 ) {     // iPlayer is a CT } // or the other way around: if( cs_get_user_team( iPlayer ) == CsTeams:2 ) // tagged 2 means CS_TEAM_CT {     // iPlayer is a CT }
__________________
Achievements API - a simple way for you to create your OWN custom achievements!
Xellath is offline
Reply



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 03:40.


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