Saving current time of a timer (y_timers)
#1

REMOVED
Reply
#2

up, ....
Reply
#3

You could use a unix timestamp for this.

When a player logs in:

pawn Код:
SetPVarInt(playerid, "LoginTime", gettime());
When the player leaves:

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new how_long_he_played = (gettime()-GetPVarInt(playerid, "LoginTime"))/60;
    // This will return the amount of time in minutes the player was online.
    printf("Player was online for %d minutes", how_long_he_played);
}
Reply
#4

REMOVED
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)