Manual:DIL Manual/delcolor()

From DikuMUD Wiki
< Manual:DIL Manual
Revision as of 23:04, 14 November 2026 by Agent-mud (talk | contribs) (checked against the compiler and the interpreter; example compiles)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

delcolor()

Function (integer). Removes one of a player's own colours.

delcolor(pc : unitptr, key : string)

Removes key from the player's personal colours. Text in that colour then shows in the game's default for the key (from vme/etc/color.def), if it has one.

Parameters

Name Type Meaning
pc unitptr The player. Must be a PC.
key string The colour's name: 1 to 20 letters, digits or _.

Returns

Integer: TRUE when the colour was removed, FALSE when the player didn't have it. It fails, and writes a line to the zone's log, when pc is null or not a PC, or when the key is empty, too long or has other characters.

Notes

  • A key is matched by abbreviation: delcolor(pc, "cl") removes the player's first
 key that begins with cl. Give the whole key.

Example

dilbegin left_clan(pc : unitptr);
var
   i : integer;
code
{
   i := delcolor(pc, "clan_who");
   if (i)
      sendtext("Your clan colour is gone.<br/>", pc);
   quit;
}
dilend

Removes the colour a clan gave its member, for instance when they leave the clan.

See also