어디

2007.04.12 11:37

그리움 조회 수:211 추천:55

※ 어디 소스
어디라고 치면 사용자의 위치가 나타난다.
※ 사용방법
1. OBJECT.C에 카피한다.
2. MEXTERN.H 로 이동해서 OBJECT.C 으로 간다.
int <-- whowhere();<--이렇게 적는다.
3. GLOBAL.C로 이동해서 { "어디", 101, "whowhere" }, <--이렇게 적는다.
4. make


/*************************************************/
/* whowhere (어디) */
/*************************************************/
int whowhere(ply_ptr, cmnd)
creature *ply_ptr;
cmd *cmnd;
{
   creature *crt_ptr;
   room *rom_ptr;
   long t;
   int fd, i;
   char str[15];
  fd = ply_ptr->fd;
   if( cmnd->num == 1){
      print(fd, "\n ※현재 사용자 위치※\n");


   for(i=0; i if(!Ply[i].ply) continue;
       if(Ply[i].ply->fd < 0) continue;
       if(F_ISSET(Ply[i].ply, PDMINV) && Ply[i].ply->class == DM)
continue;
       print(fd, "\n%-10s - %s", Ply[i].ply->name,
Ply[i].ply->parent_rom->name);
       }
   }

   else {

   lowercize(cmnd->str[1], 1);
   crt_ptr = find_who(cmnd->str[1]);

   if(!crt_ptr || ply_ptr->class <=DM && F_ISSET(crt_ptr, PDMINV)) {
           print(fd, "%S%j 접속중이 아닙니다.", cmnd->str[1],"0");
           return(0);
       }

       print(fd, "\n%-10s - %s", crt_ptr->name,
crt_ptr->parent_rom->name);

  return(0);

}

   return(0);
}


XE Login