Quote:
Originally Posted by Bugsy
Why?
PHP Code:
new szTeam[ 10 ];
get_opposite_team( id , szTeam , charsmax( szTeam ) );
stock get_opposite_team( index , szTeam[] , maxchars )
{
return copy( szTeam , maxchars , cs_get_user_team( index ) == CS_TEAM_T ? "CT" : "TERRORIST" );
}
Instead of getting the team name string, why not get the CsTeams team value? If the specified player is unassigned or spec, it will return the same.
PHP Code:
new CsTeams:ctOppositeTeam = get_opposite_team( id );
stock CsTeams:get_opposite_team( id )
{
new CsTeams:ctTeam = cs_get_user_team( id );
if ( CS_TEAM_T <= ctTeam <= CS_TEAM_CT )
ctTeam = ( ctTeam == CS_TEAM_T ) ? CS_TEAM_CT : CS_TEAM_T;
return ctTeam;
}
|
The first code looks pretty same as mine.
And second code don't help me, because I need the string to use directly. And yes i can check with if and apply to string, but i wan't to know what's not good with mine code.