SA-MP Forums Archive
Doesn't save unix timestamp. - 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)
+--- Thread: Doesn't save unix timestamp. (/showthread.php?tid=553142)



y_ini doesn't save unix timestamp. - Facerafter - 28.12.2014

<FIXED>


Re: Doesn't save unix timestamp. - biker122 - 28.12.2014

Run this and tell me which of them are being printed and which of them aren't.
pawn Code:
SaveAccount(playerid)
{
    print("Save started");
    new INI:File = INI_Open(Path(playerid));
    print("File opened");
    printf("* Value check: %i",PlayerInfo[playerid][pTempBanned]); // Works
    INI_WriteInt(File,"TempBanned", PlayerInfo[playerid][pTempBanned]);
    print("Written the value in file");
    INI_Close(File);
    print("Saved"); // Doesn't work
    return 1;
}



Re: Doesn't save unix timestamp. - Facerafter - 28.12.2014

Code:
[15:13:28] File opened
[15:13:28] * Value check: 1419790408



Re: Doesn't save unix timestamp. - biker122 - 28.12.2014

You aren't setting the tag. Can you show me your registration code? So I can provide the same and valid tag.


Re: Doesn't save unix timestamp. - Facerafter - 28.12.2014

Quote:
Originally Posted by biker122
View Post
You aren't setting the tag. Can you show me your registration code? So I can provide the same and valid tag.
Check the OP, I am.
Code:
SaveAccount(playerid)
{
	print("Save started");
	new INI:File = INI_Open(Path(playerid));
        INI_SetTag(File,"data"); // The tag?
	printf("%i",PlayerInfo[playerid][pTempBanned]); // Works
	INI_WriteInt(File,"TempBanned", PlayerInfo[playerid][pTempBanned]);
	INI_Close(File);
	print("Saved"); // Doesn't work
	return 1;
}
I added the tag to your code.

This is what I ran:
Code:
SaveAccount(playerid)
{
    print("Save started");
    new INI:File = INI_Open(Path(playerid));
    INI_SetTag(File, "data");
    print("File opened");
    printf("* Value check: %i",PlayerInfo[playerid][pTempBanned]); // Works
    INI_WriteInt(File,"TempBanned", PlayerInfo[playerid][pTempBanned]);
    print("Written the value in file");
    INI_Close(File);
    print("Saved"); // Doesn't work
    return 1;
}



Re: Doesn't save unix timestamp. - biker122 - 28.12.2014

Do they print after setting the tags?


Re: Doesn't save unix timestamp. - Facerafter - 28.12.2014

Quote:
Originally Posted by biker122
View Post
Do they print after setting the tags?
This was the result with the tag.
Quote:
Originally Posted by Facerafter
View Post
Code:
[15:13:28] File opened
[15:13:28] * Value check: 1419790408



Re: Doesn't save unix timestamp. - biker122 - 28.12.2014

I got no idea with this. I don't understand why it happens...


Re: Doesn't save unix timestamp. - Facerafter - 28.12.2014

Anyone?


Re: Doesn't save unix timestamp. - Facerafter - 29.12.2014

Bump.