Re: Open/Closing/Unlocking/Locking Doors/Objects Message to player.

From: Welcor (
Date: 01/30/02

----- Original Message -----
From: "Abraham Dizon" <soldier2003@HOTMAIL.COM>
> Okay I got a problem right now. Its with open/closing/unlocking/locking
> door/objects message to the player that does all this ^. I can't seem to
> it to work right. The message to the player when they
> a door or an object. This is what I did in act.movement.c:

Here's a clue:
  char outbuf[200];

  sprintf(outbuf, "You %s %%s\r\n", cmd_door[scmd],
    ((obj) ? "" : "the "), (obj) ? obj->short_desc :
    (EXIT(ch, door)->keyword ? EXIT(ch, door)->keyword : "door");
  send_to_char(outbuf, ch);

In other words:
  First write to a buffer.
  THEN send to char.
  send_to_char() doesn't (yet)[1] support variable arguments.

>     send_to_char("You open the $\r\n", ch);
The $ sign is only used in act(), not in send_to_char.


[1] I can't recall having read that it ever will, but since it
    already has been changed to look like the sprintf call, it
    doesn't seem too far fetched.

   | FAQ: |
   | Archives: |
   | Newbie List:   |

This archive was generated by hypermail 2b30 : 06/25/03 PDT