Raised This Month: $ Target: $400
 0% 

Is there a better way to check if players are on same team?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
zacky
Senior Member
Join Date: Mar 2008
Location: Sweden
Old 06-26-2009 , 13:36   Is there a better way to check if players are on same team?
Reply With Quote #1

Is there a better way than this to check if 2 players are on same team?

PHP Code:
stock bool:is_both_on_same_team(indexindex2) {
    if (
cs_get_user_team(index) == CS_TEAM_T && cs_get_user_team(index2) == CS_TEAM_T)
        return 
true;
    
    else if (
cs_get_user_team(index) == CS_TEAM_CT && cs_get_user_team(index2) == CS_TEAM_CT)
        return 
true;
    
    return 
false;

Thanks
-zacky
zacky is offline
Send a message via Skype™ to zacky
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 06-26-2009 , 13:39   Re: Is there a better way to check if players are on same team?
Reply With Quote #2

cs_get_user_team(index) == cs_get_user_team(index2)
__________________
xPaw is offline
zacky
Senior Member
Join Date: Mar 2008
Location: Sweden
Old 06-26-2009 , 13:40   Re: Is there a better way to check if players are on same team?
Reply With Quote #3

Quote:
Originally Posted by xPaw View Post
cs_get_user_team(index) == cs_get_user_team(index2)
Thanks xpaw, +karma.
zacky is offline
Send a message via Skype™ to zacky
cikjam
Senior Member
Join Date: Feb 2009
Location: Australia
Old 06-27-2009 , 00:02   Re: Is there a better way to check if players are on same team?
Reply With Quote #4

Is karma back on?
cikjam is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-27-2009 , 02:41   Re: Is there a better way to check if players are on same team?
Reply With Quote #5

Yes, but configured differently. You can find more details in the Offtopic section.
__________________
Arkshine 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 15:33.


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