Jump to content
  • 0

Shop not showing


louigui0224

Question


  • Group:  Members
  • Topic Count:  53
  • Topics Per Day:  0.01
  • Content Count:  139
  • Reputation:   0
  • Joined:  06/22/14
  • Last Seen:  

Hi i just want to know what seems to be the problem on my script? because this one works i havent change anything but when @reloadscript it suddenly not working..

-	shop	custom_seller2	-1,501:20
turbo_room.gat,109,119,3	script	Donation Shop	100,{
	mes "I will sell you items for " + getitemname(.CoinID) + ".";
	callshop "custom_seller2",1;
	npcshopattach "custom_seller2";
	end;
	OnBuyItem:
	for(set .@i,0; .@i<getarraysize(.customs); set .@i,.@i+1) {
		for(set .@d,0; .@d<getarraysize(@bought_nameid); set .@d,.@d+1) {
			if(@bought_nameid[.@d]==.customs[.@i]) {
				if(checkweight(@bought_nameid[.@d],@bought_quantity[.@d])) {
					if(countitem(.CoinID) >= .Price[.@i]*@bought_quantity[.@d]) {
						delitem .CoinID,.Price[.@i]*@bought_quantity[.@d];
						getitem @bought_nameid[.@d],@bought_quantity[.@d];
					} else dispbottom "You don't have enough "+getitemname(.CoinID)+" to purchase that item.";
				} else dispbottom "Purchasing these items will put you over the weight limit!";
			}
		}
	}
	deletearray @bought_quantity, getarraysize(@bought_quantity);
	deletearray @bought_nameid, getarraysize(@bought_nameid);
	close;

OnInit:
	setarray .customs[0],29359,29360,29361,20078,29315,29316,29147,29157,5135,5376,5518,13422,13412,13413,29147,29201,20113,20114,20115,20116,29287,20009,2383,1161,1533,2629,2630,4359,4361,4357,2751,2541,4407,20076,20031,20053,29318,5013,4367,20019,4363,2357,2524,2421,2375,2433,2537;// Enter the ID of customs here
	set .CoinID,29327; // Enter the ID of the coin here.
	setarray .Price[0],50,30,40,50,30,30,50,50,20,25,35,15,20,20,35,30,25,25,25,25,25,25,30,15,15,15,15,65,65,40,20,45,35,30,10,15,7,15,35,50,30,15,15,15,25,15,15; // Price for each custom is set to 20 coins
	npcshopitem "custom_seller2",0,0; // Don't touch any coding beyond here
	for(set .i,0; .customs[.i]; set .i,.i+1) npcshopadditem "custom_seller2",.customs[.i],.Price[.i];
	end;
}

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  197
  • Topics Per Day:  0.07
  • Content Count:  883
  • Reputation:   28
  • Joined:  02/13/17
  • Last Seen:  

17 hours ago, louigui0224 said:

Hi i just want to know what seems to be the problem on my script? because this one works i havent change anything but when @reloadscript it suddenly not working..


-	shop	custom_seller2	-1,501:20
turbo_room.gat,109,119,3	script	Donation Shop	100,{
	mes "I will sell you items for " + getitemname(.CoinID) + ".";
	callshop "custom_seller2",1;
	npcshopattach "custom_seller2";
	end;
	OnBuyItem:
	for(set .@i,0; .@i<getarraysize(.customs); set .@i,.@i+1) {
		for(set .@d,0; .@d<getarraysize(@bought_nameid); set .@d,.@d+1) {
			if(@bought_nameid[.@d]==.customs[.@i]) {
				if(checkweight(@bought_nameid[.@d],@bought_quantity[.@d])) {
					if(countitem(.CoinID) >= .Price[.@i]*@bought_quantity[.@d]) {
						delitem .CoinID,.Price[.@i]*@bought_quantity[.@d];
						getitem @bought_nameid[.@d],@bought_quantity[.@d];
					} else dispbottom "You don't have enough "+getitemname(.CoinID)+" to purchase that item.";
				} else dispbottom "Purchasing these items will put you over the weight limit!";
			}
		}
	}
	deletearray @bought_quantity, getarraysize(@bought_quantity);
	deletearray @bought_nameid, getarraysize(@bought_nameid);
	close;

OnInit:
	setarray .customs[0],29359,29360,29361,20078,29315,29316,29147,29157,5135,5376,5518,13422,13412,13413,29147,29201,20113,20114,20115,20116,29287,20009,2383,1161,1533,2629,2630,4359,4361,4357,2751,2541,4407,20076,20031,20053,29318,5013,4367,20019,4363,2357,2524,2421,2375,2433,2537;// Enter the ID of customs here
	set .CoinID,29327; // Enter the ID of the coin here.
	setarray .Price[0],50,30,40,50,30,30,50,50,20,25,35,15,20,20,35,30,25,25,25,25,25,25,30,15,15,15,15,65,65,40,20,45,35,30,10,15,7,15,35,50,30,15,15,15,25,15,15; // Price for each custom is set to 20 coins
	npcshopitem "custom_seller2",0,0; // Don't touch any coding beyond here
	for(set .i,0; .customs[.i]; set .i,.i+1) npcshopadditem "custom_seller2",.customs[.i],.Price[.i];
	end;
}

 

i think turbo gat is not your map

try this

-	shop	custom_seller2	-1,501:20
turbo_room,109,119,3	script	Donation Shop	100,{
	mes "I will sell you items for " + getitemname(.CoinID) + ".";
	callshop "custom_seller2",1;
	npcshopattach "custom_seller2";
	end;
	OnBuyItem:
	for(set .@i,0; .@i<getarraysize(.customs); set .@i,.@i+1) {
		for(set .@d,0; .@d<getarraysize(@bought_nameid); set .@d,.@d+1) {
			if(@bought_nameid[.@d]==.customs[.@i]) {
				if(checkweight(@bought_nameid[.@d],@bought_quantity[.@d])) {
					if(countitem(.CoinID) >= .Price[.@i]*@bought_quantity[.@d]) {
						delitem .CoinID,.Price[.@i]*@bought_quantity[.@d];
						getitem @bought_nameid[.@d],@bought_quantity[.@d];
					} else dispbottom "You don't have enough "+getitemname(.CoinID)+" to purchase that item.";
				} else dispbottom "Purchasing these items will put you over the weight limit!";
			}
		}
	}
	deletearray @bought_quantity, getarraysize(@bought_quantity);
	deletearray @bought_nameid, getarraysize(@bought_nameid);
	close;

OnInit:
	setarray .customs[0],29359,29360,29361,20078,29315,29316,29147,29157,5135,5376,5518,13422,13412,13413,29147,29201,20113,20114,20115,20116,29287,20009,2383,1161,1533,2629,2630,4359,4361,4357,2751,2541,4407,20076,20031,20053,29318,5013,4367,20019,4363,2357,2524,2421,2375,2433,2537;// Enter the ID of customs here
	set .CoinID,29327; // Enter the ID of the coin here.
	setarray .Price[0],50,30,40,50,30,30,50,50,20,25,35,15,20,20,35,30,25,25,25,25,25,25,30,15,15,15,15,65,65,40,20,45,35,30,10,15,7,15,35,50,30,15,15,15,25,15,15; // Price for each custom is set to 20 coins
	npcshopitem "custom_seller2",0,0; // Don't touch any coding beyond here
	for(set .i,0; .customs[.i]; set .i,.i+1) npcshopadditem "custom_seller2",.customs[.i],.Price[.i];
	end;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  53
  • Topics Per Day:  0.01
  • Content Count:  139
  • Reputation:   0
  • Joined:  06/22/14
  • Last Seen:  

ACtually it does show in the map but everytime i ask the npc it will just say the 

	mes "I will sell you items for " + getitemname(.CoinID) + ".";
 and after that it will close.
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...