[CODE] do_say snippet

From: Benjamin Draper (satrycus@DRACHENBURG.DEMON.CO.UK)
Date: 04/04/98


A few people asked me for this a while back. It's taken from the
Archipelago code on the ftp site, cleaned up a little. Do with it
what you will.

ACMD(do_say)
{
  skip_spaces(&argument);

  if (!*argument)
    send_to_char("Yes, but WHAT do you want to say?\r\n", ch);
  else {
       for (len = argument; *(len) != '\0'; len++);
       len--;
       switch (*len) {
       case '?':
           sprintf(buf1, "ask");
           break;
       case '!':
           sprintf(buf1, "exclaim");
           break;
       default:
           sprintf(buf1, "say");
           break;
       }
    sprintf(buf, "$n %ss, '%s'", buf1, argument);
    act(buf, FALSE, ch, 0, 0, TO_ROOM);
    if (PRF_FLAGGED(ch, PRF_NOREPEAT))
      send_to_char(OK, ch);
    else {
      sprintf(buf, "You %s, '%s'", buf1, argument);
      act(buf, FALSE, ch, 0, argument, TO_CHAR);
    }
  }
}

-> Ben


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST