PDA

View Full Version : Tag Mischat on somefhing it shouldent


Jason_Thunde
14/10/2011, 07:03 PM
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

Jochemd
14/10/2011, 07:06 PM
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.

Jason_Thunde
14/10/2011, 07:07 PM
Here is my Command:

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;
}

Wesley221
14/10/2011, 07:08 PM
Is EventArmor defined as a float? Otherwise it should give you that warning.

SchurmanCQC
14/10/2011, 07:08 PM
format(EventArmor,sizeof(EventArmor), "%f", armor);

Jochemd
14/10/2011, 07:09 PM
Could you also show me the line where you make "new EventArmor"?

If I am right, there is now this:

new EventArmor;

If you replace it with this, it will be fixed:

new Float:EventArmor;

I hope you understand what you did wrong ;)

wups
14/10/2011, 07:10 PM
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.

SchurmanCQC
14/10/2011, 07:11 PM
What??? NO!
The problem is obvious: EventArmour should be a float.

:rolleyes:

Jason_Thunde
14/10/2011, 07:14 PM
Could you also show me the line where you make "new EventArmor"?

If I am right, there is now this:

new EventArmor;

If you replace it with this, it will be fixed:

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 :)