SMAUG: "Echo to player" snippet by Zeno ======================================= Description ----------- This snippet for SMAUG creates a new command (pecho) that is used to echo a single message to one player. The echo does not label who the message is from, as echo and recho does. This is intended to be an Immortal command and does not require the user to be in the same room to echo to the target. Support ------- All support for this snippet (and any of my snippets) must be posted on MudBytes (mudbytes.net) under the appropriate code. Find this snippet on MudBytes, post a new comment, and I will reply as soon as possible. Sharing ------- All of my released code can be distributed anywhere as long as credit is given when due. Please do not claim my code as your own. If you do distribute my code to other places, I'd like it if you notify me. My email address is zenomcdohl-AT-gmail-DOT-com, but please do not use this for support. Background ---------- This code was originally released at MudBytes (mudbytes.net). Most (if not all) of my released code originated from the MUD I run (InuYasha Galaxy: iyg.arthmoor.com) which is a modified version of SmaugFUSS. Therefor all code I release has been tested and is currently running on a MUD open to the public. Everything should work as intended, but since I wrote most of this code years ago, improvements can probably be made to the code to make it more efficient. I'd appreciate it if you improve any of the code, that you would post the changes on MudBytes. You can find contact information and details about myself at the following URL: http://en.wikipedia.org/wiki/User:Zeno_McDohl Syntax ------ pecho -- Sends message to player. Installation ------------ 1.) Copy the following code (do_pecho) into your source (preferably act_wiz.c): void do_pecho( CHAR_DATA *ch, char *argument ) { CHAR_DATA *victim; char arg1[MAX_INPUT_LENGTH]; char arg2[MAX_INPUT_LENGTH]; argument = one_argument( argument, arg1 ); strcpy( arg2, argument ); if ( arg1[0] == '\0' || arg2[0] == '\0' ) { send_to_char( "pEcho at who and what?\n\r", ch ); return; } if ( ( victim = get_char_world( ch, arg1 ) ) == NULL ) { send_to_char( "They aren't here.\n\r", ch ); return; } ch_printf( ch, "&YYou echo to %s: %s&D\n\r", victim->name, arg2 ); ch_printf( victim, "&Y%s\n\r&D", arg2 ); } 4.) Add the appropriate line to mud.h for do_pecho and the 2 lines to tables.c. 5.) Make clean, make and hotboot/reboot the MUD. Use cedit to create the command.