AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Error Tag Mismatch (https://forums.alliedmods.net/showthread.php?t=164390)

deadman909 08-10-2011 22:05

Error Tag Mismatch
 
Can somebody tell me why I get this error: Warning 213 - Tag Mismatch

For This lines:
static CsTeams:user_team;

user_team = cs_get_user_team(id);

PHP Code:

new bool:b_FirstLaunch[33]

public 
client_putinserver(id)
{
    
b_FirstLaunch[id] = true
}

public 
client_disconnect(id)
{
    if (
b_FirstLaunch[id])
        
b_FirstLaunch[id] = false
}

public 
fn_CheckTeam(id)
{
    if (
b_FirstLaunch[id])
    {
        
b_FirstLaunch[id] = false

        
static CsTeams:user_team;

        
user_team cs_get_user_team(id);

        switch (
user_team)
        {
            case 
CS_TEAM_CT:
            
ShopCT(id)

            case 
CS_TEAM_T:
            
ShopT(id)
        }
    }



hornet 08-10-2011 23:11

Re: Error Tag Mismatch
 
Are you sure it's giving you a warning? I just compiled that exact code with no warnings or errors.

deadman909 08-11-2011 00:16

Re: Error Tag Mismatch
 
Quote:

Originally Posted by hornet (Post 1530031)
Are you sure it's giving you a warning? I just compiled that exact code with no warnings or errors.

Hmm well in another part of the code i have this

Could it be because the numbers are the same [33]

If so how do I know what numbers can go there?

new bool:speed1[33]

Doc-Holiday 08-11-2011 01:13

Re: Error Tag Mismatch
 
post all your code

deadman909 08-11-2011 02:44

Re: Error Tag Mismatch
 
Im using this
PHP Code:

#include <amxmodx>
#include <fakemeta_util>
#include <cstrike>
#include <fun>

#define PLUGIN_NAME "TEAM NAMES"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "=TEAM NAMES"

new bool:b_FirstLaunch[33];

// default names
new const TeamT[] = "\yEVIL"        // Terrorists
new const TeamCT[] = "\yBRAVE"    // Counter-Terrorists

// default round end sounds
#define SOUND_CT_WIN "music/downed_intro.mp3"
#define SOUND_T_WIN "music/motor_intro.mp3"
//new const SoundT[] = "music/downed_intro.mp3"
//new const SoundCT[] = "music/motor_intro.mp3"

// Some useful code (thx to arkshine)
enum
{
    
CS_TEAM_UNASSIGNED 0,
    
CS_TEAM_T,
    
CS_TEAM_CT,
    
CS_TEAM_SPECTATOR
}

#define OFFSET_TEAM  114 
#define cs_get_user_team(%1)     get_pdata_int( %1, OFFSET_TEAM ) 

#define OFFSET_DEATHS  444
#define cs_get_user_deaths(%1)     get_pdata_int( %1, OFFSET_DEATHS )
#define cs_set_user_deaths(%1,%2)  set_pdata_int( %1, OFFSET_DEATHS, %2 )

// Some variables
new mChooseTeam
new showMsg 0

//new pcTeamT, pcTeamCT, pcSoundT, pcSoundCT, pcUseSounds
new pcTeamTpcTeamCT

public plugin_init() {
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR);

    
register_message(get_user_msgid("ShowMenu"), "message_show_menu");
    
register_event("ResetHUD""set_hud""be");

    
register_clcmd"say /shopT""ShopT" );
    
register_clcmd"say /shopCT""ShopCT" );

    
// change round end message / sounds
    
register_message(get_user_msgid("SendAudio"), "message_sendaudio");
    
register_message(get_user_msgid("TextMsg"), "message_textmsg");

    
pcTeamT register_cvar("ctn_team_t"TeamT);
    
pcTeamCT register_cvar("ctn_team_ct"TeamCT);
    
//pcUseSounds = register_cvar("ctn_use_sounds", "1");
    //pcSoundT  = register_cvar("ctn_sound_t", SoundT);
    //pcSoundCT = register_cvar("ctn_sound_ct", SoundCT);
    
    
register_clcmd("chooseteam""cmdBlock");

    
createMenu();

    return 
PLUGIN_CONTINUE;
}

public 
ShopCT(id)
{
    new 
menu menu_create("\yWhat well you buy?""CTsubmenu_handler")

    
menu_additem(menu"\wExtra 35 HP for ($5000)""1"0);
    
menu_additem(menu"\wExtra 60 HP for ($10000)""1"0);

    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
}

public 
CTsubmenu_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    new 
data[6], szName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,charsmax(data), szName,charsmax(szName), callback);

    new 
key str_to_num(data);

    switch(
key)
    {
        case 
1:
        {
           if(
cs_get_user_moneyid ) < 5000
           {
               
client_print(idprint_chat"You do not have enough money.")
               return 
PLUGIN_CONTINUE
           
}
           
set_user_health(idget_user_health(id) + 35)
           
cs_set_user_money(idcs_get_user_money(id) - 5500)
        }
        case 
2:
        {
           if(
cs_get_user_moneyid ) < 12000)
           {
               
client_print(idprint_chat"You do not have enough money.")
               return 
PLUGIN_CONTINUE
           
}
           
set_user_health(idget_user_health(id) + 65)     
           
cs_set_user_money(idcs_get_user_money(id) - 10000)
        }

    }
    return 
PLUGIN_HANDLED;
}

public 
ShopT(id)
{
    new 
menu menu_create("\yWhat well you buy?""submenu_handler")

    
menu_additem(menu"\wExtra 25 HP for ($5000)""1"0);
    
menu_additem(menu"\wExtra 50 HP for ($10000)""1"0);

    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
}

public 
submenu_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    new 
data[6], szName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,charsmax(data), szName,charsmax(szName), callback);

    new 
key str_to_num(data);

    switch(
key)
    {
        case 
1:
        {
           if(
cs_get_user_moneyid ) < 5000
           {
               
client_print(idprint_chat"You do not have enough money.")
               return 
PLUGIN_CONTINUE
           
}
           
set_user_health(idget_user_health(id) + 25)
           
cs_set_user_money(idcs_get_user_money(id) - 5000)
        }
        case 
2:
        {
           if(
cs_get_user_moneyid ) < 10000)
           {
               
client_print(idprint_chat"You do not have enough money.")
               return 
PLUGIN_CONTINUE
           
}
           
set_user_health(idget_user_health(id) + 50)     
           
cs_set_user_money(idcs_get_user_money(id) - 10000)
        }

    }
    return 
PLUGIN_HANDLED;
}

public 
client_putinserver(id)
{
    
b_FirstLaunch[id] = true
}

public 
client_disconnect(id)
{
    if (
b_FirstLaunch[id])
        
b_FirstLaunch[id] = false
}

public 
fn_CheckTeam(id)
{
    if (
b_FirstLaunch[id])
    {
        
b_FirstLaunch[id] = false

        
static CsTeams:user_team;

        
user_team cs_get_user_team(id);

        switch (
user_team)
        {
            case 
CS_TEAM_CT:
            
ShopCT(id)

            case 
CS_TEAM_T:
            
ShopT(id)
        }
    }
}

public 
client_connect(id)
{
    
set_user_info(id"_vgui_menus""0");

    return 
PLUGIN_CONTINUE;
}

public 
set_hud(id) {
    
showMsg 0;

    
set_task(0.2"fixHUD"id);
    
set_task(0.3"fadeOut"id);

    return 
PLUGIN_CONTINUE;
}

public 
fixHUD(id) {
    
// some fixes if the HUD is destroyed
    
if (!user_has_weapon(idCSW_KNIFE))
    {
        
fm_set_user_suit(id);
        
fm_give_item(id"weapon_knife");

        switch (
cs_get_user_team(id))
        {
            case 
CS_TEAM_CT:
            {
                
fm_give_item(id"weapon_usp");
                
fm_give_item(id"ammo_45acp");
            }

            case 
CS_TEAM_T:
            {
                
fm_give_item(id"weapon_glock18");
                
fm_give_item(id"ammo_9mm");
            }
        }
    }

    return 
PLUGIN_CONTINUE;
}

// end of a round
public round_end_msg(params[]) {
    if (
showMsg == 1)
    {
        
client_print(0print_center"%s win!"params);
        
set_task(0.2"round_end_msg"0params128);
    }
}

public 
message_textmsgmsg_idmsg_destmsg_entity )
{
    static 
message[10];
    
get_msg_arg_string2messagesizeof  message );

    if( 
message[1] == 'T' && message[2] == 'e' // #Terrorists_Win message
    
{
        
set_hudmessage(255,0,0,-1.0,0.3,0,2.0,2.0,0.0,0.0,-1)
        
show_hudmessage0"Terro Message Here")
        return 
PLUGIN_HANDLED
    }
    else if( 
message[1] == 'C' && (message[2] == 'T' || message[2] == 't') )
    {
        
set_hudmessage(0,64,255,-1.0,0.3,0,2.0,2.0,0.0,0.0,-1)
        
show_hudmessage0"CT Message Here")
        return 
PLUGIN_HANDLED
    }
    
    return 
PLUGIN_CONTINUE;
}

// sounds
public fadeOut()
{
    
client_cmd(0"cd fadeout");
    return 
PLUGIN_CONTINUE;
}

public 
message_sendaudiomsg_idmsg_destmsg_entity )
{
    static 
message[10];
    
get_msg_arg_string2messagesizeof  message );

    if( 
message[7] == 't' )
    {
        
client_cmdmsg_entity"spk path/to/sound.extension" ); // or mp3 play
        // What you want to do other than sound
        
return PLUGIN_HANDLED
    }
    else if( 
message[7] == 'c' )
    {
        
client_cmdmsg_entity"spk path/to/sound.extension" ); // or mp3 play
        // What you want to do other than sound.
        
return PLUGIN_HANDLED
    }

    return 
PLUGIN_CONTINUE;
}

public 
cmdBlock(id)
{
    
menu_display(idmChooseTeam0);
    return 
PLUGIN_HANDLED;
}

// custom menu
public createMenu() {
    
mChooseTeam menu_create("\wCHOOSE WHAT FORCE YOU WANT""mh_ChooseTeam");

    new 
t_name[128], ct_name[128];
    
get_pcvar_string(pcTeamTt_name127);
    
get_pcvar_string(pcTeamCTct_name127);

    
menu_additem(mChooseTeamt_name"ma_ChooseTeam"ADMIN_ALL);
    
menu_additem(mChooseTeamct_name"ma_ChooseTeam"ADMIN_ALL);
    
menu_additem(mChooseTeam"\rPokemon Spectator""ma_ChooseTeam"ADMIN_ALL);

    return 
PLUGIN_CONTINUE;
}

public 
message_show_menu(msgiddestid) {
    if (
get_user_team(id) || task_exists(id))
        return 
PLUGIN_CONTINUE;

    static 
team_select[] = "#Team_Select";
    static 
menu_text_code[sizeof team_select];

    
get_msg_arg_string(4menu_text_codesizeof menu_text_code 1);

    if (!
equal(menu_text_codeteam_select))
        return 
PLUGIN_CONTINUE;

    
set_task(0.1"force_team_join"id);

    return 
PLUGIN_HANDLED;
}

public 
force_team_join(id) {
    
engclient_cmd(id"jointeam""6");
    
menu_display(idmChooseTeam0);

    return 
PLUGIN_CONTINUE;
}

public 
mh_ChooseTeam(idmenuitem) {
    switch (
item)
    {
        case -
3: return PLUGIN_HANDLED;

        case 
0:
            if (
cs_get_user_team(id) == CS_TEAM_T)
                return 
PLUGIN_HANDLED;
        
        case 
1:
            if (
cs_get_user_team(id) == CS_TEAM_CT)
                return 
PLUGIN_HANDLED;

        case 
2:
            if (
cs_get_user_team(id) == CS_TEAM_SPECTATOR)
                return 
PLUGIN_HANDLED;
    }    

    if (
cs_get_user_team(id) != CS_TEAM_SPECTATOR)
    {
        
user_silentkill(id);
        
cs_set_user_deaths(idcs_get_user_deaths(id) - 1);
    }

    
cs_set_user_team(iditem 1random_num(15));

    
// restart round if there is only one player (excl. bot)
    
new Players[32], playerCount;
    
get_players(PlayersplayerCount"c");

    if (
playerCount == 1)
        
server_cmd("sv_restart 1");

    return 
PLUGIN_HANDLED;
}

public 
plugin_precache() {

        
#if defined SOUND_CT_WIN
                
precache_sound(SOUND_CT_WIN);
        
#endif
        #if defined SOUND_T_WIN
                
precache_sound(SOUND_T_WIN);
        
#endif



ConnorMcLeod 08-11-2011 02:48

Re: Error Tag Mismatch
 
Remove that teams enum.

deadman909 08-11-2011 03:08

Re: Error Tag Mismatch
 
If I remove this I get all those new errors down at bottom
PHP Code:

enum
{
    
CS_TEAM_UNASSIGNED 0,
    
CS_TEAM_T,
    
CS_TEAM_CT,
    
CS_TEAM_SPECTATOR


// C:\Users\DeadMan\Desktop\Compiler\team_names - Copy.sma(188 : warning 213: t
ag mismatch
// C:\Users\DeadMan\Desktop\Compiler\team_names - Copy.sma(352) : warning 213: t
ag mismatch
// C:\Users\DeadMan\Desktop\Compiler\team_names - Copy.sma(356) : warning 213: t
ag mismatch
// C:\Users\DeadMan\Desktop\Compiler\team_names - Copy.sma(360) : warning 213: t
ag mismatch
// C:\Users\DeadMan\Desktop\Compiler\team_names - Copy.sma(364) : warning 213: t
ag mismatch

ConnorMcLeod 08-11-2011 04:10

Re: Error Tag Mismatch
 
Again you haven't gave the whole code.

new team_names[CsTeams][]

deadman909 08-11-2011 04:13

Re: Error Tag Mismatch
 
Quote:

Originally Posted by ConnorMcLeod (Post 1530117)
Again you haven't gave the whole code.

new team_names[CsTeams][]

What you mean it is the exact same code exept I removed what you told me.

ConnorMcLeod 08-11-2011 06:23

Re: Error Tag Mismatch
 
Remove :

#define OFFSET_TEAM 114
#define cs_get_user_team(%1) get_pdata_int( %1, OFFSET_TEAM )

#define OFFSET_DEATHS 444
#define cs_get_user_deaths(%1) get_pdata_int( %1, OFFSET_DEATHS )
#define cs_set_user_deaths(%1,%2) set_pdata_int( %1, OFFSET_DEATHS, %2 )


And remove all fm_ things

fm_give_item -> give_item


All times are GMT -4. The time now is 03:29.

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