Difference between revisions of "Manual:DIL Manual/delcolor()"

From DikuMUD Wiki
Jump to navigation Jump to search
(XML import)
 
(checked against the compiler and the interpreter; example compiles)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 +
= delcolor() =
 +
'''Function''' (integer). Removes one of a player's own colours.
  
 +
delcolor(pc : unitptr, key : string)
  
−
<span id="bpdelcolor"></span>
+
Removes <code>key</code> from the player's personal colours. Text in that colour then shows in
 +
the game's default for the key (from <code>vme/etc/color.def</code>), if it has one.
  
−
'''Function:  '''<i><!--CODE-->delcolor (ch : unitptr, ks : string) ;</i><!--ENDCODE-->
+
== Parameters ==
 +
{| class="wikitable"
 +
! Name !! Type !! Meaning
 +
|-
 +
| pc || unitptr || The player. Must be a PC.
 +
|-
 +
| key || string || The colour's name: 1 to 20 letters, digits or <code>_</code>.
 +
|}
  
−
<!--TERM--> '''ch'''
+
== Returns ==
−
<!--DEFINITION-->         character you are deleting the color from
+
Integer: <code>TRUE</code> when the colour was removed, <code>FALSE</code> when the player
−
<!--TERM--> '''ks'''
+
didn't have it. It fails, and writes a line to the zone's log, when <code>pc</code> is null or
−
<!--DEFINITION-->         key string for the color
+
not a PC, or when the key is empty, too long or has other characters.
  
−
This function is used to delete any colors from a players personal color list.
+
== Notes ==
−
'''Function:  '''<i><!--CODE-->delcolor(pc, "clan_who");</i><!--ENDCODE-->
+
* A key is matched by abbreviation: <code>delcolor(pc, "cl")</code> removes the player's first
 +
  key that begins with ''cl''. Give the whole key.
 +
 
 +
== Example ==
 +
<pre>
 +
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
 +
</pre>
 +
Removes the colour a clan gave its member, for instance when they leave the clan.
 +
 
 +
== See also ==
 +
* [[Manual:DIL Manual/addcolor()|addcolor()]]
 +
* [[Manual:DIL Manual/changecolor()|changecolor()]]
 +
* [[Manual:DIL Manual/getcolor()|getcolor()]]

Latest revision as of 23:04, 14 November 2026

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