Quote:
Originally Posted by Bugsy
I don't think he's showing how to check team in code but was using the OR operator instead of typing "or"... Atleast I hope so.
|
I doubt he was using proper coding for that.
He was most likely coding for logic:
If the player's team is Terrorist, Counter-Terrorist, or Spectator
Code:
if( cs_get_user_team( iPlayer ) == CS_TEAM_T || CS_TEAM_CT || CS_TEAM_SPECTATOR )
3 ways to fix this with the if() statement, and he wasn't close to any.
1.
Code:
if( cs_get_user_team( iPlayer ) == CS_TEAM_T || cs_get_user_team( iPlayer ) == CS_TEAM_CT || cs_get_user_team( iPlayer ) == CS_TEAM_SPECTATOR )
2.
Code:
new CsTeams:iTeam = cs_get_user_team( iPlayer );
if( iTeam == CS_TEAM_T || iTeam == CS_TEAM_CT || iTeam == CS_TEAM_SPECTATOR )
3.
Code:
if( ( 1 << ( _:cs_get_user_team( iPlayer ) ) ) & ( ( 1 << ( _:CS_TEAM_T ) ) | ( 1 << ( _:CS_TEAM_CT ) ) | ( 1 << ( _:CS_TEAM_SPECTATOR ) ) ) )
__________________