[NEWBIE] [ASCII PFILE] [LONG] - Problem reading player files [PART 2]

From: Khayman (khayman_br@geocities.com)
Date: 04/19/00


AFTER PFILE ASCII:

ACMD(do_seguidor)
{

  char buft1[1000];
  char buft2[1000];
  char nome[20];
  extern struct player_index_element *player_table;
  int j, seg;
  struct char_data *victim;
/*  struct char_data *chdata;*/
/*  struct char_file_u chdata; */

  if (!*argument) {
     send_to_char("\r\nUse: SEGUIDOR <numero>\r\n\r\nEscolha uma das
seguintes divindades: \r\n\r\n1 - Khayman, o Ser Supremo da Justica\r\n2 -
Rash, o Ser Supremo da Morte e Destruicao\r\n3 - Sage, o Ser Supremo da
Sabedoria\r\n", ch);
     return;
  }

  one_argument(argument, arg);
  seg = atoi(arg);

  if (seg < 1 || seg > 3){
     send_to_char("\r\nUse: SEGUIDOR <numero>\r\n\r\nEscolha uma das
seguintes divindades: \r\n\r\n1 - Khayman, o Ser Supremo da Justica\r\n2 -
Rash, o Ser Supremo da Morte e Destruicao\r\n3 - Sage, o Ser Supremo da
Sabedoria\r\n", ch);
     return;
  }

  *buft1 = '\0';
  *buft2 = '\0';

  send_to_char("\r\nLista de seguidores de:\r\n",ch);
  sprintf(buft1, "%s", divindades[seg-1]);
  send_to_char(buft1, ch);

send_to_char("\r\n-----------------------------------------------------\r\n"
,ch);
  send_to_char("Online\r\n",ch);

send_to_char("-----------------------------------------------------\r\n",ch)
;

  *buft1 = '\0';

  for (j = 0; j <= top_of_p_table; j++){
     if((victim=is_playing((player_table +j)->name))) {
       if(GET_DIVINDADE(victim) == seg)

    sprintf(buft1 + strlen(buft1), "[%3d] %-20s - Atos: %1d\r\n",
GET_LEVEL(victim), GET_NAME(victim), GET_NIVEL_DIV(victim));
          } }
     else {

       CREATE(victim, struct char_data, 1);
       clear_char(victim);
       init_char(victim) /*I already tried with or without this*/
       /*CREATE(victim->player_specials, struct player_special_data, 1);*/
       strcpy(nome, (player_table +j)->name);
       if (load_char(nome, victim) > -1) {
          char_to_room(victim, 0);
          if(GET_DIVINDADE(victim) == seg)
             sprintf(buft2 + strlen(buft2), "[%3d] %-20s - Atos: %1d\r\n",
GET_LEVEL(victim), GET_NAME(victim), GET_NIVEL_DIV(victim));
          extract_char(victim);
       }
     }
  }

  send_to_char(buft1, ch);
  send_to_char("\r\n\r\nOffline\r\n",ch);

send_to_char("-----------------------------------------------------\r\n",ch)
;
  send_to_char(buft2, ch);

send_to_char("-----------------------------------------------------\r\n",ch)
;

  return;

}


     +------------------------------------------------------------+
     | 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