Buddy List

Posted by Halomantis on Sun 06 Jul 2003 10:41 PM — 4 posts, 16,822 views.

#0
I got the code notify from
http://www.alsherok.net/afkmud/scripts/download.php?file=Sadiq/notify.txt

Followed each and every step to put this code in. When I go to compile using Cygwin I get this error.

act_comm.c:1891: 'd' undeclared (first use in this function)

for ( d = first_descriptor; d; d = d->next )
{
CHAR_DATA *vch;
NOTIFY_DATA *temp;

temp = NULL;
vch = d->character;

if ( d->connected == CON_PLAYING && vch != ch)
{
for(temp = vch->pcdata->first_notify; temp; temp = temp->next)
{
if (on_notify(vch, ch) == TRUE && temp->name == ch->name )
{
set_char_color(AT_NOTIFY,vch);
ch_printf(vch,"NOTIFICATION: %s has left the game.\n\r",temp->name);
break;
}
}
}
}

I don't want to mess anything up so any help would be greatly appreciated!
#1
Ok got it sorry guys I did not look even close to hard enough. Just had to define 'd'. I think I forgot my coffee on this one.
#2
While I am on this subject I found a little question to ask.

I wanted to expand the code to notify me when someone has died that is on the list. According to the snippet

Note that this command may be expanded (To notify of deaths, for example) fairly easily.
The meat of the whole thing (as far as expanding the code) is this:

for ( d = first_descriptor; d; d = d->next )
{
CHAR_DATA *vch;
NOTIFY_DATA *temp;

temp = NULL;
vch = d->character;

if ( d->connected == CON_PLAYING && vch != ch)
{
for(temp = vch->pcdata->first_notify; temp; temp = temp->next)
{
if (on_notify(vch, ch) == TRUE && temp->name == ch->name )
{
set_char_color(AT_NOTIFY,vch);
ch_printf(vch,"NOTIFICATION: %s <your message here>.\n\r",temp->name);
break;
}
}
}
}

Just put that bit of code into whatever function you want to allow players to be notified of,
and change the message that's sent to the player.


Problem where is the death function? I am stupidly at a loss!!

Thanks beforehand!
#3
perhaps it's in the raw_kill function. You might want to add some sort of if check there?