Manual:DIL Manual/crimes
Jump to navigation
Jump to search
Contents
crimes
Field (integer, read/write; units: PC).
pc.crimes : integer
A count of the crimes the player has been charged with, saved with the player.
Nothing in the server raises it any more: the old crime counting in justice.cpp is commented out, and logcrime() leaves it alone. It keeps what was saved, and what DIL programs set. In the public zones, Midgaard's police won't take on a deputy whose count is above 0 (midgaard.zon), the police academy throws such a deputy out (function.zon), and the arena saves and restores it around a fight (arena.zon).
Notes
- Players only. On an NPC, an object, a room or null the field fails.
- Stored as a 16-bit unsigned number: values outside 0 to 65535 wrap around.
- Whether a player is wanted shows in charflags (
CHAR_OUTLAW), not here.
Example
dilbegin integer clean_record(pc : unitptr);
code
{
if (pc.type != UNIT_ST_PC)
return (FALSE);
if (pc.crimes > 0)
return (FALSE);
return (not isset(pc.charflags, CHAR_OUTLAW));
}
dilend
Tells whether a player has no crimes on record and is not an outlaw, as Midgaard's police check before taking on a deputy (midgaard.zon).