Jump to content
  • 0

When Buy or Sell Card it will show like this.


ooGubAoo

Question


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.05
  • Content Count:  43
  • Reputation:   1
  • Joined:  06/08/23
  • Last Seen:  

This script

izlude,139,155,6	script	รับซื้อการ์ดขยะ	90,{
	mes "[Card Trader]";
	mes "สวัสดี, "+strcharinfo(0)+"!";
	mes "ฉันจะทำอะไรให้คุณได้บ้าง?";
	next;
	switch(select(" > ขอข้อมูล: > ขายการ์ด: > ร้านค้า (^0055FF"+getd(.Points$)+"^000000): > ออก")) {
	case 1:
		mes "[Card Trader]";
		mes "คุณพบว่าคุณมี";
		mes "การ์ดไร้ประโยชน์ที่วางอยู่รอบๆ?";
		mes "ฉันยินดีที่จะถอดมันออก";
		mes "มือของคุณ!";
		next;
		mes "[Card Trader]";
		mes "ฉันจะให้ ^0055FF"+.Points[0]+" Point"+((.Points[0] == 1)?"":"s")+"^000000 สำหรับแต่ละรายการ";
		mes "การ์ดที่คุณให้ฉัน และ";
		mes "^0055FF"+.Points[1]+" Points^000000 สำหรับการ์ด MVP";
		mes "คุณสามารถแลกเปลี่ยนคะแนนเหล่านั้นได้";
		mes "สำหรับรายการในภายหลัง";
		mes "ว่าไง.?";
		close;
	case 2:
		mes "[Card Trader]";
		mes "เลือกการ์ดที่คุณ";
		mes "ต้องการแลกเปลี่ยน.";
		if (.Level) {
			mes " ";
			mes "ต้องทิ้ง";
			mes "โดยมอนสเตอร์ระดับ";
			mes .Level+" ขึ้นไป";
		}
		deletearray @sold_nameid[0],getarraysize(@sold_nameid);
		callshop "card_shop",2;
		npcshopattach "card_shop";
		end;
	case 3:
		mes "[Card Trader]";
		mes "คุณมี ^0055FF"+getd(.Points$)+"^000000 Point"+((getd(.Points$) == 1)?".":"s.");
		callshop "card_shop",1;
		npcshopattach "card_shop";
		end;
	case 4:
		mes "[Card Trader]";
		mes "*หาว*";
		mes "แล้วพบกันใหม่!";
		close;		
	}

OnSellItem:
	mes "Cards to sell:";
	mes "-----------------------------------";
	for(set .@i,0; .@i<getarraysize(@sold_nameid); set .@i,.@i+1)
		if (@sold_nameid[.@i] > 4000 && @sold_nameid[.@i] < 4700) {
			if (.Level) {
				query_sql("SELECT `LV` FROM `mob_db` WHERE `DropCardid` = "+@sold_nameid[.@i],.@lv);
				if (.@lv < .Level) {
					dispbottom getitemname(@sold_nameid[.@i])+" อยู่ในระดับขั้นต่ำ";
					continue;
				}
			}
			set .@card_id[getarraysize(.@card_id)], @sold_nameid[.@i];
			set .@card_amt[getarraysize(.@card_amt)], @sold_quantity[.@i];
			set .@mvp, compare(.MVP$,""+@sold_nameid[.@i]);
			mes ((.@mvp)?"  ^FF0000":"  ^777777")+@sold_quantity[.@i]+"x "+getitemname(@sold_nameid[.@i])+"^000000";
			set .@card_total, .@card_total+(@sold_quantity[.@i]*((.@mvp)?.Points[1]:.Points[0]));
		}
	deletearray @sold_nameid[0], getarraysize(@sold_nameid);
	deletearray @sold_quantity[0], getarraysize(@sold_quantity);
	if (!.@card_id) {
		mes "  ^777777(ไม่มี)^000000";
		close;
	}
	mes " ";
	mes "---------- ทั้งหมด: ^0055FF"+.@card_total+" pt.^000000 -------";
	next;
	if(select(" > ^0055FFเสร็จสิ้นการซื้อขาย...^000000: > ^777777ยกเลิก^000000") == 2) {
		mes "[Card Trader]";
		mes "ตกลง...";
		close;
	}
	for(set .@i,0; .@i<getarraysize(.@card_id); set .@i,.@i+1)
		delitem .@card_id[.@i],.@card_amt[.@i];
	setd .Points$, getd(.Points$)+.@card_total;
	mes "[Card Trader]";
	mes "ทุกอย่างเสร็จเรียบร้อย!";
	close;

OnBuyItem:
	for(set .@i,0; .@i<getarraysize(@bought_nameid); set .@i,.@i+1)
		for(set .@j,0; .@j<getarraysize(.Shop); set .@j,.@j+2)
			if (@bought_nameid[.@i] == .Shop[.@j]) {
				set .@cost, .@cost+(.Shop[.@j+1]*@bought_quantity[.@i]);
				break;
			}
	if (.@cost > getd(.Points$)) {
		mes "[Card Trader]";
		mes "คุณมีคะแนนไม่เพียงพอ";
	}
	else {
		mes "รายการที่ซื้อ:";
		mes "-----------------------------------";
		for(set .@i,0; .@i<getarraysize(@bought_nameid); set .@i,.@i+1) {
			getitem @bought_nameid[.@i], @bought_quantity[.@i];
			mes "  ^777777"+@bought_quantity[.@i]+"x "+getitemname(@bought_nameid[.@i])+"^000000";
		}
		mes " ";
		mes "---------- ทั้งหมด: ^0055FF"+.@cost+" pt.^000000 -------";
		setd .Points$, getd(.Points$)-.@cost;
	}
	deletearray @bought_nameid[0], getarraysize(@bought_nameid);
	deletearray @bought_quantity[0], getarraysize(@bought_quantity);
	close;

OnInit:
	set .Level,0;   		// Minimum monster level to trade corresponding cards.
	set .Points$,"#Card_Points";	// Variable to store points.
	setarray .Shop[0],		// Card Shop items: <ID>,<point cost>
	  4001,1,4001,1;
	setarray .Points[0],1,5;	// Points per <normal card>,<MVP card>
	set .MVP$,			// List of MVP cards.
	  "4121,4123,4128,4131,4132,4134,4135,4137,4142,4143,4144,4145,4146,4147,4148,4168,4236,"+
	  "4241,4263,4276,4302,4305,4318,4324,4330,4342,4357,4359,4361,4363,4365,4399,4403,4407";
	
	npcshopdelitem "card_shop",909;
	for(set .@i,0; .@i<getarraysize(.Shop); set .@i,.@i+2)
		npcshopadditem "card_shop",.Shop[.@i],.Shop[.@i+1];
	end;
}
-	shop	card_shop	-1,909:-1

When Buy or Sell it will Show

-2023-08-06-091508.png

How to Fix it?

Thank you to help.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  235
  • Reputation:   87
  • Joined:  06/30/18
  • Last Seen:  

In OnSellItem and OnBuyItem replace close with end.
This removes the error and just works like expected. 
Don't ask me why end has the same effect as close in these labels and seemingly creates a close button in the message box.
I have no idea.

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  898
  • Reputation:   119
  • Joined:  05/23/12
  • Last Seen:  

Better replace by:

 

close2;

end;

 

 

Rynbef~

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...