Adding a Sayto snippet

Posted by LunaticStriker on Wed 24 Aug 2005 10:52 PM — 4 posts, 16,375 views.

USA #0
Alright my main promblem is not a compile error but a usage promblem.

void do_sayto(CHAR_DATA *ch, char *argument)
{
char arg[MAX_INPUT_LENGTH];/*, buf[MAX_STRING_LENGTH]*/
CHAR_DATA *victim;

argument = one_argument (argument, arg);

if (arg[0] == '\0' || argument[0] == '\0')
{
send_to_char ("Say what to whom?\n\r", ch);
return;
}

if ((victim = get_char_world (ch, arg)) == NULL ||
victim->in_room != ch->in_room )
{
send_to_char ("They are not here.\n\r",ch);
return;
}
else
{
act ("""You say to $N '""$t"
"'{x", ch, argument, victim, TO_CHAR);

act_new ("""$n says to you '""$t"
"'{x", ch, argument, victim, TO_VICT, POS_DEAD);

act_new ("""$n says to $N '""$t"
"'{x", ch, argument, victim, TO_ROOM, POS_DEAD);

}


The promblem being that it sends the message "Blah says to you 'poo'" and "Blah says to Blah2 'poo'".

I just want it to send to the victim the "Blah says to you 'poo'" portion and hide the "Blah says to Blah2 'poo'".

But I still want the room to see the message just not have it show up on the victims screen since he already gets the message.

Please help me!
USA #1
So it's sending two messages to the victim? Try changing TO_ROOM to TO_NOTVICT, that should fix it, but that's in Smaug. It may not work.
USA #2
Ya, I am using ROM 2.4b6 but I will try that anyhow maybe I will get lucky.
USA #3
Freaking awesome! it worked! Thank you so much!

Completed ROM 2.4b6 stock do_sayto Snippet:

void do_sayto(CHAR_DATA *ch, char *argument)
{
char arg[MAX_INPUT_LENGTH];/*, buf[MAX_STRING_LENGTH]*/
CHAR_DATA *victim;

argument = one_argument (argument, arg);

if (arg[0] == '\0' || argument[0] == '\0')
{
send_to_char ("Say what to whom?\n\r", ch);
return;
}

if ((victim = get_char_world (ch, arg)) == NULL ||
victim->in_room != ch->in_room )
{
send_to_char ("They are not here.\n\r",ch);
return;
}
else
{
act ("""You say to $N '""$t"
"'{x", ch, argument, victim, TO_CHAR);

act_new ("""$n says to you '""$t"
"'{x", ch, argument, victim, TO_VICT, POS_DEAD);

act_new ("""$n says to $N '""$t"
"'{x", ch, argument, victim, TO_NOTVICT, POS_DEAD);


}