Tag Mischat on somefhing it shouldent
#1

Код:
NEvent.pwn(177) : warning 213: tag mismatch
Line 177:

Код:
EventArmor = armor;
All i have above is basic String comparing with strcmp and armor is = to Param number 2
Reply
#2

Show more code - it will be easier to explain for us.

Tag mismatch usually means you forgot to put a 'tag' when declaring a new array, but first show more code. EventArmor is probably a float, while you are trying to assign an integer value to it.
Reply
#3

Here is my Command:

pawn Код:
CMD:seteventinfo(playerid, params [ ] )
{
    if(IsPlayerConnected(playerid))
    {
        if(IsPlayerAdmin(playerid))
        {
            if(IsThereActiveEvent == 0)
            {
                new string[128];
               
                if(!sscanf(params, "s[128]", string))
                {
                    new message[40];
                    if(strcmp(string,"Health",true)==0)
                    {
                        new Float:health;
                        if(!sscanf(params, "f", health))
                        {
                            if(health < 1 || health > 100) { SendClientMessage(playerid, COLOR_GREY, "Dont go below 1 or 100 for health"); return 1; }
                            EventHP = health;
                            format(message, sizeof(message), "You have set the Health for event to %f", health);
                            SendClientMessage(playerid, COLOR_LIGHTBLUE, message);
                        }
                        else
                            SendClientMessage(playerid, COLOR_GREY, "USAGE: /seteventinfo [health] [amounth]");
                       
                    }
                    else if(strcmp(string,"Armor",true)==0)
                    {
                        new Float:armor;
                        if(!sscanf(params, "f", armor))
                        {
                            if(armor < 1 || armor > 100) { SendClientMessage(playerid, COLOR_GREY, "Dont go below 1 or 100 for armor"); return 1; }
                            EventArmor = armor;
                            format(message, sizeof(message), "You have set the Armor for event to %f", armor);
                            SendClientMessage(playerid, COLOR_LIGHTBLUE, message);
                        }
                        else
                            SendClientMessage(playerid, COLOR_GREY, "USAGE: /seteventinfo [armor] [amounth]");
                    }
               
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "USAGE: /seteventinfo [name]");
                    SendClientMessage(playerid, COLOR_GREY, "Avaible names: Health, Armor, Gun1, Gun2, Gun3, Gun4, Gun5");
                }
            }
            else
                SendClientMessage(playerid, COLOR_GREY, "An Event is already active use /endevent to finish it");
        }
        else
            SendClientMessage(playerid, COLOR_GREY, "You must be Logged in as RCON to use this Command");
    }
    return 1;
}
Reply
#4

Is EventArmor defined as a float? Otherwise it should give you that warning.
Reply
#5

pawn Код:
format(EventArmor,sizeof(EventArmor), "%f", armor);
Reply
#6

Could you also show me the line where you make "new EventArmor"?

If I am right, there is now this:

pawn Код:
new EventArmor;
If you replace it with this, it will be fixed:

pawn Код:
new Float:EventArmor;
I hope you understand what you did wrong
Reply
#7

Quote:
Originally Posted by Schurman
Посмотреть сообщение
pawn Код:
format(EventArmor,sizeof(EventArmor), "%f", armor);
What NO!
The problem is obvious: EventArmour should be a float.

EDIT: Your sscanf code is bad. You should use sscanf once, but with "sf" params.
Reply
#8

Quote:
Originally Posted by wups
Посмотреть сообщение
What NO!
The problem is obvious: EventArmour should be a float.
Reply
#9

Quote:
Originally Posted by Jochemd
Посмотреть сообщение
Could you also show me the line where you make "new EventArmor"?

If I am right, there is now this:

pawn Код:
new EventArmor;
If you replace it with this, it will be fixed:

pawn Код:
new Float:EventArmor;
I hope you understand what you did wrong
How stupid can i be i forgot to make it float.. omg Yea i know what i did wrong Thanks Anyways

Works now
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)