29.01.2018, 11:05
Is there any tutorials that explains how to count the current player's online time and save it with y_ini?
new pTimeStamp[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
pTimeStamp[playerid] = gettime();
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new timeOnline = gettime() - pTimeStamp[playerid];
return 1;
}
// the timeOnline variable has the time spent online by that player in seconds.