Re: [CODE][NEWBIE]The set name command for the last time

From: Invincibill (bill@longboys.net)
Date: 02/16/99


just modify the char_to_store function. i think its in there.

Julian Buckley wrote:
>
> > case 50:
> >    if (GET_LEVEL(ch) < GET_LEVEL(vict)) {
> >     send_to_char("That isn't such a good idea.",ch);
> >     return 0;
> >    }
> >      vict->player.name = str_dup(val_arg);
> >   strcpy(vict->player.name, val_arg);
> >   sprintf(buf, "Your name has been changed to %s by %s.\r\n",
> > GET_NAME(vict),GET_NAME(ch));
> >      send_to_char(buf, vict);
> >   sprintf(buf, "Name changed to %s.\r\n",GET_NAME(vict));
> >   send_to_char(buf, ch);
> >   save_char(vict, NOWHERE);
> >   build_player_index();
> >   break;
>
> My code looks like the following, and I also have the
> "can-log-in-as-old-name" thing, but after I reboot it fixes it :)  If
> anyone knows of the function that updates the binary playerfile so it's
> taken the new name, it'd be appreciated.
>
> ***START***
> case 54:
>   sprintf(buf, "%s just changed your name from %s to %s!\r\n",
>     GET_NAME(ch), GET_NAME(vict), val_arg);
>   send_to_char(buf, vict);
>   free(GET_NAME(vict));
>   set_name(vict, val_arg);
>   save_char(vict, NOWHERE);
>   break;
> ***END***
>
> -----------------------------------------------------------------
>  Julian Buckley, 3rd Year Computer Systems Engineering
>  Dept. Computer Science and Electrical Engineering, Univ. of Qld
>  E-Mail: s348266@student.uq.edu.au
>  Web Page: http://student.uq.edu.au/~s348266/index.html
> -----------------------------------------------------------------
>
>      +------------------------------------------------------------+
>      | Ensure that you have read the CircleMUD Mailing List FAQ:  |
>      |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
>      +------------------------------------------------------------+

--
Weather forecast for today: Sunny & Mild
Weather forecast for tomorrow : Sunny & Mild
www.giftsgalore.com : www.longboys.net
telnet://undying.longboys.net:4000 http://undying.longboys.net


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