Consent Command

From: David Cole (tiznor@softhome.net)
Date: 04/10/02


Hello all,

I have, In my spare time been working on a consent command. The theory
behind this is that a play can give their consent to another player, this
will then allow the player with the other players consent to handler things
such as dragging, the person they have consent from, corpse or being able to
see this player when normal they shouldn't etc, my only problem with this
whole thing, is that I've hit a wall and can't seem to grasp where I have
gone wrong. I've basicly copyed the group code to do this, the code is
below. The problem is, they can give another player there consent, but it
actually doesn't give that target the consent or that player. Any help would
be appreciated and if what I've written isn't enough, please, by all means
ask and i'll write more.

void PrintConsent(struct char_data *ch)
{
  struct char_data *k;
  struct consent_type *f;

  send_to_char("Consent Information\r\n", ch);
  send_to_char("-=-=-=-=-=-=-=-=-=-\r\n", ch);

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

  sprintf(buf, "You are currently consenting: $N");
  act(buf, FALSE, ch, 0, k, TO_CHAR);

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


ACMD(do_consent)
{
  struct char_data *vict;
  struct consent_type *f, *next_fol;

  one_argument(argument, buf);

  if (!*buf)
    PrintConsent(ch);
  else if (!(vict = get_char_vis(ch, buf, NULL, 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,
TO_CHAR);
  else if (vict == ch) {
    sprintf(buf2, "%s stops consenting you.\r\n", GET_NAME(ch));
    for (f = ch->consented; f; f = next_fol) {
      next_fol = f->next;
   send_to_char(buf2, f->consented);
 }
    act("You stop consenting: $N.", FALSE, ch, 0, vict, TO_CHAR);
  } else {
    vict->consenter = ch;
    act("You give your consent too: $N.", FALSE, ch, 0, vict, TO_CHAR);
    act("$n has given you $s consent.", FALSE, ch, 0, vict, TO_VICT);
  }
}

Thanks,
Dave

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



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