Code:
clan.c
CLAN_FUNC(perform_clan_tell)
{
struct descriptor_data* d;
char buf[MAX_STRING_LENGTH];
struct clan_data* clan = GET_CLAN(ch);
if (!GET_CLAN(ch))
{
send_to_char(ch, "You need to be an initiate or higher in a clan.\r\n");
return;
}
for (d = descriptor_list; d; d = d->next) {
if (d->connected)
continue;
if (GET_CLAN(d->character) == GET_CLAN(ch))
{
char buf2[MAX_STRING_LENGTH + 14], *msg;
//*buf = '\0';
if (ch == d->character) /* from char */
sprintf(buf2, "[%s] %s:%s", clan->name, GET_NAME(ch), arg),
msg = act(buf2, FALSE, d->character, 0, 0, TO_CHAR | DG_NO_TRIG),
add_history(d->character, msg, HIST_CLAN);
else {/* going to clan */
sprintf(buf2, "[%s] %s:%s", clan->name, GET_NAME(ch), arg);
msg = act(buf2, FALSE, d->character, 0, 0, TO_CHAR | DG_NO_TRIG);
add_history(d->character, msg, HIST_CLAN);
}
}
}
}
Constants.c
/** The names of the different channels that history is stored for.
* @todo Only referenced by do_history at the moment. Should be moved local
* to that function. */
const char *history_types[] = {
"all",
"say",
"gossip",
"wiznet",
"tell",
"shout",
"grats",
"holler",
"auction",
"clan",
"\n"
};
Struts.h:
/* History */
#define HIST_ALL 0 /**< Index to history of all channels */
#define HIST_SAY 1 /**< Index to history of all 'say' */
#define HIST_GOSSIP 2 /**< Index to history of all 'gossip' */
#define HIST_WIZNET 3 /**< Index to history of all 'wiznet' */
#define HIST_TELL 4 /**< Index to history of all 'tell' */
#define HIST_SHOUT 5 /**< Index to history of all 'shout' */
#define HIST_GRATS 6 /**< Index to history of all 'grats' */
#define HIST_HOLLER 7 /**< Index to history of all 'holler' */
#define HIST_AUCTION 8 /**< Index to history of all 'auction' */
#define HIST_CLAN 9 /**< Index to history of all 'clan' */
#define NUM_HIST 10 /**< Total number of history indexes */
#define HISTORY_SIZE 30 /**< Number of last commands kept in each history */