[CODE] Delete Command

From: Erik Lundin (cyrius@boden.mail.telia.com)
Date: 11/04/99


Hi everyone.. Here's a snippet to use on those whining maggots.
This command is used to "delete" players. Go figure. Use it
carefully.


/* ADD THIS(somewhere in act.wizard.c)*/
ACMD(do_delete)
{
  struct char_data *vict;
  one_argument(argument, buf);

   if(!*buf) {
   send_to_char("Who do you want to delete?\r\n", ch);
   return;
 }
  if ((vict = get_char_vis(ch, buf))) {
   if (!IS_NPC(vict) && (GET_LEVEL(ch) <= GET_LEVEL(vict))) {
        send_to_char("I don't think so.\r\n", ch);
        return;
      }
  SET_BIT(PLR_FLAGS(vict), PLR_DELETED);
  if(PLR_FLAGGED(vict, PLR_DELETED)) {
  sprintf(buf2, "[Info] : %s has been deleted by %s.\r\n",
                GET_NAME(vict),
          GET_NAME(ch));
  send_to_all(buf2);
 } else {
 return;
 }
  close_socket(vict->desc);
  extract_char(vict);       /* Bye Bye */
  send_to_char("Deleted.\r\n", ch);

 } else {
 send_to_char("That player isn't online.\r\n", ch);
 }
}
/*END(Save file)*/

Ok. Now open interpreter.c and fine this line:

ACMD(do_dc);

and add this line below:

ACMD(do_delete);

should now look like this:

ACMD(do_credits);
ACMD(do_dc);
ACMD(do_delete); /* This is our line */
ACMD(do_diagnose);
etc etc...

Now find:

  { "dc"       , POS_DEAD    , do_dc       , LVL_GOD, 0 },

and add this line below:

  { "delete"   , POS_DEAD    , do_delete   , LVL_GOD, 0 },

Compile and yer done!
That wasn't to hard.. or?

Regards
/Erik Lundin
cyrius@boden.mail.telia.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