Re: [CODE] Info channel

From: ;P (siv@CYBERENET.NET)
Date: 04/07/98

> That may not be exact but it does work.  What i want to know is, is
> there a better way to do it? Im sure this is not a good way of doing it,
> though it does work.

i'd suggest actually making it into a channel, mostly to make sure that
the invisibilty stuff turns out ok..this is my info channel func..

void info_channel(char *info, int invis_lev)
  struct descriptor_data *i;

  /* now send all the strings out */
  for (i = descriptor_list; i; i = i->next) {
    if (!i->connected && i->character &&
        !PRF_FLAGGED(i->character, PRF_NOINFO) &&
        !PLR_FLAGGED(i->character, PLR_WRITING) &&
        GET_LEVEL(i->character) >= invis_lev) {

      if (COLOR_LEV(i->character) >= C_NRM)
        send_to_char(KBLU, i->character);
      send_to_char(info, i->character);
      if (COLOR_LEV(i->character) >= C_NRM)
        send_to_char(KNRM, i->character);

so you're sample call would look like:

sprintf(buf, "[Info] %s has returned to the game.\r\n", GET_NAME(ch));
info_channel(buf, GET_INVIS_LEV(ch));

so only people higher than the invis level will see the information..


     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

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