Hello. This is an eradicate snippet for SunderMud2.1a. Its very similar to the vape and nuke snippets found on the net, which is a high-level (implementor) command to delete a player file. I thought eradicate fitted in a medieval theme :) This is my first snippet, so I'm sure there are quite a few things that could have been done differently and better. Constructive criticism is more than welcome. If you use this code, I just ask that keep the headers and comments intact. A mention in any "help additions or snippets" help file would be nice but isn't necessary. Also, if you want, send an e-mail to dregnus@yahoo.com and tell me what you think of it. This works as far as I know but could probably use more extensive testing. I take no responsibility for any damage to your MUD. If you find a bug, e-mail it to me. 1) Backup your source code, and accounts.DAT file (couldn't hurt to backup the whole MUD) 2) Add the following functions to act_comm.c (act_wiz.c would probably be a better place, but oh well) /* Dregnus - Command to prevent accidental eradicate/"vape" of a player */ void do_eradicat ( CHAR_DATA * ch, char *argument ) { send_to_char( "You must type out the full command to eradicate a player.\n\r", ch ); } /* Dregnus - Command to remove a targets pfile */ void do_eradicate ( CHAR_DATA * ch, char *argument ) { char arg[MAX_INPUT_LENGTH]; char buf[MAX_STRING_LENGTH]; CHAR_DATA *victim; buf[0] = '\0'; one_argument ( argument, arg ); if ( IS_NPC ( ch ) ) return; if ( arg[0] == '\0' ) { send_to_char ( "Eradicate whom?", ch ); return; } if ( ( victim = get_char_world ( ch, arg ) ) == NULL ) { send_to_char ( "They aren't here.\n\r", ch ); return; } if ( get_trust ( victim ) >= get_trust ( ch ) ) { send_to_char ( "You failed.\n\r", ch ); return; } /* At this point we have found a victim, and the proper checks have been made. Now lets make sure we really want to eradicate this player Thought about adding a Y,N prompt here. But it seems that I really shouldn't try to accept input outside of game_loop_unix. Too much trouble If you know a way to do this, please email me (dregnus@yahoo.com) */ // act_new ( "\a{RYou are about to eradicate $N.{x\n\r{RAre you sure you wish to do this?{x" TXT_YESNO "{x\n\r", ch, NULL, victim, TO_CHAR, POS_DEAD ); /* Horrible hack to print a message to all online */ SNP ( buf, "{Y*** %s has been eradicated by %s {Y***{w\r\n", victim->name, ch->name ); do_echo ( ch, buf ); /* Why re-invent the wheel? This handles the pfile and accounts.DAT details */ real_delete (victim); } 3) In interp.c, add the following two lines under immortal commands, after disconnect {"eradicat", do_eradicat, POS_DEAD, ML, LOG_ALWAYS, 1, "Prevents accidental eradication.", CMD_IMM}, {"eradicate", do_eradicate, POS_DEAD, ML, LOG_ALWAYS, 1, "Deletes a player file.", CMD_IMM}, 4) In interp.h, add the following two lines after enter.. DECLARE_DO_FUN( do_eradicat ); /* Dregnus - prevents accidental eradication */ DECLARE_DO_FUN( do_eradicate ); /* Dregnus - added to prevent accidental eradication */ 5) In proto.h, add the following line under /*act_wiz.c */ to support the horrible hack above. void do_echo args( ( CHAR_DATA *ch, char *argument ) ); 6) Make clean, compile, and copyover/reboot That should be it. In my test, I created two characters, Testman and Testmandog. The command I used was eradicate "testman". Because testmandog logged in after testman, he was eradicated instead of testman. If you know of any way to prevent that, let me know. Also any alternative to the horrible hack above would be appreciated. Enjoy :)