This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

warning 213: tag mismatch when compiling


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kahl_Drogo
Senior Member
Join Date: Apr 2012
Old 11-12-2016 , 10:42   warning 213: tag mismatch when compiling
Reply With Quote #1

Hi,

I downlaoded l4d plugin sourcecode https://forums.alliedmods.net/showthread.php?p=838518 and When I tryed compiling it I recived "pounceannounce.sp( 118 ) : warning 213: tag mismatch". What I need to change to correct this warning ?

PHP Code:
/* 
* Pounce Announce
*/

#include <sourcemod>

//globals
new Handle:hMaxPounceDistance;
new 
Handle:hMinPounceDistance;
new 
Handle:hMaxPounceDamage;
//hunter position store
new Float:infectedPosition[32][3]; //support up to 32 slots on a server
//cvars
new Handle:hMinPounceAnnounce;
new 
Handle:hCenterChat;
new 
Handle:hShowDistance;
new 
Handle:hCapDamage;
#define DEBUG 0

//For variable types of pounce display
enum PounceDistanceDisplay
{
    
None 0
    
Units 1
    
UnitsAndFeet 2,
    
UnitsAndMeters 3,
    
Feet 4,
    
Meters 5
}

public 
Plugin:myinfo 
{
    
name "Pounce Announce",
    
author "n0limit",
    
description "Announces hunter pounces to the entire server",
    
version "1.5",
    
url "http://forums.alliedmods.net/showthread.php?t=93605"
}

public 
OnPluginStart()
{
    
hMaxPounceDistance FindConVar("z_pounce_damage_range_max");
    
hMinPounceDistance FindConVar("z_pounce_damage_range_min");
    
hMaxPounceDamage FindConVar("z_hunter_max_pounce_bonus_damage");
    
hMinPounceAnnounce CreateConVar("pounceannounce_minimum","0","The minimum amount of damage required to announce the pounce"FCVAR_SPONLY|FCVAR_NOTIFY);
    
hCenterChat CreateConVar("pounceannounce_centerchat","1","Announces the pounce to center chat. Use 0 for regular player chat.",FCVAR_SPONLY|FCVAR_NOTIFY);
    
hShowDistance CreateConVar("pounceannounce_showdistance","2","Show the distance the hunter traveled for the pounce.",FCVAR_SPONLY|FCVAR_NOTIFY);
    
hCapDamage CreateConVar("pounceannounce_capdamage","0","Caps the displayed pounce damage to the maximum able to be dealt.",FCVAR_SPONLY|FCVAR_NOTIFY);
    
    
AutoExecConfig(true,"pounceannounce");
    
    
HookEvent("lunge_pounce",Event_PlayerPounced);
    
HookEvent("ability_use",Event_AbilityUse);
}
public 
Event_AbilityUse(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
user GetClientOfUserId(GetEventInt(event"userid"));
    
    
//Save the location of the player who just used an infected ability
    
GetClientAbsOrigin(user,infectedPosition[user]);
    
    
#if DEBUG
    
decl String:playerName[MAX_NAME_LENGTH];
    
decl String:ability[256];
    
GetClientName(userplayerNamesizeof(playerName));
    
GetEventString(event"ability"abilitysizeof(ability));
    
PrintToChatAll("%s -> %s: %s (%.1f %.1f %.1f)"nameplayerNameabilityinfectedPosition[user][0], infectedPosition[user][1], infectedPosition[user][2]);
    
#endif 
}
public 
Event_PlayerPounced(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
Float:pouncePosition[3];
    new 
attackerId GetEventInt(event"userid");
    new 
victimId GetEventInt(event"victim");
    new 
attackerClient GetClientOfUserId(attackerId);
    new 
victimClient GetClientOfUserId(victimId);
    new 
minAnnounce GetConVarInt(hMinPounceAnnounce);
    new 
bool:centerChat GetConVarBool(hCenterChat);
    
    
decl String:attackerName[MAX_NAME_LENGTH];
    
decl String:victimName[MAX_NAME_LENGTH];
    
decl String:pounceLine[256];
    
decl String:distanceBuffer[64];
    
    new 
PounceDistanceDisplay:showDistance;
    
//distance supplied isn't the actual 2d vector distance needed for damage calculation. See more about it at
    //http://forums.alliedmods.net/showthread.php?t=93207
    //new eventDistance = GetEventInt(event, "distance");
    
    //get hunter-related pounce cvars
    
new max GetConVarInt(hMaxPounceDistance);
    new 
min GetConVarInt(hMinPounceDistance);
    new 
maxDmg GetConVarInt(hMaxPounceDamage);
    
    
//Get current position while pounced
    
GetClientAbsOrigin(attackerClient,pouncePosition);
    
    
//Calculate 2d distance between previous position and pounce position
    
new distance RoundToNearest(GetVectorDistance(infectedPosition[attackerClient], pouncePosition));
    
    
//Get damage using hunter damage formula
    //damage in this is expressed as a float because my server has competitive hunter pouncing where the decimal counts
    
new Float:dmg = (((distance float(min)) / float(max min)) * float(maxDmg)) + 1;
    
    
//Check if calculate damage is higher than max, and cap to max.
    
if(GetConVarBool(hCapDamage) && dmg maxDmg)
        
dmg float(maxDmg) + 1;
    
    if(
distance >= min && dmg >= minAnnounce)
    {
        
GetClientName(attackerClient,attackerName,sizeof(attackerName));
        
GetClientName(victimClient,victimName,sizeof(victimName));
        
#if DEBUG
        
PrintToServer("Pounce: max: %d min: %d dmg: %d dist: %d dmg: %.01f",max,min,maxDmg,distancedmg);
        
#endif
        
Format(pounceLine,sizeof(pounceLine),"\x04%s\x01 pounced \x04%s\x01 for \x03%.01f damage\x01 (max: %d)",attackerName,victimName,dmg,maxDmg 1);
        
        [
COLOR="Red"]PounceDistanceDisplay:showDistance GetConVarInt(hShowDistance);[/COLOR]
        if(
showDistance != None)
        {
            switch(
showDistance)
            {
                case 
Units:
                {
                    
Format(distanceBuffer,sizeof(distanceBuffer)," over %d units",distance);
                }
                case 
UnitsAndFeet:
                { 
//units / 16 = feet in game
                    
Format(distanceBuffer,sizeof(distanceBuffer)," over %d units (%d feet)",distancedistance 16);
                }
                case 
UnitsAndMeters:
                {    
//0.0213 = conversion rate for units to meters
                    
Format(distanceBuffer,sizeof(distanceBuffer)," over %d units (%.0f meters)",distancedistance 0.0213);
                }
                case 
Feet:
                {
                    
Format(distanceBuffer,sizeof(distanceBuffer)," over %d feet"distance 16); 
                }
                case 
Meters:
                {
                    
Format(distanceBuffer,sizeof(distanceBuffer)," over %.0f meters"distance 0.0213);
                }
            }
            
StrCat(pounceLine,sizeof(pounceLine),distanceBuffer);
        }
        if(
centerChat)
            
PrintHintTextToAll(pounceLine);
        else
            
PrintToChatAll(pounceLine);
            
    }

__________________

Last edited by Kahl_Drogo; 11-12-2016 at 10:45.
Kahl_Drogo is offline
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 11-12-2016 , 18:56   Re: warning 213: tag mismatch when compiling
Reply With Quote #2

Changing
PHP Code:
PounceDistanceDisplay:showDistance GetConVarInt(hShowDistance); 
to
PHP Code:
PounceDistanceDisplay:showDistance PounceDistanceDisplay:GetConVarInt(hShowDistance); 
should get rid of the warning. You might find the wiki article about tags interesting.
__________________

Last edited by Impact123; 11-12-2016 at 18:58.
Impact123 is offline
Reply



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 16:40.


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