Showing a players current state...
Date: 05/26/96

I wrote a command to show players some information about characters 
called finger.  The command works great but I want to add it so the 
players current state is also shown in this information and if they arent 
logged in then it shows "Not Connected." or something but i cant figure 
out how to determine whether a character is connected or not.  This is 
the current code for do_finger:

  struct char_file_u chdata;

  one_argument(argument, arg);
  if (!*arg) {
    send_to_char("Who do you wish to finger?\r\n", ch);
  if (load_char(arg, &chdata) < 0) {
    send_to_char("No character exists with that name.\r\n", ch);
               "=-=[]=-=[]=-=[]=-=[]=-=[]=-=[]\r\n", ch);
  if (chdata.level[0] >= LVL_IMMORT) {
     sprintf(buf, "\r\n[ %-12s ] %s %s\r\n",
       ((chdata.bracket == NULL) ? "" : chdata.bracket),, chdata.title);
  } else {
     send_to_char("\r\n-Ma-Cl-Th-Wa-Ba-", ch);
     sprintf(buf, "\r\n[%2d %2d %2d %2d %2d] %s %s\r\n", chdata.level[0],
     chdata.level[1], chdata.level[2], chdata.level[3], chdata.level[4],, chdata.title);
  send_to_char(buf, ch);
  sprintf(buf, "Last logon was at %s", ctime(&chdata.last_logon));
  send_to_char(buf, ch);

/* I want to add something here that shows a players current state. */

               "=-=[]=-=[]=-=[]=-=[]=-=[]=-=[]\r\n", ch);

Can someone please tell me where i check to see if the character is 
logged in and how to return their current state?


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