Dini won't save my data.
#1

I don't get any errors, but when i exit the game it doesn't save data.
These are the things involving my dini code:
Код:
public OnPlayerConnect(playerid)
{
	AlreadyFished[playerid] = 0;
	IsFishing[playerid] = 0;
	
	//Get fishes in file
	FishWeight[playerid] = GetPlayerWeight(playerid);
	Fishes[playerid] = GetPlayerFishes(playerid);
	FishingTool[playerid] = GetPlayerRod(playerid);
	Worms[playerid] = GetPlayerBait(playerid);
	
	return 1;
}
Код:
public OnPlayerDisconnect(playerid, reason)
{
	AlreadyFished[playerid] = 0;
	IsFishing[playerid] = 0;
	
	//Set fishes in file
	SetPlayerFishes(playerid, FishWeight[playerid], Fishes[playerid], FishingTool[playerid], Worms[playerid]);
	
	return 1;
}
and these are the functions
Код:
stock SetPlayerFishes(playerid, weight, fishes, fishingtool, worms)
{
	new file[256], name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof(name));
	format(file, sizeof(file), "%s.ost", name);
	dini_IntSet(file, "Weight", weight);
	dini_IntSet(file, "Fishes", fishes);
	dini_IntSet(file, "Fishingrod", fishingtool);
	dini_IntSet(file, "Baits", worms);
	return true;
}

stock GetPlayerWeight(playerid)
{
	new weight, file[256], name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof(name));
	format(file, sizeof(file), "%s.ost", name);
	weight = dini_Int(file, "Weight");
	return weight;
}

stock GetPlayerFishes(playerid)
{
	new fishes, file[256], name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof(name));
	format(file, sizeof(file), "%s.ost", name);
	fishes = dini_Int(file, "Fishes");
	return fishes;
}

stock GetPlayerRod(playerid)
{
	new rod, file[256], name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof(name));
	format(file, sizeof(file), "%s.ost", name);
	rod = dini_Int(file, "Fishingrod");
	return rod;
}

stock GetPlayerBait(playerid)
{
	new bait, file[256], name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof(name));
	format(file, sizeof(file), "%s.ost", name);
	bait = dini_Int(file, "Baits");
	return bait;
}
Oh and btw, this code is in an filterscript, i don't know if it matters, but if it does, that's probably why.
Reply


Messages In This Thread
[SOLVED] Dini won't save my data. - by 9903286 - 28.11.2012, 22:52
Re: Dini won't save my data. - by maramizo - 28.11.2012, 23:50
Re: Dini won't save my data. - by 9903286 - 29.11.2012, 00:07
Re: Dini won't save my data. - by GiamPy. - 29.11.2012, 00:09
Re: Dini won't save my data. - by 9903286 - 29.11.2012, 00:18
Re: Dini won't save my data. - by GiamPy. - 29.11.2012, 00:21
Re: Dini won't save my data. - by Shane_Kingston - 29.11.2012, 00:26
Re: Dini won't save my data. - by 9903286 - 29.11.2012, 00:42
Re: Dini won't save my data. - by GiamPy. - 29.11.2012, 00:49
Re: Dini won't save my data. - by maramizo - 29.11.2012, 00:54

Forum Jump:


Users browsing this thread: 5 Guest(s)