Raised This Month: $ Target: $400
 0% 

Help with Tag mismatch


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kulers2010
Junior Member
Join Date: Oct 2011
Location: Latvia
Old 07-09-2012 , 16:31   Help with Tag mismatch
Reply With Quote #1

Hi i making plugin but i have lots of Mismatch, and i dont know why.


Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

Warning: Tag mismatch on line 64
Warning: Tag mismatch on line 82
Warning: Tag mismatch on line 88
Warning: Tag mismatch on line 118
Warning: Tag mismatch on line 134
Warning: Tag mismatch on line 266
Warning: Tag mismatch on line 267
Warning: Tag mismatch on line 268
Warning: Tag mismatch on line 300
Header size: 1884 bytes
Code size: 15028 bytes
Data size: 4624 bytes
Stack/heap size: 16384 bytes; estimated max. usage=781 cells (3124 bytes)
Total requirements: 37920 bytes

9 Warnings.
Done.
kulers2010 is offline
Send a message via Skype™ to kulers2010
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 07-09-2012 , 16:42   Re: Help with Tag mismatch
Reply With Quote #2

Code:
if(get_user_team(i)==CS_TEAM_T)

PHP Code:
if(cs_get_user_team(i)==CS_TEAM_T
cs_get_user_team returns the CS_TEAM constant. the other can get funky. But still should work....whatever reason....that should fix it. Apply that to all of those errors

line 266 - 268
Code:
origin[0] = 0;
    origin[1] = 0;
    origin[2] = -100000;

PHP Code:
origin[0] = 0.0;
    
origin[1] = 0.0;
    
origin[2] = -100000.0
Floats REQUIRE the '.0' at the end. That's how the compiler/engine knows its a float, rather than an int.
__________________
What an elegant solution to a problem that doesn't need solving....

Last edited by Liverwiz; 07-09-2012 at 16:42.
Liverwiz is offline
kulers2010
Junior Member
Join Date: Oct 2011
Location: Latvia
Old 07-09-2012 , 18:13   Re: Help with Tag mismatch
Reply With Quote #3

There i have finished and all corect exept

Quote:
gFalls[id] = gFalls[id]+1;
Count sometime 1 time sometime 2
Score gPoints
Quote:
gPoints[i] = gPoints[i]+1
Its count 3 times every game ending but i need only one, and gFall need to add 1 not 2
you can try fall from edge and yot see its count sometime 1 sometime 2 ,and game ending 3+ when you are TERRORISTS


Quote:
Its happaning only if mor than 1 real player

Last edited by kulers2010; 07-09-2012 at 18:31. Reason: Its happaning only if mor than 1 real player
kulers2010 is offline
Send a message via Skype™ to kulers2010
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 07-09-2012 , 21:11   Re: Help with Tag mismatch
Reply With Quote #4

few things....
Code:
gPoints[i] = gPoints[i]+1

PHP Code:
gPoints[player]++ 
It looks better and will guarantee (providing your logic is right) only a single increment.

and do you for looop like this....
PHP Code:
new players[32], cntplayer
get_players
(playerscnt"dch")

for(new 
0cnti++)
{
    
player players[i]
    
// replace player with i 
This will make your code faster. By returning only valid players that are alive, not bots, and not HLTV.
see the wiki.... http://www.amxmodx.org/funcwiki.php?go=func&id=174

see if that fixes your bugs.
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-09-2012 , 23:36   Re: Help with Tag mismatch
Reply With Quote #5

Quote:
Originally Posted by Liverwiz View Post
few things....
Code:
gPoints[i] = gPoints[i]+1

PHP Code:
gPoints[player]++ 
It looks better and will guarantee (providing your logic is right) only a single increment.
I agree that it looks better but your other statement is completely false. Both codes work exactly the same and provides no additional guarantees.
__________________
fysiks is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-09-2012 , 23:45   Re: Help with Tag mismatch
Reply With Quote #6

His way: 32 loop iterations, 8 native calls per (for alive\connected\team\bot checking, twice)
get_players: No excess iterations and no other natives.

His code can be optimized a bit, and FYI, if you are ever checking if connected AND alive, just check if alive because that includes a connected check.
PHP Code:
new g_iMaxPlayers;

g_iMaxPlayers get_maxplayers();

for ( new 
<= g_iMaxPlayers i++ )
{
    if ( !
is_user_alive) || is_user_bot) )
        continue;
    
    switch ( 
get_user_team) )
    {
        case 
CS_TEAM_T:
        {
            
        }
        case 
CS_TEAM_CT:
        {
            
        }
    }

__________________

Last edited by Bugsy; 07-09-2012 at 23:52.
Bugsy is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 07-09-2012 , 23:46   Re: Help with Tag mismatch
Reply With Quote #7

Quote:
Originally Posted by fysiks View Post
I agree that it looks better but your other statement is completely false. Both codes work exactly the same and provides no additional guarantees.
"providing your logic is right" ;)
But i have a feeling it was mostly in the way he went through the players...
Unless i missed soemthing in the event call.

EDIT: oh yeah, that switch statement. Also use bugsy's switch statement. But keep the get_players stuff.
__________________
What an elegant solution to a problem that doesn't need solving....

Last edited by Liverwiz; 07-09-2012 at 23:50.
Liverwiz is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-09-2012 , 23:48   Re: Help with Tag mismatch
Reply With Quote #8

Quote:
Originally Posted by Liverwiz View Post
"providing your logic is right"
That statement doesn't make sense and therefore doesn't negate my response.
__________________
fysiks 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:23.


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