Manual:DIL Manual/playtime
Jump to navigation
Jump to search
Contents
playtime
Field (integer, read-only; units: PC).
pc.playtime : integer
How long the player has been logged in, in total, in real seconds.
Notes
- Players only. On an NPC, an object, a room or null the field fails.
- It can't be assigned (vmc: "Illegal lvalue").
- It grows when the player is saved (now and then while playing, and at log-off): the time since the last save is added then. During a session it lags behind by that much.
Example
dilbegin string played_string(pc : unitptr);
var
h : integer;
code
{
h := pc.playtime / 3600;
return ("You have played " + itoa(h / 24) + " days and " + itoa(h % 24) +
" hours.");
}
dilend
Shows a player's total playing time, as score does in commands.zon.