ACMD(do_quit)

From: David Cole (tiznor@hotmail.com)
Date: 01/17/02


Hello again,

I'm redoing quit to give a prompt for quitting cause quitting on our mud
makes you drop everything and leave the game, I'm trying to through the PC
into a state then prompt them for yes or no then disconnect or go back inot
CON_PLAYING. Here's what I've written below, only problem is it doesn't
work, once you type quit, nothing happens. Any help would be greatful.

ACMD(do_quit)
{
  struct descriptor_data *d, *next_d;

  if (IS_NPC(ch)) {
 send_to_char("Monsters can't quit, go away.", ch);
    return;
  }

  if (GET_POS(ch) == POS_FIGHTING)
    send_to_char("No way!  You're fighting for your life!\r\n", ch);
  else
  if (GET_POS(ch) < POS_STUNNED)
    send_to_char("No way!  You're stunned, wait till your senses
clear!\r\n", ch);
  else

  for (d = descriptor_list; d; d = next_d) {
    next_d = d->next;
    if (d == ch->desc)
      continue;

   SEND_TO_Q("Quiting means you leave the game entirely and your saved\r\n"
       "to the room in which you leave. However quiting is not a\r\n"
    "proper way to leave the game, and as a consequence all of\r\n"
    "your equipment will we left in the room from which you\r\n"
    "quit. To avoid this, rent at an inn, or camp in a suitable\r\n"
    "room.\r\nAre you sure you want to quit (y/n)? ", d);
      STATE(d) = CON_QUIT;

  switch (STATE(d)) {
  case CON_QUIT:
    if (*arg == 'y' || *arg == 'Y') {
    if (!GET_INVIS_LEV(ch))
      act("$n has left the game.", TRUE, ch, 0, 0, TO_ROOM);
      sprintf(buf, "%s has quit the game.", GET_NAME(ch));
      mudlog(buf, NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE);
      send_to_char("You drop everything and leave the game.\r\n", ch);

      if (d->character && (GET_IDNUM(d->character) == GET_IDNUM(ch)))
        STATE(d) = CON_DISCONNECT;
        extract_char(ch);
        save_char(ch, ch->in_room);
 } else
    if (*arg == 'n' || *arg == 'N') {
      STATE(d) = CON_PLAYING;
 }
    break;
 }
  }
}

Thanks,
Dave (Tiznor)

It's probably staring me right in the face, in bold, bright, blinking
letters. But for some odd reason I still don't see it...

--
   +---------------------------------------------------------------+
   | 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