AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED] Tag mismatch in enum (https://forums.alliedmods.net/showthread.php?t=241424)

Jhob94 06-03-2014 09:22

[SOLVED] Tag mismatch in enum
 
Hum, iam getting a warning of tag mismatch in the client print:

PHP Code:

#include <amxmodx>
#include <amxmisc>

static const Fdc_Names[][] = {
    
"Kills",
    
"Deaths",
    
"HeadShot Kills",
    
"HeadShot Deaths"
}


enum WeaponData 
{
    
Data_Kills,
    
Data_Deaths,
    
Data_Kills_Hs,
    
Data_Deaths_Hs


new 
g_WeaponData[CSW_P90 1][WeaponData

public 
plugin_init()
{
    
register_concmd("fdc_kills""AdminCommand_FDC"ADMIN_CVAR"<weaponname> <0/1>")
    
register_concmd("fdc_deaths""AdminCommand_FDC"ADMIN_CVAR"<weaponname> <0/1>")
    
register_concmd("fdc_hs_kills""AdminCommand_FDC"ADMIN_CVAR"<weaponname> <0/1>")
    
register_concmd("fdc_hs_deaths""AdminCommand_FDC"ADMIN_CVAR"<weaponname> <0/1>")
}

public 
AdminCommand_FDC(idlvlcid)
{
    if(
cmd_access(idlvlcid3))
    {
        new 
Command[14]
        
read_argv(0Commandcharsmax(Command))
        new 
WeaponDataDataType
            
        
switch(Command[7])
        {
            case 
'l'DataType Data_Kills
            
            
case 't'DataType Data_Deaths
            
            
case 'k'DataType Data_Kills_Hs
            
            
case 'd'DataType Data_Deaths_Hs
            
            
default :
            {
                
client_print(idprint_console"Usage: fdc_kills/fdc_deaths/fdc_hs_kills/fdc_hs_deaths <weaponname> <amount>")
                return 
PLUGIN_HANDLED
            
}
        }
        
        new 
Amount[10], szWeapon[20] = "weapon_"
        
read_argv(1szWeapon[7], charsmax(szWeapon)-7)
        
read_argv(2Amountcharsmax(Amount))
        
        new 
iId get_weaponid(szWeapon)
        
        if(
iId)
        {
            
g_WeaponData[iId][DataType] = str_to_num(Amount)
            
// Tag mismatch
            
client_print(idprint_console"You have changed %s's %s to %d!"szWeapon[7], Fdc_Names[DataType], Amount)
        }
        
        else
            
client_print(idprint_console"Sorry, %s is not a valid weapon!"szWeapon[7])
    }
    return 
PLUGIN_HANDLED



DWIGHTpN 06-03-2014 09:41

Re: Tag mismatch in enum
 
Here

Jhob94 06-03-2014 10:57

Re: [SOLVED] Tag mismatch in enum
 
Thanks :)


All times are GMT -4. The time now is 09:36.

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