char * ignore;
send_to_char("Ignoring:",ch);
for( short i = 0; i < MAX_IGNORE, i++ )
{
char buf[256];
sprintf(buf," %s",ch->pcdata->ignore[i]);
send_to_char(buf,ch);
}
send_to_char("\r\n",ch);
send_to_char("Ignoring:",ch);
for( short i = 0; i < MAX_IGNORE, i++ )
{
char buf[256];
sprintf(buf," %s",
ch->pcdata->ignore[i]);
send_to_char(buf, ch);
}
send_to_char("\r\n",ch);
gcc -Wall -O -ggdb -DNOCRYPT -DQMFIXES -c -o obj/act_info.o act_info.c
act_info.c: In function `do_score':
act_info.c:1838: error: 'for' loop initial declaration used outside C99 mode
act_info.c:1838: warning: left-hand operand of comma expression has no effect
act_info.c:1838: error: parse error before ')' token
act_info.c: At top level:
act_info.c:1845: error: parse error before string constant
act_info.c:1845: warning: type defaults to `int' in declaration of `send_to_char
'
act_info.c:1845: error: conflicting types for 'send_to_char'
merc.h:2398: error: previous declaration of 'send_to_char' was here
act_info.c:1845: error: conflicting types for 'send_to_char'
merc.h:2398: error: previous declaration of 'send_to_char' was here
act_info.c:1845: warning: data definition has no type or storage class
act_info.c:1847: error: parse error before string constant
act_info.c:1847: warning: type defaults to `int' in declaration of `sprintf'
act_info.c:1847: error: conflicting types for 'sprintf'
act_info.c:1847: note: a parameter list with an ellipsis can't match an empty pa
rameter name list declaration
act_info.c:1847: error: conflicting types for 'sprintf'
act_info.c:1847: note: a parameter list with an ellipsis can't match an empty pa
rameter name list declaration
act_info.c:1847: warning: data definition has no type or storage class
act_info.c:1848: warning: type defaults to `int' in declaration of `send_to_char
'
act_info.c:1848: warning: parameter names (without types) in function declaratio
n
act_info.c:1848: warning: data definition has no type or storage class
act_info.c:1850: error: parse error before string constant
act_info.c:1850: warning: type defaults to `int' in declaration of `sprintf'
act_info.c:1850: warning: data definition has no type or storage class
act_info.c:1851: warning: type defaults to `int' in declaration of `send_to_char
'
act_info.c:1851: warning: parameter names (without types) in function declaratio
n
act_info.c:1851: warning: data definition has no type or storage class
act_info.c:1853: error: parse error before string constant
act_info.c:1853: warning: type defaults to `int' in declaration of `send_to_char
'
act_info.c:1853: warning: data definition has no type or storage class
make: *** [obj/act_info.o] Error 1
for( short i = 0; i < MAX_IGNORE, i++ )
if( ch->pcdata->ignore[i] != NULL && strlen(ch->pcdata->ignore[i]) > 0)prior to sprintf
*buf = 0;
char buf[256];
send_to_char("/ Ignoring:",ch);
for (i = 0; i < MAX_IGNORE; i++)
{
*buf = 0;
char buf[256];
if( ch->pcdata->ignore[i] != NULL && strlen(ch->pcdata->ignore[i]) > 0)
sprintf(buf," %s",
ch->pcdata->ignore[i]);
send_to_char(buf, ch);
}
send_to_char("\r\n",ch);
send_to_char("/ Ignoring:",ch);
for (i = 0; i < MAX_IGNORE; i++){
char buf[256];
if( ch->pcdata->ignore[i] != NULL && strlen(ch->pcdata->ignore[i]) > 0){
sprintf(buf," %s", ch->pcdata->ignore[i]);
send_to_char(buf, ch);
}
}
send_to_char("\r\n",ch);
void do_icheck (CHAR_DATA * ch, char *argument)
{
char buf[256];
int i;
send_to_char("Ignoring:",ch);
for (i = 0; i < MAX_IGNORE && ch->pcdata->ignore[i] != NULL; i++)
{
sprintf(buf," %s",ch->pcdata->ignore[i]);
send_to_char(buf,ch);
}
send_to_char("\r\n",ch);
}
send_to_char("/ Ignoring:",ch);
for (i = 0; i < MAX_IGNORE; i++)
{
char buf[256];
if( ch->pcdata->ignore[i] != NULL && strlen(ch->pcdata->ignore[i]) > 0)
{
sprintf(buf," %s", ch->pcdata->ignore[i]);
send_to_char(buf, ch);
}
}
send_to_char("\r\n",ch);
bool found = FALSE;
send_to_char("/ Ignoring:",ch);
for (i = 0; i < MAX_IGNORE; ++i){
char buf[256];
if( ch->pcdata->ignore[i] != NULL && strlen(ch->pcdata->ignore[i]) > 0){
sprintf(buf," %s", ch->pcdata->ignore[i]);
send_to_char(buf, ch);
found = TRUE;
}
}
if(!found)
send_to_char("none", ch);
send_to_char("\r\n",ch);
if (none))
{
free_string(ignore[pos]);
rch->pcdata->ignore[pos] = NULL;
return;
}
}
if(!str_cmp(arg, "none")){
for(pos = 0; pos < MAX_IGNORE; ++pos){
if(ch->pcdata->ignore[pos]){
free_string(ch->pcdata->ignore[pos]);
ch->pcdata->ignore[pos] = NULL;
}
}
send_to_char("Ignores cleared.\r\n", ch);
return;
}
– Makefile
Add ignore.o to the O_FILES section.
– act_comm.c
Somewhere up towards the top, add the line:
extern bool is_ignoring(CHAR_DATA *ch, CHAR_DATA *victim);
In the do_tell function, before the lines:
act( "&rYou tell $N '$t'&x", ch, argument, victim, TO_CHAR );
act_new("&r$n tells you '$t'&x",ch,argument,victim,TO_VICT,POS_DEAD);
victim->reply = ch;
Add:
if (is_ignoring(victim, ch))
{
sprintf(buf, "%s is ignoring you.\n\r", victim->name);
send_to_char(buf, ch);
return;
}
– save.c
Before the line:
/* write alias */
Add:
for (pos = 0; pos < MAX_IGNORE; pos++)
{
if (ch->pcdata->ignore[pos] == NULL)
break;
fprintf(fp, "Ignore %s~\n", ch->pcdata->ignore[pos]);
}
Before the line:
KEY( "Id", ch->id, fread_number( fp ) );
Add:
if (!str_cmp( word, "Ignore"))
{
if (count >= MAX_IGNORE)
{
fread_to_eol(fp);
fMatch = TRUE;
break;
}
ch->pcdata->ignore[count] = fread_string(fp);
count++;
fMatch = TRUE;
break;
}
– interp.c
Before the line:
{ "inventory", do_inventory, POS_DEAD, 0, LOG_NORMAL, 1 },
Add:
{ "ignore", do_ignore, POS_DEAD, 0, LOG_NORMAL, 1 },
– interp.h
Before the line:
DECLARE_DO_FUN( do_imotd );
Add:
DECLARE_DO_FUN( do_ignore );
– merc.h
Before the line:
#define MAX_CLASS 4
Add:
#define MAX_IGNORE 4
Before the lines:
char * alias[MAX_ALIAS];
char * alias_sub[MAX_ALIAS];
Add:
char * ignore[MAX_IGNORE];
What I'm hoping to do.. is display the people that I'm ignoring in 'score'..
right now I've got:
This displays the following Warning:
So I tried adding this into merc.h:
but that just displays: