AlliedModders

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

kulers2010 07-09-2012 16:31

Help with Tag mismatch
 
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.

Liverwiz 07-09-2012 16:42

Re: Help with Tag mismatch
 
Code:

if(get_user_team(i)==CS_TEAM_T)
:arrow:
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;

:arrow:
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.

kulers2010 07-09-2012 18:13

Re: Help with Tag mismatch
 
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

Liverwiz 07-09-2012 21:11

Re: Help with Tag mismatch
 
few things....
Code:

gPoints[i] = gPoints[i]+1
:arrow:
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.

fysiks 07-09-2012 23:36

Re: Help with Tag mismatch
 
Quote:

Originally Posted by Liverwiz (Post 1747057)
few things....
Code:

gPoints[i] = gPoints[i]+1
:arrow:
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.

Bugsy 07-09-2012 23:45

Re: Help with Tag mismatch
 
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:
        {
            
        }
    }



Liverwiz 07-09-2012 23:46

Re: Help with Tag mismatch
 
Quote:

Originally Posted by fysiks (Post 1747118)
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.

fysiks 07-09-2012 23:48

Re: Help with Tag mismatch
 
Quote:

Originally Posted by Liverwiz (Post 1747127)
"providing your logic is right"

That statement doesn't make sense and therefore doesn't negate my response.


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

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