AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved how to fix warning 213: tag mismatch (https://forums.alliedmods.net/showthread.php?t=326014)

alferd 07-15-2020 06:21

how to fix warning 213: tag mismatch
 
warnings:
PHP Code:

//// ad_Jailbreak.sma
//
// C:\PROGRA~1\COUNTE~4\cstrike\addons\amxmodx\SCRIPT~1\ad_Jailbreak.sma(981) : w
arning 213tag mismatch
// C:\PROGRA~1\COUNTE~4\cstrike\addons\amxmodx\SCRIPT~1\ad_Jailbreak.sma(1378) :
warning 213tag mismatch
// C:\PROGRA~1\COUNTE~4\cstrike\addons\amxmodx\SCRIPT~1\ad_Jailbreak.sma(1785) :
warning 213tag mismatch
// C:\PROGRA~1\COUNTE~4\cstrike\addons\amxmodx\SCRIPT~1\ad_Jailbreak.sma(1871) :
warning 213tag mismatch
// C:\PROGRA~1\COUNTE~4\cstrike\addons\amxmodx\SCRIPT~1\ad_Jailbreak.sma(4132) :
warning 213tag mismatch
// C:\PROGRA~1\COUNTE~4\cstrike\addons\amxmodx\SCRIPT~1\ad_Jailbreak.sma(4144) :
warning 213tag mismatch
// C:\PROGRA~1\COUNTE~4\cstrike\addons\amxmodx\SCRIPT~1\ad_Jailbreak.sma(4155) :
warning 213tag mismatch
// C:\PROGRA~1\COUNTE~4\cstrike\addons\amxmodx\SCRIPT~1\ad_Jailbreak.sma(4166) :
warning 213tag mismatch
// C:\PROGRA~1\COUNTE~4\cstrike\addons\amxmodx\SCRIPT~1\ad_Jailbreak.sma(4177) :
warning 213tag mismatch
// C:\PROGRA~1\COUNTE~4\cstrike\addons\amxmodx\SCRIPT~1\ad_Jailbreak.sma(4188) :
warning 213tag mismatch
// C:\PROGRA~1\COUNTE~4\cstrike\addons\amxmodx\SCRIPT~1\ad_Jailbreak.sma(4199) :
warning 213tag mismatch
// C:\PROGRA~1\COUNTE~4\cstrike\addons\amxmodx\SCRIPT~1\ad_Jailbreak.sma(4235) :
warning 213tag mismatch
// C:\PROGRA~1\COUNTE~4\cstrike\addons\amxmodx\SCRIPT~1\ad_Jailbreak.sma(5969) :
warning 213tag mismatch
// C:\PROGRA~1\COUNTE~4\cstrike\addons\amxmodx\SCRIPT~1\ad_Jailbreak.sma(9626) :
warning 213tag mismatch
// C:\PROGRA~1\COUNTE~4\cstrike\addons\amxmodx\SCRIPT~1\ad_Jailbreak.sma(9704) :
warning 213tag mismatch
// C:\PROGRA~1\COUNTE~4\cstrike\addons\amxmodx\SCRIPT~1\ad_Jailbreak.sma(10176) :
 
warning 211possibly unintended assignment
// Header size:          11760 bytes
// Code size:           292340 bytes
// Data size:           237628 bytes
// Stack/heap size:      16384 bytes
// Total requirements:  558112 bytes
//
// 16 Warnings.
// Done.
//
// Compilation Time: 3.51 sec
// ---------------------------------------- 

Code:
    for(i = 0; i < iNum; i++)     {         new id = iPlayers[i]        
        if( cs_get_user_team(id) == 2 ) // Line 9626
        {             if(!get_pcvar_num(pCvarEnabled))             {                 return HAM_IGNORED             }                 if(get_pcvar_num(pCvarBlockDoorButtons) && pev(iEnt,pev_no_open))             {                 return HAM_IGNORED             }                 dllfunc(DLLFunc_Use, iEnt, iAttacker)             return HAM_IGNORED         }     }

Shadows Adi 07-15-2020 06:33

Re: how to fix warning 213: tag mismatch
 
You should use CS_TEAM_* to get team of the players.

alferd 07-15-2020 06:38

Re: how to fix warning 213: tag mismatch
 
Quote:

Originally Posted by Shadows Adi (Post 2710168)
You should use CS_TEAM_* to get team of the players.

Thanks

PHP Code:

// C:\PROGRA~1\COUNTE~4\cstrike\addons\amxmodx\SCRIPT~1\ad_Jailbreak.sma(10176) :
 
warning 211possibly unintended assignment 

Code:
        while( ent = engfunc(EngFunc_FindEntityByString, ent, "classname", "info_player_deathmatch") ) // Line 10176
        {                 new ent2 = 1                 pev(ent, pev_origin, origin)                 while((ent2 = engfunc(EngFunc_FindEntityInSphere, ent2, origin, radius)))  // find doors near T spawn                 {                         if(!pev_valid(ent2))                                 continue                         pev(ent2, pev_classname, class, charsmax(class))                         if(!equal(class, "func_door")) // if it's not a door, move on to the next iteration                                 continue                         pev(ent2, pev_targetname, name, charsmax(name))                         ent3 = engfunc(EngFunc_FindEntityByString, 0, "target", name) // find button that opens this door                         if(pev_valid(ent3) && (in_array(ent3, found, sizeof(found)) < 1))                         {                                 ExecuteHamB(Ham_Use, ent3, 0, 0, 1, 1.0) // zomg poosh it                                 break // break from current while loop                         }                 }         }

Do you know a way to solve this problem?

Shadows Adi 07-15-2020 06:40

Re: how to fix warning 213: tag mismatch
 
PHP Code:

ent engfunc 

-->>

PHP Code:

ent == engfunc 


alferd 07-15-2020 06:41

Re: how to fix warning 213: tag mismatch
 
Quote:

Originally Posted by Shadows Adi (Post 2710170)
PHP Code:

ent engfunc 

-->>

PHP Code:

ent == engfunc 


Thanks a lot ;)

HamletEagle 07-15-2020 07:49

Re: how to fix warning 213: tag mismatch
 
Actually no. You should put the entire condition in () and leave =, not ==

Shadows Adi 07-15-2020 08:10

Re: how to fix warning 213: tag mismatch
 
Quote:

Originally Posted by HamletEagle (Post 2710178)
Actually no. You should put the entire condition in () and leave =, not ==

Yea, lol, forgot about that =))

alferd 07-15-2020 08:24

Re: how to fix warning 213: tag mismatch
 
Quote:

Originally Posted by HamletEagle (Post 2710178)
Actually no. You should put the entire condition in () and leave =, not ==

:D
Thanks for pointing me to this

PHP Code:

while( engfunc(EngFunc_FindEntityByStringent"classname""info_player_deathmatch") ) 

?

HamletEagle 07-15-2020 11:06

Re: how to fix warning 213: tag mismatch
 
That's not what I said. You have an example in the second while loop.

PHP Code:

while((var = something)) 

This is the equivalent of:
PHP Code:

var = something
while(var)
{
    
//code that uses var
    
var = something



Natsheh 07-15-2020 11:08

Re: how to fix warning 213: tag mismatch
 
PHP Code:

while( (ent engfunc(EngFunc_FindEntityByStringent"classname""info_player_deathmatch")) > 0



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

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