[CODE] whois question again

From: Ryan Le Gros (malevolent@mindinfo.com)
Date: 03/27/00


Ok new question about the whois snippet: Im trying to show someone who
performs a whois on another player, the date they created and the date they
last logged on. again I stole 3 lines from do_stat_char in act.wizard.c to
perform this but instead of showing the players creation date and last login
date of who i am whoising, it shows th eplayer who performs the whois. Not
sure what I am doing wrong here, compiles fine, no crashes/errors, it just
doesnt work right.

heres the code:

ACMD(do_whois)
{
  struct char_data *victim = 0;
  struct char_file_u tmp_store;

  skip_spaces(&argument);

  if (!*argument) {
      send_to_char("Who do you want to know about?\r\n", ch);
    } else {
      CREATE(victim, struct char_data, 1);
      clear_char(victim);
      if (load_char(argument, &tmp_store) > -1) {
        store_to_char(&tmp_store, victim);
        strcpy(buf1, (char *)
asctime(localtime(&(victim->player.time.birth))));     <----- Added from
do_stat_char
        strcpy(buf2, (char *)
asctime(localtime(&(victim->player.time.logon))));     <----- Added from
do_stat_char
        buf1[10] = buf2[10] = '\0';     <----- Added from do_stat_char
        sprintf(buf, "%s %s is a level %d %s %s %s\r\nBrand: %s\r\nCreated:
%s\r\nLast Logged on: %s\r\n",
                GET_NAME(victim), (victim->player.title), GET_LEVEL(victim),
genders[(int) GET_SEX(victim)],
                pc_race_types[(int) GET_RACE(victim)], pc_class_types[(int)
GET_CLASS(victim)],
                pc_deity_types[(int) GET_DEITY(victim)], buf1, buf2);
        send_to_char(buf, ch);
      } else {
        send_to_char("There is no such player.\r\n", ch);
      }
      free(victim);
    }

}

Help is appreciated again, thanks
Malevolent


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/10/01 PDT