01.01.2015, 09:07
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