[solved] tag mismatch ?
Code:
1. if (cs_get_user_team(id) == 1) { tag mismatch on line 1 tag mismatch on line 4 (this is not the whole plugin) EDIT: I replace it with CS_TEAM_T and CS_TEAM_CT and it works :) what i need to do ? |
Re: [solved] tag mismatch ?
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:
That is how you check it - unless you de-tag iTeam / cs_get_user_team like this: Code:
|
Re: [solved] tag mismatch ?
thanks
|
Re: [solved] tag mismatch ?
I know its solved but isnt it better to use a switch?
PHP Code:
|
Re: [solved] tag mismatch ?
Quote:
|
Re: [solved] tag mismatch ?
The best way is to use if and else.
|
Re: [solved] tag mismatch ?
Quote:
|
Re: [solved] tag mismatch ?
Agreed with fysiks,
i know that cs_get_user_team has 4 results, if you only want to check 1 result use an if. If you want to check more then 1 result (1, 2, 3 or 4 results) you should use a switch. |
Re: [solved] tag mismatch ?
It doesn't matter how many return values the native has. He's setting a model and is first checking that the player is alive. He is also not running a "be alive as spectator" mod so else if should be used.
|
Re: [solved] tag mismatch ?
SnoW, you are so wrong.
He can still check if user is alive before doing the switch. |
| All times are GMT -4. The time now is 03:40. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.