Jump to content
  • 0

doubt about break


Dynasty

Question


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  151
  • Reputation:   5
  • Joined:  11/09/12
  • Last Seen:  

I everyone

 

i have a doubt about the function break

 

if i do this 

	mes "Bueno parece que tienes todo para hacer tus municiones";
			for(set .@i,0; .@i < getarraysize (.@item2); set .@i,.@i+2){
				do {set .@r,.@r+1;} 
					while (.@i <= getarraysize (.@item2))
				delitem .@item2[.@i],.@item2[.@r];
				break;
					}
				next;
				mes "Habla conmigo en unos segundo para terminar de hacer tus municiones";
				set municiones,1;
				close;

where i put break; it means that the npc will continue with the next;?

 

that is everything that i want to know

thanks

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

I have no idea why you make things complicated

[paste=hgvhy8bz307]

what I see in your equation, is delete the item ID from 1st index with the amount of item ID from last index

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  151
  • Reputation:   5
  • Joined:  11/09/12
  • Last Seen:  

I did it just for practice xD, i just want to learn everyhing xD 

 

what about the main question about break; .-.?

 

and i have one new question what is the different between  these .@item and .item?

Edited by Dynasty
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

since the implementation of checkweight2 script command

its better to break the item ID and the quantity into different array

so when you want to receive the prizes with multiple items,

use checkweight2

but this script only gives arrow ...

so just use checkweight enough =/

... I think I forgot to use checkweight on that script ...

because the user already has 30000 arrows in inventory, getitem will throw arrows on the floor

use break; only when you want to find an index in an array

http://rathena.org/board/topic/91388-array-check/?p=239745

or in fact, I seldom even use break; anymore with new techniques

here I use method no.3 from that topic, I use 2 dimension array

.... suddenly I remember I did something similar already

http://rathena.org/board/topic/74145-need-help/?p=155652

read wiki

http://rathena.org/wiki/Variables#NPC_Variables

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