Jump to content
  • 0

#CASHPOINTS (error [Overwrites Cash Point])


Shinto

Question


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  15
  • Reputation:   1
  • Joined:  12/16/17
  • Last Seen:  

Hello everyone, I am new to the forum. I would have a problem with a script that converts Gold Coin into Cash Point. The script works, but the problem is that if for example I have 10 Cash poins, when I convert 15 Gold Coin into 1 Cash Point I do not have 11 Cash Points, but rather 1. I hope I explained myself, sorry for my bad english ...

 

prontera,136,171,4	script	Molly	469,{

	.@npcname$ = "[Molly]";

	mes .@npcname$;
	mes "Hello "+strcharinfo(0)+".";
	mes "I can convert your Gold Coin in Cash Poin!";
	mes "You need 15 Gold Coin for 0.01 Cash Poin.";
	mes "How many you want to exchange?";
	next;
			input .@count;
			if(.@count == 0) close;
			if(countitem(7517) < .@count*15) goto L_NE;
			delitem 7517,.@count*15;
			set #CASHPOINTS,#CASHPOINTS+1;
			close;

			L_NE:
				mes .@npcname$;
				mes "You don't have that coin enough.";
				close;

}

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  15
  • Reputation:   1
  • Joined:  12/16/17
  • Last Seen:  

Hello Radian, thanks for your help, I solved thanks to your information, certainly is to be improved but for now it works ... :)

-- Edit

llchrisll  I read your answer now .... You're right I saw after the error and I fixed it :) thanks .... How did I change okay?

 

prontera,136,171,4	script	Molly	469,{

	.@npcname$ = "[Molly]";

		

	mes .@npcname$;
	mes "Hello "+strcharinfo(0)+".";
	mes "I can convert your Gold Coins in Cash Points!";
	mes "You need 15 Gold Coins for 0.100  Cash Points.";
	mes "How many you want to exchange?";
	next;
			input .@count;
			if(.@count == 0) close;
			if(.@count < 100) close;
			if(countitem(7517) < .@count/100*15) goto L_NE;
			delitem 7517,.@count/100*15;
			//set #CASHPOINTS,#CASHPOINTS+1;
			#CASHPOINTS += .@count;
			close;

			L_NE:
				mes .@npcname$;
				mes "You don't have that coin enough.";
				close;

}

 

Edited by Shinto
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

change this

set #CASHPOINTS,#CASHPOINTS+1;

into this

#CASHPOINTS += 1;

I dont know if this works

Edited by Radian
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  626
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

Not sure, what the problem is, but something else, the player does always recieve 1 cash points, shouldn't you use .@count instead of + 1?

Also 0.01 cash points doesn't exist.

Example:

1 cash point costs 15 gold coins:

I want 10 (.@count) cash points so  15*10 =150

But I always get 1 cash points instead of the 10.

set #CASHPOINTS,#CASHPOINTS + .@count;

Would be the correct one.

@Radian it's the same

Edited by llchrisll
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...