Raised This Month: $32 Target: $400
 8% 

warning 213: tag mismatch


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
joac1144
Senior Member
Join Date: Dec 2012
Location: Copenhagen, Denmark
Old 02-04-2014 , 13:11   warning 213: tag mismatch
Reply With Quote #1

Warning 213: tag mismatch
PHP Code:
TF2_StunPlayer(target_list[i], duration_TF_STUNFLAG_THIRDPERSONiAttacker); 
Warning 213: tag mismatch
PHP Code:
TF2_MakeBleed(target_list[i], iAttackerduration); 
Can anyone please help me to fix this?
I really can't find out what is wrong with the tags
__________________

Last edited by joac1144; 02-05-2014 at 08:50.
joac1144 is offline
Root_
Veteran Member
Join Date: Jan 2012
Location: ryssland
Old 02-04-2014 , 13:13   Re: warning 213: tag mismatch
Reply With Quote #2

duration must be float value.
__________________


dodsplugins.com - Plugins and Resources for Day of Defeat
http://twitch.tv/zadroot
Root_ is offline
joac1144
Senior Member
Join Date: Dec 2012
Location: Copenhagen, Denmark
Old 02-04-2014 , 13:30   Re: warning 213: tag mismatch
Reply With Quote #3

Quote:
Originally Posted by Root_ View Post
duration must be float value.
I'll just post the whole code.
Stun
PHP Code:
public Action:Command_Stun(clientargs)
{
    new 
String:Target[32], String:time[32], String:attacker[32];
    new 
duration GetConVarInt(sm_stun_duration);
 
    
GetCmdArg(1Targetsizeof(Target));
    
    if (
args >= && GetCmdArg(2timesizeof(time)))
    {
        
duration StringToInt(time);
    }
    
    
GetCmdArg(3attackersizeof(attacker));
    new 
iAttacker FindTarget(clientattackerfalsetrue);
    
    if (
args 2)
    {
        
PrintToChat(client"[SM] Usage: sm_stun <name or #userid> <duration>");
    }
 
    new 
String:target_name[MAX_TARGET_LENGTH];
    new 
target_list[MAXPLAYERS], target_count;
    new 
bool:tn_is_ml;
 
    if ((
target_count ProcessTargetString(
            
Target,
            
client,
            
target_list,
            
MAXPLAYERS,
            
COMMAND_FILTER_ALIVE,
            
target_name,
            
sizeof(target_name),
            
tn_is_ml)) <= 0)
    {
        
ReplyToTargetError(clienttarget_count);
        return 
Plugin_Handled;
    }
 
    for (new 
0target_counti++)
    {
        
TF2_StunPlayer(target_list[i], duration_TF_STUNFLAG_THIRDPERSONiAttacker);
        
LogAction(clienttarget_list[i], "Admin %L stunned %L"clienttarget_list[i]);
    }
 
    if (
tn_is_ml)
    {
        
ShowActivity2(client"[SM] ""Stunned %s"target_name);
    }
    else
    {
        
ShowActivity2(client"[SM] ""Stunned %s"target_name);
    }
 
    return 
Plugin_Handled;

Bleed
PHP Code:
public Action:Command_Bleed(clientargs)
{
    new 
String:Target[32], String:time[32];
    new 
duration GetConVarInt(sm_bleed_duration);
 
    
GetCmdArg(1Targetsizeof(Target));
    
    if (
args >= && GetCmdArg(2timesizeof(time)))
    {
        
duration StringToInt(time);
    }
    
    if (
args 2)
    {
        
PrintToChat(client"[SM] Usage: sm_bleed <name or #userid> <duration>");
    }
 
    new 
String:target_name[MAX_TARGET_LENGTH];
    new 
target_list[MAXPLAYERS], target_count;
    new 
bool:tn_is_ml;
 
    if ((
target_count ProcessTargetString(
            
Target,
            
client,
            
target_list,
            
MAXPLAYERS,
            
COMMAND_FILTER_ALIVE,
            
target_name,
            
sizeof(target_name),
            
tn_is_ml)) <= 0)
    {
        
ReplyToTargetError(clienttarget_count);
        return 
Plugin_Handled;
    }
 
    new 
String:attacker[32];
    
GetCmdArg(3attackersizeof(attacker));
    new 
iAttacker FindTarget(clientattacker);
 
    for (new 
0target_counti++)
    {
        
TF2_MakeBleed(target_list[i], iAttackerduration);
        
LogAction(clienttarget_list[i], "Admin %L toggled bleed on %L"clienttarget_list[i]);
    }
 
    if (
tn_is_ml)
    {
        
ShowActivity2(client"[SM] ""Toggled bleed on %s"target_name);
    }
    else
    {
        
ShowActivity2(client"[SM] ""Toggled bleed on %s"target_name);
    }
 
    return 
Plugin_Handled;

>This is not the WHOLE plugin code, but the whole code of the commands<
__________________

Last edited by joac1144; 02-05-2014 at 08:51. Reason: Forgot something
joac1144 is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 02-04-2014 , 14:01   Re: warning 213: tag mismatch
Reply With Quote #4

The question is already answered..
KissLick is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 02-04-2014 , 14:55   Re: warning 213: tag mismatch
Reply With Quote #5

Quote:
Originally Posted by joac1144 View Post
It IS a float value, I have set it to 5.0
PHP Code:
new duration GetConVarInt(sm_stun_duration); 
No it isn't, you're reading it out as an int. What you need is

PHP Code:
new Float:duration GetConVarFloat(sm_stun_duration); 
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 02-04-2014 , 14:56   Re: warning 213: tag mismatch
Reply With Quote #6

It must be a float. You may SAY that you are using a float, but you are lying. You are even using GetConVarInt() and StringToInt(). Int is not the same thing as float. Int means integer. Integers are not floating point values.

Change this:

Code:
new duration = GetConVarInt(sm_stun_duration);
to this:

Code:
new Float:duration = GetConVarFloat(sm_stun_duration);
This:

Code:
duration = StringToInt(time);
to this:

Code:
duration = StringToFloat(time);
__________________

Last edited by ddhoward; 02-04-2014 at 14:57.
ddhoward is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 02-04-2014 , 16:42   Re: warning 213: tag mismatch
Reply With Quote #7

This is not like Python or PHP.. look at tut on SM wiki.
KissLick is offline
joac1144
Senior Member
Join Date: Dec 2012
Location: Copenhagen, Denmark
Old 02-05-2014 , 09:39   Re: warning 213: tag mismatch
Reply With Quote #8

Thank you!
Now it will compile
__________________
joac1144 is offline
Reply


Thread Tools
Display Modes

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 17:44.


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