Re: Consent Command

From: David Cole (
Date: 04/30/02

You will need to remove the color codes if your not using this type of color
code or prefer no color. Your choice. I alone did not write this, I received
help from: Deidril: <>, this code is basically the
group code tweaked to work as  a consent command/system. Have fun with it.

If anyone wants to enlighten me on how to get this on the circle FTP, I will
put it there.

David Cole

Anywhere, place:
void PrintConsent(struct char_data *ch)
  struct char_data *k;
  struct consent_type *f;

  send_to_char("&ccConsent Information&cn\r\n", ch);
  send_to_char("&cc-=-=-=-=-=-=-=-=-=-&cn\r\n", ch);

  k = (ch->consenter ? ch->consenter : ch);

  sprintf(buf, "&ccYou are currently consenting: &cC$N&cn");
  act(buf, FALSE, ch, 0, k, TO_CHAR);

  send_to_char("\r\n&ccThe following people have given you their
consent:&cn\r\n", ch);
  for (f = ch->consented; f; f = f->next) {
    sprintf(buf, "&cC$N&cn");
    act(buf, FALSE, ch, 0, f->consented, TO_CHAR);

void ClearConsent(struct char_data *ch)
  struct char_data * victim;
  struct consent_type *f, *temp;

  victim = ch->consenter;

  if (!victim)

  for (f = victim->consented; f; f = f->next) {
    if (f->consented == ch ) {
      sprintf(buf2, "&cC%s &ccstops consenting you.&cn\r\n", GET_NAME(ch));
      send_to_char (buf2,victim) ;
      act("&ccYou stop consenting: &cC$N&cc.&cn", FALSE, ch, 0, victim,
      REMOVE_FROM_LIST(f, victim->consented,next);
      break ;
  ch->consenter = NULL;

  struct char_data *vict;
  struct consent_type *f;

  one_argument(argument, buf);

  if (!*buf)
  else if (!(vict = get_char_vis(ch, buf, FIND_CHAR_WORLD)))
     send_to_char(NOPERSON, ch);
  else if (IS_NPC(vict))
  send_to_char(NOPERSON, ch);
  else if (ch->consenter == vict)
  act("You have already given your consent to $M.", FALSE, ch, 0, vict,
  else if (vict == ch) {
    send_to_char ("&ccYou give your consent too yourself.&cn\n\r",ch);
  } else {
    ch->consenter = vict;
    CREATE(f, struct consent_type, 1);
    f->next = vict->consented;
    f->consented = ch;
    vict->consented = f;
    act("&ccYou give your consent too: &cC$N&cc.&cn", FALSE, ch, 0, vict,
    act("&cC$n &cchas given you $s consent.&cn", FALSE, ch, 0, vict,

in struct.h, above char_data:

struct consent_type {
   struct char_data *consented;
   struct consent_type *next;

in char_data, below the *master stuff:
   struct consent_type *consented;       /* List of chars consenting      */
   struct char_data *consenter;          /* Who is char consenting?       */

   | FAQ: |
   | Archives: |
   | Newbie List:   |

This archive was generated by hypermail 2b30 : 06/25/03 PDT