Jump to content
  • 0
Sign in to follow this  
crossxxx

Can't buy in cash shop

Question

Hey i just recently made my own server and i put a cash shop and when i try to buy it say "The purchase has failed because the NPC does not exist", so i need help in this, im new in this. thanks 

post-10450-0-10738900-1438929527_thumb.jpg

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

i use this

 

prontera,164,166,2 cashshop Cash Items 759,30000:10000,30001:10000,30002:10000,30003:10000,2137:10000,30004:10000,30005:10000,2357:10000,2524:10000,2421:10000,5171:10000,30007:10000,30008:10000,30009:10000,5518:10000,5374:10000,30010:10000,30011:10000,30013:10000,30014:10000,30037:10000,30040:10000,30015:10000,30017:10000,30018:10000,30019:10000,30020:10000,30021:10000,30022:10000,30023:10000,30038:10000,30036:10000,30032:10000,30033:10000,30034:10000,30035:10000,30024:10000,30025:10000,30026:10000,30027:10000,30028:10000,30029:10000,30030:10000

Share this post


Link to post
Share on other sites
  • 0

@@crossxxx

try to use this one
 

// ----------------------------------- //-	shop	Cash_Shop	-1,512:100arza,180,98,1	script	Cash Items#cashnpc	812,{function ShopSettings;function ValidateCost;function CurrencyInfo;function ClearData;function ValueConvert;function ErrorNotice;mes "Each Shop from the Menu may purchase using ^FF0000Different Currency^000000.";mes "^00FF00____________________________^000000";mes "So,Which shop you would like to look at it";next;// Menu Selectionselect("Purchase Now?");ClearData();ShopSettings( @menu );npcshopitem "Cash_Shop",512,100;npcshopdelitem "Cash_Shop",512;for(set .@i,0; .@i < getarraysize( @ItemLists ); set .@i,.@i+1)	npcshopadditem "Cash_Shop",@ItemLists[.@i],@ItemCost[.@i];mes "Okay...wait awhile";mes "^00FF00____________________________^000000";CurrencyInfo( @Currency$ );mes "^00FF00____________________________^000000";callshop "Cash_Shop",1;npcshopattach "Cash_Shop";end;function	ShopSettings	{	switch( getarg(0) ){		case 1:			// Currency [ Item ID / Variable Name ]			set @Currency$,"#CASHPOINTS";			// Item ID Lists			setarray @ItemLists[0],505,506,507,508,509,510;			// Item Price			setarray @ItemCost[0],1,2,3,4,5,6;			break;		// Case 2,3,4.....etc...		default:			ErrorNotice( "Invalid Menu Selection for Menu "+@menu+"." );			close;	}		if( @Currency$ == "" )	ErrorNotice( "Invalid Currency Setting in Menu "+@menu+" ." );if( getarraysize( @ItemCost ) != getarraysize( @ItemLists ) || getarraysize( @ItemLists ) != getarraysize( @ItemCost ) )	ErrorNotice( "Missing or Extra Value of Item or Cost Settings in Menu "+@menu+" ." );return;}function	ErrorNotice	{	mes "^FF0000ERROR^000000 - "+getarg(0);	mes "^00FF00____________________________^000000";	mes "Inform this Message to ^0000FFGame Staffs^000000 immediately !";	close;}function	CurrencyInfo	{	if( getitemname( atoi( getarg(0) ) ) != "null" ){		mes "Item Currency : ^FF0000"+getitemname( atoi( getarg(0) ) )+"^000000";		mes "Available Amount : ^0000FF"+ValueConvert( countitem( atoi( getarg(0) ) ) )+"^000000";	}else if( getitemname( atoi( getarg(0) ) ) == "null" ){		mes "Variable Currency : ^FF0000"+getarg(0)+"^000000";		mes "Available Amount : ^0000FF"+ValueConvert( getd( getarg(0) ) )+"^000000";	}return;}function	ValidateCost	{	if( getitemname( atoi( getarg(0) ) ) != "null" ){		if( countitem( atoi( getarg(0) ) ) < getarg(1) ) return 1;	}else{		if( getd( getarg(0) ) < getarg(1) ) return 1;	}return 0;}function ClearData	{	set @Currency$,"";	set @TotalCost,0;	deletearray @bought_nameid[0],getarraysize( @bought_nameid );	deletearray @bought_quantity[0],getarraysize( @bought_quantity );	deletearray @ItemLists[0],getarraysize( @ItemLists );	deletearray @ItemCost[0],getarraysize( @ItemCost );return;}function	ValueConvert	{	set .@num, atoi(""+getarg(0));	if ( .@num == 0 || .@num >= 2147483647 ) return getarg(0);	set .@l, getstrlen(""+.@num);	for ( set .@i,0; .@i < .@l; set .@i, .@i + 1 ) {		set .@num$, .@num % pow(10,.@i+1) / pow(10,.@i) + .@num$;			if ( (.@i+1) % 3 == 0 && .@i+1 != .@l ) set .@num$, ","+ .@num$;	}	return .@num$;}OnBuyItem:	ShopSettings( @menu );	for(set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1)		for(set @j,0; @j < getarraysize( @ItemLists ); set @j,@j+1)			if( @ItemLists[@j] == @bought_nameid[@i] )			set @TotalCost,@TotalCost + ( @ItemCost[@j] * @bought_quantity[@i] );	mes "^FF0000       BILLING LIST^000000";	mes "^00FF00____________________________^000000";	for( set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1 )			mes "^FF0000"+@bought_quantity[@i]+" x ^0000FF"+getitemname( @bought_nameid[@i] )+"^000000";	mes "^00FF00____________________________^000000";	if( getitemname( atoi( @Currency$ ) ) != "null" )		mes "Total Cost : ^0000FF"+ValueConvert( @TotalCost )+" x "+getitemname( atoi( @Currency$ ) )+"^000000";	else if( getitemname( atoi( @Currency$ ) ) == "null" ){		mes "Total Cost : ^0000FF"+ValueConvert( @TotalCost )+" "+@Currency$+"^000000";	}		mes "^00FF00____________________________^000000";	if( ValidateCost( @Currency$,@TotalCost ) ){		if( getitemname( atoi( @Currency$ ) ) != "null" )			mes "[ ^FF0000X^000000 ] Insufficient ^0000FF"+getitemname( atoi( @Currency$ ) )+"^000000";		else{			mes "[ ^FF0000X^000000 ] Insufficient ^0000FF"+@Currency$+"^000000";		}	}else{		if( select( "^0000FFPurchase^000000:Cancel" ) == 1 ){			if( getitemname( atoi( @Currency$ ) ) != "null" )				delitem atoi( @Currency$ ),@TotalCost;			else{				set getd( @Currency$ ),getd( @Currency$ ) - @TotalCost;			}			for(set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1)				getitem @bought_nameid[@i],@bought_quantity[@i];			message strcharinfo(0),"Purchased "+getarraysize( @bought_nameid )+" Items.";			mes "Thank you for shopping.";		}	}ClearData();close;}

just change the ITEM NUMBER and the COST of the items

Share this post


Link to post
Share on other sites
  • 0

Not sure what kind of packet this client send to open cash shop,

but it can be same issue with markets. If client send old packet like for simple shops, server will give items list, but will not allow buy/sell.

Share this post


Link to post
Share on other sites
  • 0

Seems like it could be src implementation. That client doesn't seem to have the cashshop button, so that would be my guess.

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.