개량형 우체국
2007.04.12 13:04
int online_deposit (ply_ptr, cmnd)
creature *ply_ptr;
cmd *cmnd;
{
int fd, n;
object *bnk_ptr;
creature *crt_ptr;
int len;
long amt;
fd = ply_ptr->fd;
if(!F_ISSET (ply_ptr->parent_rom, RBANKS)) {
print (ply_ptr->fd, "은행에서만 가능합니다.");
return (0);
}
if(cmnd->num <3) {
print (fd, "누구에게 얼마를 송금하시려고요?");
return (0);
}
if(load_ply(cmnd->str[1], &crt_ptr) < 0) {
print(fd,"그런 사용자는 없습니다.\n");
return (0);
}
if(!strcmp (cmnd->str[2], "모두")) {
amt = ply_ptr->gold;
if(amt<101000) {
print(fd,"보낼수 있는 돈의 한계는 10만냥입니다.\n");
return(0);
}
goto input_bank_all;
}
len = strlen (cmnd->str[2]);
if(len > 2 && !strcmp (&cmnd->str[2][len - 2], "냥")) {
amt = atol (cmnd->str[2]);
if(amt < 1) {
print (fd, "돈의 단위는 음수가 될 수 없습니다.");
return (0);
}
if(amt < 100000L) {
print(fd,"온라인 송금의 최소 값은 10만냥 이상입니다.\n");
return(0);
}
if(ply_ptr->gold < amt) {
print (fd, "당신은 그만큼의 돈을 가지고 있지 않습니다.");
return (0);
}
input_bank_all:
n = load_bank (crt_ptr->name, &bnk_ptr);
if (n < 0) {
bnk_ptr = (object *) malloc (sizeof (object));
zero (bnk_ptr, sizeof (object));
bnk_ptr->shotsmax = 200;
}
if((bnk_ptr->value+(amt)) >2100000000 || (bnk_ptr->value+(amt))<0){
bnk_ptr->value=2100000000L;
}
else
bnk_ptr->value += amt;
ply_ptr->gold -= amt;
ply_ptr->gold -= amt/100;
print(fd, "?온라인송금?");
print(fd, "당신은 %ld냥을 %M에게 송금했습니다.", amt, crt_ptr);
print(fd, "\n송금 비용으로 %d냥을 가져갑니다.\n",(amt)/100);
save_bank(crt_ptr->name, bnk_ptr);
savegame_nomsg (ply_ptr);
savegame_nomsg (crt_ptr);
}
else
print(fd, "사용법: 사람 ###[만|억]냥 온라인송금");
return (0);
}
홈지기 "그륨"
creature *ply_ptr;
cmd *cmnd;
{
int fd, n;
object *bnk_ptr;
creature *crt_ptr;
int len;
long amt;
fd = ply_ptr->fd;
if(!F_ISSET (ply_ptr->parent_rom, RBANKS)) {
print (ply_ptr->fd, "은행에서만 가능합니다.");
return (0);
}
if(cmnd->num <3) {
print (fd, "누구에게 얼마를 송금하시려고요?");
return (0);
}
if(load_ply(cmnd->str[1], &crt_ptr) < 0) {
print(fd,"그런 사용자는 없습니다.\n");
return (0);
}
if(!strcmp (cmnd->str[2], "모두")) {
amt = ply_ptr->gold;
if(amt<101000) {
print(fd,"보낼수 있는 돈의 한계는 10만냥입니다.\n");
return(0);
}
goto input_bank_all;
}
len = strlen (cmnd->str[2]);
if(len > 2 && !strcmp (&cmnd->str[2][len - 2], "냥")) {
amt = atol (cmnd->str[2]);
if(amt < 1) {
print (fd, "돈의 단위는 음수가 될 수 없습니다.");
return (0);
}
if(amt < 100000L) {
print(fd,"온라인 송금의 최소 값은 10만냥 이상입니다.\n");
return(0);
}
if(ply_ptr->gold < amt) {
print (fd, "당신은 그만큼의 돈을 가지고 있지 않습니다.");
return (0);
}
input_bank_all:
n = load_bank (crt_ptr->name, &bnk_ptr);
if (n < 0) {
bnk_ptr = (object *) malloc (sizeof (object));
zero (bnk_ptr, sizeof (object));
bnk_ptr->shotsmax = 200;
}
if((bnk_ptr->value+(amt)) >2100000000 || (bnk_ptr->value+(amt))<0){
bnk_ptr->value=2100000000L;
}
else
bnk_ptr->value += amt;
ply_ptr->gold -= amt;
ply_ptr->gold -= amt/100;
print(fd, "?온라인송금?");
print(fd, "당신은 %ld냥을 %M에게 송금했습니다.", amt, crt_ptr);
print(fd, "\n송금 비용으로 %d냥을 가져갑니다.\n",(amt)/100);
save_bank(crt_ptr->name, bnk_ptr);
savegame_nomsg (ply_ptr);
savegame_nomsg (crt_ptr);
}
else
print(fd, "사용법: 사람 ###[만|억]냥 온라인송금");
return (0);
}
홈지기 "그륨"
댓글 0
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
57 | 경매는 이렇게 | 그리움 | 2007.04.12 | 213 |
56 | 직업 추가하기 #2 | 그리움 | 2007.04.12 | 199 |
55 | 낮과 밤이 되면 어둡고 환하게 | 그리움 | 2007.04.12 | 203 |
54 | 자동 이벤트 | 그리움 | 2007.04.12 | 204 |
53 | 자동으로 돈줍기 #2 | 그리움 | 2007.04.12 | 197 |
52 | 안시 문자열로 인한 공백 | 그리움 | 2007.04.12 | 193 |
51 | 이도류 | 그리움 | 2007.04.12 | 199 |
50 | 패거리 직위 내리기 | 그리움 | 2007.04.12 | 156 |
49 | 접속화면을 멋있게 | 그리움 | 2007.04.12 | 165 |
48 | 패거리 전쟁 승패 기록 | 그리움 | 2007.04.12 | 160 |
47 | 방설명 안시 넣기 | 그리움 | 2007.04.12 | 168 |
46 | 분신을 만드는 기술 | 그리움 | 2007.04.12 | 183 |
45 | 안시 사용하기 | 그리움 | 2007.04.12 | 175 |
44 | 지도 기능 | 그리움 | 2007.04.12 | 178 |
43 | 안시 문자열로 인한 공백 #2 | 그리움 | 2007.04.12 | 191 |
42 | 기술추가 | 그리움 | 2007.04.12 | 199 |
41 | 개량형 우체국 | 그리움 | 2007.04.12 | 202 |
40 | 베팅소스 | 그리움 | 2007.04.12 | 198 |
39 | 지도 소스 #2 | 그리움 | 2007.04.12 | 195 |
38 | 잡담 안시 사용하기 | 그리움 | 2007.04.12 | 200 |