You have
victim->pcdata->buffer
but you should really be getting the buffer of the player who killed the
mob,
not the mob's buffer (which does not exist since it does not have pcdata).
I would put the if( ) check in stop_fighting( ) so you will display the
message to anyone who killed the mob (if they were a group).
for ( fch = char_list; fch != NULL; fch = fch->next )
{
if ( fch == ch || ( fBoth && fch->fighting == ch ) )
{
fch->fighting = NULL;
fch->position = IS_NPC(fch) ? fch->default_pos : POS_STANDING;
update_pos( fch );
+ if( !IS_NPC(fch) && buf_string(fch->pcdata->buffer)[0] != '\0' )
+ send_to_char( "You receives tells during fighting, type
`replay.'\n\r";
}
}
That should do the trick.
A minor remarks:
buf[0] = UPPER(buf[0]);
was used to uppercase the name of the sender.
Since you added colour code in front, you would have to change it to
buf[14] = UPPER(buf[14]);
or
capitalize your PERS after it return a string.
Htam
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: 2003.11.16 14:53
Subject: (no subject)
> Ok list, here is a new one! I've been trying to figure out a way to
store tells while fighting. here is what i've come up with so far.
>
> /*SNIP< Do_Tell ) */
>
> if (victim->fighting != NULL)
> {
> if (IS_NPC(victim))
> {
> act("$E is a mob, and can't recieve
tells.",ch,NULL,victim,TO_CHAR);
> return;
> }
>
> act("$E is fighting, but your tell will go through when $E is done.",
> ch,NULL,victim,TO_CHAR);
> sprintf(buf,"{R<{W*{R>{x{M %s tells you
'%s'{x\n\r",PERS(ch,victim),argument);
> buf[0] = UPPER(buf[0]);
> add_buf(victim->pcdata->buffer,buf);
> return;
> }
>
>
>
> My question is, what should i put in Raw_kill? (assuming this would be a
good place to put it) because i have tried the following
>
>
> /* As suggested by Gabrielle Taylor */
> if ( buf_string( victim->pcdata->buffer )[ 0 ] == '\0' )
> send_to_char( "{x", victim );
> else
> send_to_char( "You have tells waiting. Type replay.\n\r",
victim );
> /* thru here */
>
>
> and the line
> if ( buf_string( victim->pcdata->buffer )[ 0 ] == '\0' )
> throws an error code -> subscript requires array or pointer type
>
>
> Im at a loss, so... any help would be appreciated
>
> Atm!
>
> __________________________________________________________________
> McAfee VirusScan Online from the Netscape Network.
> Comprehensive protection for your entire computer. Get your free trial
today!
> http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397
>
> Get AOL Instant Messenger 5.1 free of charge. Download Now!
> http://aim.aol.com/aimnew/Aim/register.adp?promo=380455
>
> --
> ROM mailing list
> [email protected]
> http://www.rom.org/cgi-bin/mailman/listinfo/rom