SA-MP Forums Archive
Quick one: tag mismatch? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Quick one: tag mismatch? (/showthread.php?tid=141751)



Quick one: tag mismatch? - IcyBlight - 15.04.2010

Код:
public OnPlayerDisconnect(playerid, reason)
{
	IsLogged[playerid] = 0;
	new file[128];
  new logname[MAX_PLAYER_NAME];
  GetPlayerName(playerid, logname, sizeof(logname));
  format(file,sizeof(file),"%s.ini",logname);
	new cash;
	cash = GetPlayerMoney(playerid);
  dini_IntSet(file,"Cash", cash);
  dini_IntSet(file, "AdminLevel", PlayerInfo[playerid][AdminLevel]);
  dini_IntSet(file, "RentCard", PlayerInfo[playerid][RentCard]);
  new Float:health;
	GetPlayerHealth(playerid, health);
	dini_IntSet(file, "Health", health);
	return 1;
}
I get a tag mismatch in this line:

Код:
	dini_IntSet(file, "Health", health);
I have no idea, but I guess it's some obvious reason that I fail at seeing.

Someone quickly explain and help me?


Re: Quick one: tag mismatch? - Simon - 15.04.2010

Health is a float, with the Float: tag. You're trying to convert a Float: tag to an _: tag (int tag -- set by default on all variables). I'm not familiar with dini but there should be a float setting function... try:

dini_FloatSet(file, "Health", health);