Re: Checking to see if a player is logged in

From: John Evans (evansj@HI-LINE.NET)
Date: 04/27/98

On Mon, 27 Apr 1998, Chuck Carson wrote:

> Is checking to see if a player is not an NPC and that they
> have a desc a safe way to see if they are logged in? I looked
> at the code from do_tell() and that is what it seemed to be
> doing.

I'd use the IS_NPC() macro.

> If not, where in the code is an example I could follow to check
> if a player is online at the moment?

Make sure that the victim's name is in buf and do:

  if (vict = get_char_vis(ch, buf)) {
    /* victim is in game */
  else {
    /* victim not in game */

> Also, how would I go about 'queuing (sp?)' the message until
> that player does log in? (Thus when they do log in, they would
> receive the same message)

Check the GET_BAD_PWS() macro and duplicate it. When they login check and
see if GET_NUM_ASKS(ch) (or whatever) is greater than 0, then give them
the message and reset the counter to 0.

John Evans <>  --

Any sufficiently advanced technology is indistinguishable from magic.
  -- Arthur C. Clarke

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

This archive was generated by hypermail 2b30 : 12/15/00 PST