Y_INI - Last logged in? -
Scarred - 02.12.2011
How would I go about doing something like that? Creating a string variable that saves the date like: 01/02/1970? I'm new to Y_INI, so I don't know how I would go about doing this.
Re: Y_INI - Last logged in? -
[MG]Dimi - 02.12.2011
Actually use getdate and gettime under onPLayerDisconnect and then just save it
Re: Y_INI - Last logged in? -
Scarred - 02.12.2011
Quote:
Originally Posted by [MG]Dimi
Actually use getdate and gettime under onPLayerDisconnect and then just save it
|
My enum variable would be a string, correct?
Re: Y_INI - Last logged in? -
Scarred - 03.12.2011
How would I go about displaying it? I have the variables saving and loading correctly, I just don't know how to display it on a string, as it's not working correctly.
It saves in the file as-
Which is correct, and works correctly.
Displaying it- (It displays as a square..)
pawn Код:
format(string, sizeof(string), "You last logged in on: %s!\nYou currently have %d points to spend!", UserInfo[playerid][LastLoggedIn], UserInfo[playerid][Points]);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX, ""COL_WHITE"You have been logged in!", string, "Play", "");
Writing it-
pawn Код:
new year, month, day;
getdate(year, month, day);
new string[128];
format(string, sizeof(string), "%d/%d/%d", month, day, year);
INI_WriteString(File, "LastLoggedIn", string);
Re: Y_INI - Last logged in? -
antonio112 - 03.12.2011
pawn Код:
new
LastON[40],
Year,
Month,
Day,
Hour,
Minute,
Second;
getdate(Year,Month,Day);
gettime(Hour,Minute,Second);
format(LastON, sizeof LastON, "%d/%d/%d at %d:%d:%d", Day,Month,Year,Hour,Minute,Second);
That should do it.
Re: Y_INI - Last logged in? -
Scarred - 03.12.2011
Quote:
Originally Posted by antonio112
pawn Код:
new LastON[40], Year, Month, Day, Hour, Minute, Second;
getdate(Year,Month,Day); gettime(Hour,Minute,Second); format(LastON, sizeof LastON, "%d/%d/%d at %d:%d:%d", Day,Month,Year,Hour,Minute,Second);
That should do it. 
|
I don't think you understood correctly. I need it to read the following text correctly: "12/3/2011" from a file, but for some reason a string is not doing it correctly.
Re: Y_INI - Last logged in? -
fordawinzz - 03.12.2011
use this:
pawn Код:
INI_String("LastLoggedIn", UserInfo[playerid][LastLoggedIn], 64);
format(string, sizeof string, "Last logged in: %s", UserInfo[playerid][LastLoggedIn]);
SendClientMessage(playerid, ~1, string);
Re: Y_INI - Last logged in? -
antonio112 - 03.12.2011
Quote:
Originally Posted by Scarred
I don't think you understood correctly. I need it to read the following text correctly: "12/3/2011" from a file, but for some reason a string is not doing it correctly.
|
Ohh, yea... Sorry, I totally misread you.