Quick one: tag mismatch?
#1

Код:
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?
Reply
#2

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);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)