01.01.2015, 12:01
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;
}