Time Stamps
#4

pawn Код:
new gConnectTimestamp[MAX_PLAYERS], gOnlineTime[ MAX_PLAYERS ];



public OnPlayerConnect(playerid)
{
   gConnectTimestamp[ playerid ] = gettime();
   
   // I will assume that you will load seconds online into "gOnlineTime"
}

public OnPlayerDisconnect(playerid, reason)
{
    gOnlineTime[ playerid ] += gettime() - gConnectTimestamp[ playerid ];
    // If you didnt ignore my previous comment the "gOnlineTime" will now contain the total seconds connected.
}
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)