Time Stamps
#2

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)
{
    new h,m,s,diff;
    diff = gettime() - gOnlineTime[playerid];
    h = floatround(diff / 3600, floatround_floor);
    m = floatround((diff - h * 3600) / 60, floatround_floor);
    s = diff - h * 3600 - m * 60;
    printf("playerid %d play %d hours %d minutes %d secconds in this session", playerid, h, m, s);

    return 1;
}
Sorry for my bad english
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)