Error,Tag Mismatch. -
pimentgabriel - 23.05.2013
Guys, i am having a tag mismatch error on this code i have made and i cant find out why. The code verifies the position of the target and then use that position so set a radius on with the player can use the command.
Code:
if(strcmp(cmd,"/socorrer",true) == 0)
{
new Float: alvoposx[MAX_PLAYERS];
new Float: alvoposy[MAX_PLAYERS];
new Float: alvoposz[MAX_PLAYERS];
tmp = strtok(cmdtext,idx);
giveplayerid = ReturnUser(tmp);
GetPlayerPos(giveplayerid, alvoposx[giveplayerid], alvoposy[giveplayerid], alvoposz[giveplayerid]);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_GRAD1,"USO: /socorrer [ID]");
return 1;
}
if(PlayerInfo[playerid] [pMember] == 4)
{
if(IsPlayerInRangeOfPoint(playerid, 4.0, alvoposx[idx], alvoposy[idx], alvoposz[idx]))
{
if(Salvar[giveplayerid] == 1)
{
if(RepetirSocorro[giveplayerid] == 0)
{
RepetirSocorro[giveplayerid] = 1;
SetPlayerHealth(giveplayerid, 100.0);
SendClientMessage(giveplayerid, COLOR_LIGHTCYAN, "Vocк foi socorrido rapidamente por um paramйdico!");
SendClientMessage(playerid, COLOR_LIGHTCYAN, "Vocк socorreu uma vнtima com sucesso!");
Salvar[giveplayerid] = 0;
KillTimer(MortaoTimer[giveplayerid]);
KillTimer(Mortao2Timer[giveplayerid]);
Morrendo[giveplayerid] = 0;
SetTimer("RepetirSocorro1", 240000, 0);
}
if(!RepetirSocorro[giveplayerid] == 0)
{
SendClientMessage(playerid, ORANGE, "Essa pessoa ja foi socorrida recentemente.");
}
}
if(!Salvar[giveplayerid] == 1)
{
SendClientMessage(playerid, ORANGE, "Essa pessoa nгo pode ser socorrida.");
SendClientMessage(playerid, ORANGE, "Se a pessoa estiver agonizando, o tempo de socorro se esgotou.");
SendClientMessage(playerid, ORANGE, "Entгo seria necessбria a chamada de uma ambulвncia.");
}
}
if(!IsPlayerInRangeOfPoint(playerid, 4.0, alvoposx[idx], alvoposy[idx], alvoposz[idx]))
{
SendClientMessage(playerid, COLOR_YELLOW, "Vocк estб muito longe do seu alvo.");
}
}
if(!PlayerInfo[playerid] [pMember] == 4)
{
SendClientMessage(playerid, ORANGE, "Vocк nгo й da SAMU.");
}
}
Thanks in advance.
Re: Error,Tag Mismatch. -
NvidiaForTheWin - 23.05.2013
at least , tell us where you get the error
Re: Error,Tag Mismatch. -
pimentgabriel - 23.05.2013
Sorry... I forgot the most important. The error itself.
C:\Users\Antonio\Desktop\Pimenta\SAMP\pawno\BSF3.p wn(15814) : warning 209: function "Streamer_OnPlayerDisconnect" should return a value
C:\Users\Antonio\Desktop\Pimenta\SAMP\pawno\BSF3.p wn(48246) : warning 213: tag mismatch
C:\Users\Antonio\Desktop\Pimenta\SAMP\pawno\BSF3.p wn(48251) : warning 213: tag mismatch
C:\Users\Antonio\Desktop\Pimenta\SAMP\pawno\BSF3.p wn(48263) : warning 213: tag mismatch
Line 48263 is where "if(!PlayerInfo[playerid] [pMember] == 4)" is
Line 48251 is where "if(!Salvar[giveplayerid] == 1)" is
Line 48246 is where "if(!RepetirSocorro[giveplayerid] == 0)" is
Re: Error,Tag Mismatch. -
Avi Raj - 23.05.2013
replace them with :-
pawn Код:
if(PlayerInfo[playerid] [pMember] == 4)
if(Salvar[giveplayerid] == 1)
if(RepetirSocorro[giveplayerid] == 0)
Re: Error,Tag Mismatch. -
pimentgabriel - 23.05.2013
But replacing with that the command would lose its meaning. That lines are meant to be "when that viariable HAS NOT the value of 4" and if i replace with that it would be the opposite.
Re: Error,Tag Mismatch. -
SuperViper - 23.05.2013
Instead of putting the
! before the variable, change
== to
!= which means
doesn't equal.
Re: Error,Tag Mismatch. -
Pottus - 23.05.2013
Quote:
Originally Posted by SuperViper
Instead of putting the ! before the variable, change == to != which means doesn't equal.
|
He doesn't need that it should be else
Re: Error,Tag Mismatch. -
SuperViper - 23.05.2013
Quote:
Originally Posted by [uL]Pottus
He doesn't need that it should be else
|
Putting the
! before a variable in a comparison is only valid on booleans (correct me if I'm wrong) because it specifies that you want the opposite of that variable in the comparison. None of his variables are booleans so he gets a tag mismatch because his variables can't be changed to their opposite.
Re: Error,Tag Mismatch. -
pimentgabriel - 23.05.2013
Quote:
Originally Posted by SuperViper
Putting the ! before a variable in a comparison is only valid on booleans (correct me if I'm wrong) because it specifies that you want the opposite of that variable in the comparison. None of his variables are booleans so he gets a tag mismatch because his variables can't be changed to their opposite.
|
Nice! Thanks, it worked!
Re: Error,Tag Mismatch. -
Pottus - 23.05.2013
Quote:
Originally Posted by SuperViper
Putting the ! before a variable in a comparison is only valid on booleans (correct me if I'm wrong) because it specifies that you want the opposite of that variable in the comparison. None of his variables are booleans so he gets a tag mismatch because his variables can't be changed to their opposite.
|
I know how it works I was referring to this code....
pawn Код:
if(RepetirSocorro[giveplayerid] == 0)
{
RepetirSocorro[giveplayerid] = 1;
SetPlayerHealth(giveplayerid, 100.0);
SendClientMessage(giveplayerid, COLOR_LIGHTCYAN, "Vocк foi socorrido rapidamente por um paramйdico!");
SendClientMessage(playerid, COLOR_LIGHTCYAN, "Vocк socorreu uma vнtima com sucesso!");
Salvar[giveplayerid] = 0;
KillTimer(MortaoTimer[giveplayerid]);
KillTimer(Mortao2Timer[giveplayerid]);
Morrendo[giveplayerid] = 0;
SetTimer("RepetirSocorro1", 240000, 0);
}
if(!RepetirSocorro[giveplayerid] == 0)
{
SendClientMessage(playerid, ORANGE, "Essa pessoa ja foi socorrida recentemente.");
}
Should be
pawn Код:
if(RepetirSocorro[giveplayerid] == 0)
{
RepetirSocorro[giveplayerid] = 1;
SetPlayerHealth(giveplayerid, 100.0);
SendClientMessage(giveplayerid, COLOR_LIGHTCYAN, "Vocк foi socorrido rapidamente por um paramйdico!");
SendClientMessage(playerid, COLOR_LIGHTCYAN, "Vocк socorreu uma vнtima com sucesso!");
Salvar[giveplayerid] = 0;
KillTimer(MortaoTimer[giveplayerid]);
KillTimer(Mortao2Timer[giveplayerid]);
Morrendo[giveplayerid] = 0;
SetTimer("RepetirSocorro1", 240000, 0);
}
else
{
SendClientMessage(playerid, ORANGE, "Essa pessoa ja foi socorrida recentemente.");
}