Re: [Circle] do_guild help pls? warning I don't like..

From: Niese-Petersen (Tenp@cris.com)
Date: 08/02/96


> ACMD(do_guild)
> {
>   struct char_data *vict;
>   *buf = '\0';
> 
>   if (!IS_NPC(vict) && !PRF_FLAGGED(vict, PRF_GUILD)) {
                 ^
                 |
            What 'vict' ??  Before if do something like this:

   one_argument(argument, argument);
   if(!*argument) {
     send_to_char("Guild whom ?\n\r", ch);
     return;
   } else if (!(vict = get_char_vis(ch, argument))) {
     send_to_char("No character with that name.\n\r", ch);
     return;
   }

/* Now you know who vict is. if() away...
     

>     sprintf(buf, "$N is now a guild member.");
      You really need to know the difference between the use of
      sprintf and act() ..
try:  sprintf(buf, "%s is now a guild member.\n\r", GET_NAME(vict));
or :  act("$N is now a guild member.", FALSE, ch, 0, vict, TO_CHAR);
      /* And for act() ofcoz drop send_to_char(buf, ch);  */
>     send_to_char(buf, ch);
>     send_to_char("You are now a guild member.", vict);
>     SET_BIT(PRF_FLAGS(vict), PRF_GUILD);
>   } else {
>     send_to_char("They are already in a guild.", ch);
>     return;
>   }
> }
And in send_to_char() try add some \n\r on it.. Else your prompt will
end up right after that line.


---
Erik Niese-Petersen
Aka Quint The typo God
Realms of Darkness IMP [matrix.xiii.com 6666. Playertesting]


+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



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