16.03.2014, 21:42
You could use a unix timestamp for this.
When a player logs in:
When the player leaves:
When a player logs in:
pawn Код:
SetPVarInt(playerid, "LoginTime", gettime());
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);
}