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=114245)

One 01-03-2010 00:10

tag mismatch
 
hey,

i wanted to make a mini team balancer and i got following errors :( :

PHP Code:

new g_msg_teaminfo

new const g_teaminfo[][] = 

    
"UNASSIGNED"
    
"TERRORIST",
    
"CT",
    
"SPECTATOR" 
}

register_logevent("round_end"2"1=Round_End")
g_msg_teaminfo get_user_msgid("TeamInfo")

public 
round_end()
{
    
set_task(0.1"task_balanceteam"375)
}
public 
task_balanceteam()
{
    static 
players[3][32], count[3]
    
get_players(players[CS_TEAM_UNASSIGNED], count[CS_TEAM_UNASSIGNED])
    
    
count[CS_TEAM_T] = 0
    count
[CS_TEAM_CT] = 0
    
    
static iidteam
    
for(0count[CS_TEAM_UNASSIGNED]; i++)
    {
        
id players[CS_TEAM_UNASSIGNED][i
        
team fm_get_user_team(id)
        
        if(
team == CS_TEAM_T || team == CS_TEAM_CT)
            
players[team][count[team]++] = id
    
}

    if(
abs(count[CS_TEAM_T] - count[CS_TEAM_CT]) <= 1
        return

    static 
maxplayers
    maxplayers 
= (count[CS_TEAM_T] + count[CS_TEAM_CT]) / 2
    
    
if(count[CS_TEAM_T] > maxplayers)
    {
        for(
0< (count[CS_TEAM_T] - maxplayers); i++)
            
fm_set_user_team(players[CS_TEAM_T][i], CS_TEAM_CT0)
    }
    else
    {
        for(
0< (count[CS_TEAM_CT] - maxplayers); i++)
            
fm_set_user_team(players[CS_TEAM_CT][i], CS_TEAM_T0)
    }
}
stock fm_set_user_team(indexteamupdate 1)
{
    
set_pdata_int(indexOFFSET_TEAMteam)
    if(
update)
    {
        
emessage_begin(MSG_ALLg_msg_teaminfo)
        
ewrite_byte(index)
        
ewrite_string(g_teaminfo[team])
        
emessage_end()
    }
    return 
1


PHP Code:

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c1997-2006 ITB CompuPhaseAMX Mod X Team

Warning
Loose indentation on line 3310
Warning
Tag mismatch on line 3310
Warning
Tag mismatch on line 3310
Warning
Loose indentation on line 3312
Warning
Tag mismatch on line 3312
Warning
Tag mismatch on line 3313
Warning
Tag mismatch on line 3316
Warning
Tag mismatch on line 3318
Warning
Tag mismatch on line 3321
Warning
Tag mismatch on line 3321
Warning
Tag mismatch on line 3325
Warning
Tag mismatch on line 3325
Warning
Tag mismatch on line 3329
Warning
Tag mismatch on line 3329
Warning
Tag mismatch on line 3331
Warning
Tag mismatch on line 3333
Warning
Tag mismatch on line 3334
Warning
Tag mismatch on line 3334
Warning
Tag mismatch on line 3338
Warning
Tag mismatch on line 3339
Warning
Tag mismatch on line 3339
Header size
:           1716 bytes
Code size
:             9356 bytes
Data size
:             3812 bytes
Stack
/heap size:      16384 bytesestimated maxusage=780 cells (3120 bytes)
Total requirements:   31268 bytes

21 Warnings
.
Done

know anyone why its so?

Mxnn 01-03-2010 00:16

Re: tag mismatch
 
You don't have to clear the variables in pawn.

To delete the warning "Loose identation" you have to put Control+I in AMX Studio.

And for the tag mismatch: which are those lines?

One 01-03-2010 00:24

Re: tag mismatch
 
so tried with ctrl I and the same :P


line 3310 =

get_players(players[CS_TEAM_UNASSIGNED], count[CS_TEAM_UNASSIGNED])

edit : first post updated.


fysiks 01-03-2010 01:25

Re: tag mismatch
 
If you notice there is one tag mismatch for every CS_TEAM_* that is used. That should give you a clue what is causing it.

...

It's CS_TEAM_* !!

put "_:" before each one.

One 01-03-2010 01:45

Re: tag mismatch
 
oh. ty :P my bad :P its working now

Arkshine 01-03-2010 04:52

Re: tag mismatch
 
Why cs_set_user_team() is not used ?

One 01-03-2010 05:04

Re: tag mismatch
 
i wanted to experiment again :P

now using cstrike :P

xPaw 01-03-2010 06:05

Re: tag mismatch
 
just create players variable with CsTeams: prefix


All times are GMT -4. The time now is 04:08.

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