AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Is there a better way to check if players are on same team? (https://forums.alliedmods.net/showthread.php?t=95722)

zacky 06-26-2009 13:36

Is there a better way to check if players are on same team?
 
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

xPaw 06-26-2009 13:39

Re: Is there a better way to check if players are on same team?
 
cs_get_user_team(index) == cs_get_user_team(index2)

zacky 06-26-2009 13:40

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

Originally Posted by xPaw (Post 857762)
cs_get_user_team(index) == cs_get_user_team(index2)

Thanks xpaw, +karma.

cikjam 06-27-2009 00:02

Re: Is there a better way to check if players are on same team?
 
Is karma back on?

Arkshine 06-27-2009 02:41

Re: Is there a better way to check if players are on same team?
 
Yes, but configured differently. You can find more details in the Offtopic section.


All times are GMT -4. The time now is 15:33.

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