Manual:DIL Manual/birth
Jump to navigation
Jump to search
Contents
birth
Field (integer, read/write; units: PC).
pc.birth : integer
When the player was born, in real seconds since 1970 like realtime. It is set to the moment the character is made. The player's age in mud years is (realtime - pc.birth) / SECS_PER_MUD_YEAR, as score in commands.zon and youth.zon work it out.
Assigning it changes the player's age: youth.zon sets pc.birth := realtime - (newage * SECS_PER_MUD_YEAR).
Notes
- Players only. On an NPC, an object, a room or null the field fails.
- Assignable from any zone.
- youth.zon and update.zon compare the age with lifespan.
Example
dilbegin set_age(pc : unitptr, newage : integer);
code
{
if (pc.type != UNIT_ST_PC)
return;
pc.birth := realtime - (newage * SECS_PER_MUD_YEAR);
sendtext("You are now " + itoa((realtime - pc.birth) / SECS_PER_MUD_YEAR) +
" years old.<br/>", pc);
return;
}
dilend
Sets a player's age in mud years, as youth.zon does.