SA-MP Forums Archive
Tag Mismatch[Help] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Tag Mismatch[Help] (/showthread.php?tid=321777)



Tag Mismatch[Help] - Allu - 28.02.2012

Im getting the tag mismatch error while i'm trying to compile.
Код:
  	if (strcmp(cmdtext, "/mheali", true) == 0 )
	 {
  		new elud[MAX_PLAYER_NAME];
    	{
         	if (PlayerInfo[playerid][pAdmin] == 1)
         	{
			 	SetPlayerHealth(elud, 100); // Error locates here
		}
		 else SendClientMessage(playerid,COLOR_RED, "Sa ei ole admin!");
		 }
 	return 1;
  }
 return 0;
}



Re: Tag Mismatch[Help] - Madd Kat - 28.02.2012

please use pawn tags
indent your code and post the errors....
what line is giving you the error per say and is the actual error.


Re: Tag Mismatch[Help] - new121 - 28.02.2012

ehm I don't get why you are using a variable, try changing "elud" with playerid


Re: Tag Mismatch[Help] - Konstantinos - 28.02.2012

pawn Код:
// There is no reason to use another variable.
    if (strcmp(cmdtext, "/mheali", true) == 0 )
    {
        if (PlayerInfo[playerid][pAdmin] == 1) return SetPlayerHealth(elud, 100);
        else return SendClientMessage(playerid,COLOR_RED, "Sa ei ole admin!");
    }
    return 0;
}



Re: Tag Mismatch[Help] - Madd Kat - 28.02.2012

pawn Код:
SetPlayerHealth(playerid, 100)
you where using there name instead of id
name = string id = integer which was the reason for the tag mismatch

regards,


Re: Tag Mismatch[Help] - Twisted_Insane - 28.02.2012

pawn Код:
if (strcmp(cmdtext, "/mheali", true) == 0 )
 {
    new elud[MAX_PLAYER_NAME];
    if (PlayerInfo[playerid][pAdmin] == 1)
    {
      SetPlayerHealth(elud, 100);
    }
    else return SendClientMessage(playerid, COLOR_RED, "Sa ei ole admin!");
   return 1;
 }  
return 0;
}



Re: Tag Mismatch[Help] - Allu - 28.02.2012

Dwane solved the problem. Thanks! Case closed.


Re: Tag Mismatch[Help] - Madd Kat - 28.02.2012

maybe stoped the warning but the function wont work!

you cant pass a players NAME to set there health,
atleast according to the wiki!

https://sampwiki.blast.hk/wiki/SetPlayerHealth

regards,