Error 213: tag mismatch
#1

Hi, When attempting to configure my gamemode, I get the following error:

C:\Users\samp\Desktop\SA-MP Server\gamemodes\3krp.pwn(859) : warning 213: tag mismatch
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.


Below is the coding:

Код:
public OnPlayerDisconnect(playerid, reason)
{
   	new str[70], Float:x, Float:y, Float:z, health;
	GetPlayerName(playerid, Name, sizeof(Name));
	aDuty{playerid} = 0;
	SavePlayer(playerid);
	switch (reason) {
		case 0:
		{
			format(str, sizeof(str), "*** %s (%d) has left the server (Timeout)", Name, playerid);
			PlayerInfo[playerid][pCrashed] = 1;
			GetPlayerPos(playerid, x, y, z);
			PlayerInfo[playerid][pCrashX] = x;
			PlayerInfo[playerid][pCrashY] = y;
			PlayerInfo[playerid][pCrashZ] = z;
		}
		case 1:
		{
			format(str, sizeof(str), "*** %s (%d) has left the server (Leaving)", Name, playerid);
		}
		case 2:	format(str, sizeof(str), "*** %s (%d) has left the server (Kicked/Banned)", Name, playerid);
	}
	SendClientMessageToAll(COLOR_GREY, str);
	GetPlayerHealth(playerid, health);
	PlayerInfo[playerid][pHealth] = health;
	SavePlayer(playerid);
	return 1;
}
Reply
#2

What is the coding on just that one line?
Reply
#3

Sorry, I forgot to clarify that. The error is on line "GetPlayerHealth(playerid, health);"
Reply
#4

pawn Код:
new str[70], Float:x, Float:y, Float:z, health;
Needs to be
pawn Код:
new str[70], Float:x, Float:y, Float:z, Float:health;
You forgot to define Health, as a float.
Reply
#5

I had it before as a float and got the same error on a different line. I've now made it a Float, and I recieve the same error on this line:

PlayerInfo[playerid][pHealth] = health;
Reply
#6

Go to your PlayerInfo enum, and replace:

pawn Код:
pHealth
with:

pawn Код:
Float:pHealth
Reply
#7

PlayerInfo[playerid][pHealth] = GetPlayerHealth(playerid, health);
Reply
#8

the PlayerInfo[playerid][pHealth] = health is what records their health to their profile.
Reply


Forum Jump:


Users browsing this thread: