On Sun, 26 May 1996 zero@baker.cnw.com wrote:
>
> 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:
>
> ACMD(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);
> return;
> }
> if (load_char(arg, &chdata) < 0) {
> send_to_char("No character exists with that name.\r\n", ch);
> return;
> }
> send_to_char("\r\n[]=-=[]=-=[]=-=[]=-=[]=-=[]=-=[]=-=[]=-=[]"
> "=-=[]=-=[]=-=[]=-=[]=-=[]=-=[]\r\n", ch);
> if (chdata.level[0] >= LVL_IMMORT) {
> sprintf(buf, "\r\n[ %-12s ] %s %s\r\n",
> ((chdata.bracket == NULL) ? "" : chdata.bracket),
> chdata.name, 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.name, 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. */
I think you want:
connected_types[d->connected]
This is part of the descriptor data, I believe. Check out user command
in act.informative.c for more info/hints.
>
> send_to_char("\r\n[]=-=[]=-=[]=-=[]=-=[]=-=[]=-=[]=-=[]=-=[]"
> "=-=[]=-=[]=-=[]=-=[]=-=[]=-=[]\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?
>
> Thanks,
> Chris
>
>
This archive was generated by hypermail 2b30 : 12/18/00 PST