Hey all... I've just made a new communication channel that will echo the
text sent to the screen, and I was wondering if anyone can see any
problems with the code below. Also, I'm wondering how to log tells using
the mudlog function. Anyone feel like helping me out? :) I've tried
doing mudlog(buf, etc...) but it didn't work for my purposes. I wanted
to log the player sending the tell, and the player receiving the tell, in
their(i.e. So and so tells Whositz 'blah blah blah'). Thanks!!
void perform_send(struct char_data *ch, struct char_data *vict, char
*arg)
{
send_to_char(CCCYN(vict, C_NRM), vict);
sprintf(buf, "Your communicator crackles and you hear $n's voice saying
'%s'", arg);
act(buf, FALSE, ch, 0, vict, TO_VICT | TO_SLEEP);
sprintf(buf, "$n taps $s comm badge and says '%s'",ch, vict, arg);
act(buf, FALSE, ch, 0, vict, TO_NOTVICT | TO_SLEEP);
send_to_char(CCNRM(vict, C_NRM), vict);
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT))
send_to_char(OK, ch);
else {
send_to_char(CCCYN(ch, C_NRM), ch);
sprintf(buf, "You send to $N, '%s' over the communication link.",
arg);
act(buf, FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP);
sprintf(buf, "$n's communicator crackles and you hear $N saying
'%s'", arg);
act(buf, FALSE, vict, 0, ch, TO_ROOM);
send_to_char(CCNRM(ch, C_NRM), ch);
}
}
int is_send_ok(struct char_data *ch, struct char_data *vict)
{
if (ch == vict){
send_to_char("Your comm badge refuses to respond whenever you attempt
to send something to yourself.\r\n", ch);
return FALSE;
}
if (ROOM_FLAGGED(ch->in_room, ROOM_SOUNDPROOF)){
send_to_char("Your comm badge refuses to respond.\r\n", ch);
act("$n's communicator badge crackles as $E attempts to send a
message with it.", FALSE, ch, 0, vict, TO_ROOM);
return FALSE;
}
if (!IS_NPC(vict) && !vict->desc){ /* linkless */
act("$E's linkless at the moment.", FALSE, ch, 0, vict, TO_CHAR |
TO_SLEEP);
return FALSE;
}
if (PLR_FLAGGED(vict, PLR_WRITING)){
act("$E's writing a message right now; try again later.", FALSE, ch,
0, vict, TO_CHAR | TO_SLEEP);
return FALSE;
}
else
return TRUE;
}
ACMD(do_send)
{
struct char_data *vict;
half_chop(argument, buf, buf2);
if (!*buf)
send_to_char("Who do you wish to send a communication message
to?\r\n", ch);
else if(!*buf2)
send_to_char("What do you wish to send to them?\r\n", ch);
else if(!*buf && !*buf2)
send_to_char("Usage: send <character> <message>\r\n", ch);
else if (!(vict = get_char_vis(ch, buf)))
send_to_char(NOPERSON, ch);
else if (is_send_ok(ch, vict))
perform_send(ch, vict, buf2);
}
_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]
+------------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
| http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
+------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST