개량형 우체국
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 | 253 |
56 | 몹과 자신을 "비교" | 그리움 | 2007.04.12 | 219 |
55 | 패거리 전쟁시 적과 아군 구분 | 그리움 | 2007.04.12 | 216 |
54 | 순위 소스 | 그리움 | 2007.04.12 | 215 |
» | 개량형 우체국 | 그리움 | 2007.04.12 | 228 |
52 | 명성치 도입 | 그리움 | 2007.04.12 | 229 |
51 | 자기 아파트 방설명은 자기가 #2 | 그리움 | 2007.04.12 | 222 |
50 | 이동력 추가하기 | 그리움 | 2007.04.12 | 225 |
49 | 경매 소스 | 그리움 | 2007.04.12 | 217 |
48 | 글자색, 배경색 15색 사용하기 | 그리움 | 2007.04.12 | 213 |
47 | Ctrl+Enter 패치하기 | 그리움 | 2007.04.12 | 198 |
46 | 패거리 상점 만들기 | 그리움 | 2007.04.12 | 199 |
45 | 귀환장소 설정 | 그리움 | 2007.04.12 | 228 |
44 | 출구 정렬 | 그리움 | 2007.04.12 | 222 |
43 | 게시판 검색 기능 추가하기 | 그리움 | 2007.04.12 | 207 |
42 | 암호 *****로 보이게 하기 | 그리움 | 2007.04.12 | 215 |
41 | 레벨을 32767까지 가능하게 | 그리움 | 2007.04.12 | 236 |
40 | 잡담 안시 사용하기 | 그리움 | 2007.04.12 | 236 |
39 | 지도 소스 #2 | 그리움 | 2007.04.12 | 230 |
38 | 베팅소스 | 그리움 | 2007.04.12 | 242 |