Problem in saving Player data using dini.
#1

I have problem in my code that I have tried to solve for a long time now but can't really fix it.
So, I need your help fixing them.

I use "dini" system to save player data to files. Here is a simple example on how I save the data.

Code:
enum data
{
	Kills
};
Code:
new pinfo[MAX_PLAYERS][data];
Code:
public OnPlayerConnect(playerid)
{
	new file[128];
	format(file,128,"/20accounts/%s.ini",name(playerid));

	if(fexist(file))
	{
		login(playerid);
	}
		
	return 1;
}
Code:
login(playerid)
{
	new file[128];
	format(file,128,"/20accounts/%s.ini",name(playerid));

	pinfo[playerid][Kills] = dini_Int(file,"Kills");
	
	return 1;
}
Code:
public OnPlayerDeath(playerid,killerid,reason)
{
	pinfo[killerid][Kills]++;
	return 1;
}
Code:
public OnPlayerDisconnect(playerid,reason)
{
	new file[128];
	format(file,128,"/20accounts/%s.ini",name(playerid));

	dini_IntSet(file, "Kills", pinfo[playerid][Kills]);
	
	return 1;
}
The register command:
Code:
if(!strcmp(cmdtext,"/register",true))
{
	new file[128];
	format(file,128,"/20accounts/%s.ini",name(playerid));

	dini_Create(file);
	dini_IntSet(file, "Kills", pinfo[playerid][Kills]);

	return 1;
}
The values in the file remain 0 (zero) no matter what I do.
Can anyone give it a shot?
Reply


Messages In This Thread
Problem in saving Player data using dini. - by DJDhan - 20.07.2010, 20:46
Re: Problem in saving Player data using dini. - by Grim_ - 20.07.2010, 20:48
Re: Problem in saving Player data using dini. - by DJDhan - 20.07.2010, 20:51
Re: Problem in saving Player data using dini. - by Kar - 20.07.2010, 20:56
Re: Problem in saving Player data using dini. - by DJDhan - 20.07.2010, 21:04
Re: Problem in saving Player data using dini. - by Kar - 20.07.2010, 21:10
Re: Problem in saving Player data using dini. - by DJDhan - 20.07.2010, 21:13
Re: Problem in saving Player data using dini. - by Kar - 20.07.2010, 21:16
Re: Problem in saving Player data using dini. - by DJDhan - 20.07.2010, 21:21
Re: Problem in saving Player data using dini. - by Kar - 20.07.2010, 21:23

Forum Jump:


Users browsing this thread: 1 Guest(s)