Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Buddy List

Buddy List

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Halomantis   (27 posts)  Bio
Date Sun 06 Jul 2003 10:41 PM (UTC)
Message
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!
Top

Posted by Halomantis   (27 posts)  Bio
Date Reply #1 on Sun 06 Jul 2003 11:07 PM (UTC)
Message
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.
Top

Posted by Halomantis   (27 posts)  Bio
Date Reply #2 on Sun 06 Jul 2003 11:47 PM (UTC)
Message
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!
Top

Posted by Celestine   (29 posts)  Bio
Date Reply #3 on Mon 07 Jul 2003 10:42 PM (UTC)
Message
perhaps it's in the raw_kill function. You might want to add some sort of if check there?
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


15,245 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.