SA-MP Forums Archive
Dini saving, doesn't create file! - 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: Dini saving, doesn't create file! (/showthread.php?tid=251891)



- [JnA]DukeNukem - 29.04.2011

Код:
public OnPlayerDisconnect(playerid, reason)
{
            new pFile[100], pName[MAX_PLAYER_NAME];
            new pMoney = GetPlayerMoney(playerid);
            new pSkin  = GetPlayerSkin(playerid);
            new Float:X,Float:Y,Float:Z;
			GetPlayerPos(playerid,X,Y,Z);
	        GetPlayerName(playerid, pName, sizeof(pName));
	        format(pFile, sizeof(pFile), REGISTER_PATH, pName);
	        dini_FloatSet(pFile,"posx", X);
			dini_FloatSet(pFile,"posy", Y);
			dini_FloatSet(pFile,"posz", Z);
	        dini_IntSet(pFile, "Cash", pMoney);
	        dini_IntSet(pFile, "Skin", pSkin);
        return 1;
}
I made this... why doesn't it create the file??

LOL fixed with dini_Create(pFile);

>>>>>>N00B<<<<<<<


Re: Dini saving, doesn't create file! - leong124 - 29.04.2011

Quote:
Originally Posted by [JnA]DukeNukem
Посмотреть сообщение
Код:
public OnPlayerDisconnect(playerid, reason)
{
            new pFile[100], pName[MAX_PLAYER_NAME];
            new pMoney = GetPlayerMoney(playerid);
            new pSkin  = GetPlayerSkin(playerid);
            new Float:X,Float:Y,Float:Z;
			GetPlayerPos(playerid,X,Y,Z);
	        GetPlayerName(playerid, pName, sizeof(pName));
	        format(pFile, sizeof(pFile), REGISTER_PATH, pName);
	        dini_FloatSet(pFile,"posx", X);
			dini_FloatSet(pFile,"posy", Y);
			dini_FloatSet(pFile,"posz", Z);
	        dini_IntSet(pFile, "Cash", pMoney);
	        dini_IntSet(pFile, "Skin", pSkin);
        return 1;
}
I made this... why doesn't it create the file??

LOL fixed with dini_Create(pFile);

>>>>>>N00B<<<<<<<
The weird thing is, dini will create the file itself in dini_xxxSet if it doesn't exists.