Jump to content
  • 0

doubt about break


Question

Posted

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

3 answers to this question

Recommended Posts

Posted

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

Posted (edited)

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
Posted (edited)

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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...