Raised This Month: $ Target: $400
 0% 

Warning: Tag mismatch


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Snitch
Veteran Member
Join Date: Sep 2013
Location: Kazakhstan
Old 12-25-2014 , 06:16   Warning: Tag mismatch
Reply With Quote #1

why Tag mismatch?
Code:
    for ( new i; i < iNum; i++ )
    {
        iPlayer = Players[ i ];
        
        if ( g_iGang[ iPlayer ] != g_iGang[ client ] )
            continue;
        
        ColorChat( iPlayer, GetTeamColor( cs_get_user_team( client ) ), "^3*^1%s^1[^3 %s ^1] %s^4 %s^1 :^3 %s", is_user_alive( client ) ? " " : "DEAD", aData[ GangName ], szStatus, szName( client ), szMsg );
    }
Code:
stock GetTeamColor( CsTeams:iTeam )
{
    switch ( iTeam )
    {
        case CS_TEAM_CT:    return BLUE;
        
        case CS_TEAM_T:        return RED;
        
        case CS_TEAM_SPECTATOR:    return GREY;
    }
    
    return GREEN;
}
Lines tag mismatch:
Code:
case CS_TEAM_CT:    return BLUE;
case CS_TEAM_T:        return RED;
case CS_TEAM_SPECTATOR:    return GREY;

return GREEN;

Last edited by Snitch; 12-25-2014 at 08:10.
Snitch is offline
Send a message via Skype™ to Snitch
RateX
Veteran Member
Join Date: Jun 2012
Location: 0o. SEA .o0
Old 12-25-2014 , 07:31   Re: Warning: Tag mismatch
Reply With Quote #2

Couldn't see the whole code through my phone, but try:
PHP Code:
CsTeams:cs_get_user_team 

PHP Code:
_:cs_get_user_team 
And remove CsTeams from your var

Last edited by RateX; 12-25-2014 at 07:36.
RateX is offline
Snitch
Veteran Member
Join Date: Sep 2013
Location: Kazakhstan
Old 12-25-2014 , 08:09   Re: Warning: Tag mismatch
Reply With Quote #3

Quote:
Originally Posted by RateX View Post
Couldn't see the whole code through my phone, but try:
PHP Code:
CsTeams:cs_get_user_team 

PHP Code:
_:cs_get_user_team 
And remove CsTeams from your var
still tag mismatch

u mean:
Code:
stock GetTeamColor( CsTeams:iTeam )

Code:
stock GetTeamColor( iTeam )
it make more tag mismatch

can u explain?

and i tried:
Quote:
stock GetTeamColor( CsTeams:cs_get_user_team )
{
switch ( cs_get_user_team )
{
case CS_TEAM_CT: return BLUE;

case CS_TEAM_T: return RED;

case CS_TEAM_SPECTATOR: return GREY;
}

return GREEN;
}
still tag mismatch

Last edited by Snitch; 12-25-2014 at 08:12.
Snitch is offline
Send a message via Skype™ to Snitch
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 12-25-2014 , 12:24   Re: Warning: Tag mismatch
Reply With Quote #4

When I compile your code(with empty variables, just to test) I get no tag mistmatch and the above code should not give you one. Post the full code.
__________________
HamletEagle is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 12-25-2014 , 15:13   Re: Warning: Tag mismatch
Reply With Quote #5

Quote:
Originally Posted by HamletEagle View Post
When I compile your code(with empty variables, just to test) I get no tag mistmatch and the above code should not give you one. Post the full code.
__________________
HamletEagle is offline
Snitch
Veteran Member
Join Date: Sep 2013
Location: Kazakhstan
Old 12-25-2014 , 13:48   Re: Warning: Tag mismatch
Reply With Quote #6

No need full code that has lines that are not related to the subject.
PHP Code:
    if ( szMsg] != '~' )
        return 
0;
    
    
replaceszMsgcharsmaxszMsg ), "~""" );
    
    static 
Players32 ], iNumiPlayerszStatus32 ];
    
    
get_playersPlayersiNum );
    
    
formatexszStatuscharsmaxszStatus ), "*%s*",
    (
getStatusclientg_iGangclient ] ) == STATUS_OWNER) ? "Owner" : (getStatusclientg_iGangclient ] ) == STATUS_LEADER) ? "Leader" "Member" );
    
    for ( new 
iiNumi++ )
    {
        
iPlayer Players];
        
        if ( 
g_iGangiPlayer ] != g_iGangclient ] )
            continue;
        
        
ColorChatiPlayerGetTeamColorcs_get_user_teamclient ) ), "^3*^1%s^1[^3 %s ^1] %s^4 %s^1 :^3 %s"is_user_aliveclient ) ? " " "DEAD"aDataGangName ], szStatusszNameclient ), szMsg );
    }
    
    return 
1;
}


stock GetTeamColorCsTeams:iTeam )
{
    switch ( 
iTeam )
    {
        case 
CS_TEAM_CT:    return BLUE;
        
        case 
CS_TEAM_T:        return RED;
        
        case 
CS_TEAM_SPECTATOR:    return GREY;
    }
    
    return 
GREEN;

Snitch is offline
Send a message via Skype™ to Snitch
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 12-25-2014 , 16:32   Re: Warning: Tag mismatch
Reply With Quote #7

Look at ColorChat() function prototype. I am sure the second argument should be tagged, so GetTeamColor() should return a tagged value. Unfortunately, I don't remember which tag it is, so take a look at colorchat.inc.

Last edited by klippy; 12-25-2014 at 16:32. Reason: typo
klippy is offline
Snitch
Veteran Member
Join Date: Sep 2013
Location: Kazakhstan
Old 12-26-2014 , 02:19   Re: Warning: Tag mismatch
Reply With Quote #8

how. you dont get warning?

Quote:
Originally Posted by KliPPy View Post
Look at ColorChat() function prototype. I am sure the second argument should be tagged, so GetTeamColor() should return a tagged value. Unfortunately, I don't remember which tag it is, so take a look at colorchat.inc.
i dont think it colorchat.

something worng with my writing.
TbI Explain in detail what needs to change and try

Last edited by Snitch; 12-26-2014 at 02:20.
Snitch is offline
Send a message via Skype™ to Snitch
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-26-2014 , 04:53   Re: Warning: Tag mismatch
Reply With Quote #9

Quote:
Originally Posted by Snitch View Post
how. you dont get warning?


i dont think it colorchat.

something worng with my writing.
TbI Explain in detail what needs to change and try
If you get the tag mismatch and he doesn't, that means you have different color chat include files and it is, in fact, caused by this difference (assuming he tested the exact code that you posted).
__________________
fysiks is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 12-26-2014 , 04:54   Re: Warning: Tag mismatch
Reply With Quote #10

I get no warning when compiling your code with a random colorchat include. If you don't want to post your full code give us at least your colorchat.inc
__________________
HamletEagle is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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