Jump to content
  • 0

Using loop to check item HELP


Lord Ganja

Question


  • Group:  Members
  • Topic Count:  141
  • Topics Per Day:  0.03
  • Content Count:  444
  • Reputation:   22
  • Joined:  06/18/12
  • Last Seen:  

How to check items based from a list in an array? Help please. I'm noob on using loops.

I tried to make one but it doesn't detect the item from the list.

 

I need to match the equipped item from any itemid on the list for the script to went thru.

but my script always trigger != even the item equipped is in the list.

for( .@i = 0; .@i < getarraysize(.list); .@i++ ){
    if(getequipid(.@part) != .list[.@i]){
    mes .npcname$;
    mes "Sorry but I can't replicate this item. Please pick one from the list.";
    emotion e_sry;
    close;
    }
}
mes .npcname$;
mes "I can replicate this item.";

List of items that can be replcated:

setarray .list[0],2383,2541,2410,2629,2630;

Thanks in advance!

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  


for( .@i = 0; .@i < getarraysize(.list); .@i++ ){

if(getequipid(.@part) == .list[.@i]){

mes .npcname$;

mes "I can replicate this item.";

                close;

}

}

mes .npcname$;

mes "Sorry but I can't replicate this item. Please pick one from the list.";

emotion e_sry;

close;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  141
  • Topics Per Day:  0.03
  • Content Count:  444
  • Reputation:   22
  • Joined:  06/18/12
  • Last Seen:  

for( .@i = 0; .@i < getarraysize(.list); .@i++ ){
    if(getequipid(.@part) == .list[.@i]){
		mes .npcname$;
		mes "I can replicate this item.";
                close;
    }
}
mes .npcname$;
mes "Sorry but I can't replicate this item. Please pick one from the list.";
emotion e_sry;
close;

 

Emistry thanks for this.

Anyway I tried your script but it's the same. It always say Sorry but I can't replicate. . . . . . .

 

EDIT:

I tried to equip all those in the array. but only the first one (2383) can went thru.. the rest cannot.

Edited by Lord Ganja
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...