AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Tag Mismatch? (https://forums.alliedmods.net/showthread.php?t=48130)

mateo10 12-05-2006 12:19

Tag Mismatch?
 
Why do I get tag mismatch in this code?
Code:
public spycard(id) {     if(!get_pcvar_num(g_SpyCard))         return PLUGIN_CONTINUE             new name[32]     get_user_name(id, name, 31)         set_hudmessage(0, 0, 255, 0.0, 0.3, 0, 6.0, 12.0)     show_hudmessage(id, "%s looks like an enemy now...", name)         new CsTeam = cs_get_user_team(id)     new rand4 = random_num(1, 4) //<------Here i get tag mismatch         switch(rand4)     {         case 1:         {             if(CsTeam == 1)             {                 cs_set_user_model(id, "sas")             } else {                 cs_set_user_model(id, "leet")             }         }         case 2:         {             if(CsTeam == 1)             {                 cs_set_user_model(id, "gsg9")             } else {                 cs_set_user_model(id, "arctic")             }         }         case 3:         {             if(CsTeam == 1)             {                 cs_set_user_model(id, "gign")             } else {                 cs_set_user_model(id, "guerilla")             }         }         case 4:         {             if(CsTeam == 1)             {                 cs_set_user_model(id, "urban")             } else {                 cs_set_user_model(id, "phoenix")             }         }     }     return PLUGIN_CONTINUE }

The Specialist 12-05-2006 12:22

Re: Tag Mismatch?
 
can you post your sma so i can t ry to compile it and see whats wrong

mateo10 12-05-2006 12:34

Re: Tag Mismatch?
 
1 Attachment(s)
Sure

jim_yang 12-05-2006 12:40

Re: Tag Mismatch?
 
the problem is here
new CsTeam = cs_get_user_team(id)
should be
new CsTeams:team = cs_get_user_team(id)
then deal with team

P34nut 12-05-2006 12:42

Re: Tag Mismatch?
 
change
Code:
new CsTeam = cs_get_user_team(id)

to

Code:
new CsTeam = get_user_team(id)

not the best way to fix this but it works...

The Specialist 12-05-2006 12:46

Re: Tag Mismatch?
 
i have a question about the return of get_user_team . what value does it return for teams ??:|

jim_yang 12-05-2006 12:47

Re: Tag Mismatch?
 
0 unassigned
1 t
2 ct
3 spectator

The Specialist 12-05-2006 12:57

Re: Tag Mismatch?
 
thanks ++karma

mateo10 12-05-2006 13:07

Re: Tag Mismatch?
 
Thank you all for your help :D

Zenith77 12-05-2006 22:06

Re: Tag Mismatch?
 
Quote:

Originally Posted by The Specialist (Post 411159)
i have a question about the return of get_user_team . what value does it return for teams ??:|

What jim said is correct, but remember the CS_TEAM_* constants are just enumerated constants of these values.


All times are GMT -4. The time now is 06:59.

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