[HELP] Time save with dini - 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: [HELP] Time save with dini (
/showthread.php?tid=214147)
[HELP] Time save with dini -
buzifej - 20.01.2011
How to save time?
dcmd_savetime(playerid, params[]){
SendClientMessage(playerid,COLOR_RED,"Time saved");
how to save?
return 1;
}
Re: [HELP] Time save with dini -
Alex_Valde - 20.01.2011
You don't need to use dini for that.
You can make it like this. (This is the simplest I could make)
pawn Код:
dcmd_savetime(playerid, params[])
{
new hour, mins, secs;
new string[12];
gettime(hour, mins, secs);
format(string, sizeof(string), "%d:%d:%d",hour, mins, secs);
SaveTime(string);
SendClientMessage(playerid, COLOR_RED, "Time saved!");
return 1;
}
pawn Код:
stock SaveTime(string[])
{
new entry[ 255 ];
format( entry, sizeof( entry ), "%s\r\n", string );
new File:hFile;
hFile = fopen( "/SavedTimes.log", io_append );
fwrite( hFile, entry );
fclose( hFile );
}
Re: [HELP] Time save with dini -
buzifej - 20.01.2011
and how to load?