Tag Mismatch[Help]
#1

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;
}
Reply
#2

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.
Reply
#3

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

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;
}
Reply
#5

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,
Reply
#6

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

Dwane solved the problem. Thanks! Case closed.
Reply
#8

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,
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)