Re: [CODE] Re: Linkload Snippet Question

From: Michael Gallagher (m_gally@hotmail.com)
Date: 12/28/99


Here is my command to give you a list of linkless players and
to disconnect them.

ACMD(do_disconnect)
{
  register struct char_data *victim, *next_ch;
  struct char_data *vict;
  int found = 0;

  one_argument(argument, arg);

  if (!*arg) {
    send_to_char("Disconnect who?\r\n", ch);
    return;
  }
  if (!(str_cmp(arg, "list"))) {

   send_to_char("Linkless Players:\r\n\n", ch);

   for (victim = character_list; victim; victim = next_ch) {
     next_ch = victim->next;

     if (IS_NPC(victim))
       continue;

     if (victim->desc)
       continue;

     sprintf(buf, "[%3d %-3.3s] %s \r\n", GET_LEVEL(victim),
CLASS_ABBR(victim), GET_NAME(victim));
     send_to_char(buf, ch);
     found++;
   }
   send_to_char("\r\n", ch);
   sprintf(buf1, "There are %d Linkless Players on at the moment.\r\n",
found);
   send_to_char(buf1, ch);
   return;
  }
  if (!(vict = get_char_vis(ch, arg, FIND_CHAR_WORLD))) {
    send_to_char("There is no player by that name on the mud!\r\n", ch);
    return;
  }
  if (!IS_NPC(vict) && !vict->desc) {
    send_to_char("Disconnecting Linkless Player.\r\n", ch);
    Crash_rentsave(vict, 0);
    extract_char(vict);
    return;
  }
  else {
    send_to_char("That player isn't linkless!!!\r\n", ch);
    return;
  }
}

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com


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



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