Time Stamps
#1

pawn Код:
new gOnlineTime[MAX_PLAYERS];

enum pInfo
{
    Hours,
    Minutes,
    Seconds
}
new PlayerInfo[MAX_PLAYERS][pInfo];

public OnPlayerConnect(playerid)
{
    gOnlineTime[playerid] = gettime();
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    PlayerInfo[playerid][Seconds] = gettime() - gOnlineTime[playerid];
    PlayerInfo[playerid][Minutes] = PlayerInfo[playerid][Seconds] / 60;
    PlayerInfo[playerid][Hours] = PlayerInfo[playerid][Minutes] / 60;
    INI_WriteInt(File, "Hours", PlayerInfo[playerid][Hours]);
    INI_WriteInt(File, "Minutes", PlayerInfo[playerid][Minutes]);
    INI_WriteInt(File, "Seconds", PlayerInfo[playerid][Seconds]);
    return 1;
}


Is this is the way to save hours minutes seconds of a player's online time through timestamps??
i know it is possibly wrong so im asking here..

if not can please correct me and help me

please help me

Thanks for reading
Reply


Messages In This Thread
Time Stamps - by kesarthakur - 01.01.2015, 09:07
Re: Time Stamps - by rickisme - 01.01.2015, 12:01
Re: Time Stamps - by kesarthakur - 01.01.2015, 14:33
Re: Time Stamps - by dusk - 01.01.2015, 14:59
Re: Time Stamps - by kesarthakur - 01.01.2015, 15:37
Re: Time Stamps - by rickisme - 01.01.2015, 15:50
Re: Time Stamps - by kesarthakur - 01.01.2015, 16:10
Re: Time Stamps - by rickisme - 01.01.2015, 16:31
Re: Time Stamps - by kesarthakur - 01.01.2015, 16:38
Re: Time Stamps - by Virtual1ty - 01.01.2015, 16:58

Forum Jump:


Users browsing this thread: 1 Guest(s)