[HELP] Time save with dini
#1

How to save time?

dcmd_savetime(playerid, params[]){
SendClientMessage(playerid,COLOR_RED,"Time saved");
how to save?
return 1;


}
Reply
#2

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 );
}
Reply
#3

and how to load?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)