Radian Posted July 7, 2017 Posted July 7, 2017 Hey guys so I have this script and Im having issues with it when displaying the required amount and the item names. Can someone give me an example on how to do it? setarray .ID,501,502,503,504,505; setarray .AM,1,2,3,4,5; And it will display like this when the player dont have enough of the requirements. You are missing the following items 1 x Red Potion 2 x Orange Potion 2 x Yellow Potion 4 x White Potion 1 x Blue Potion Quote
1 Capuche Posted July 7, 2017 Posted July 7, 2017 setarray .ID[0],501,502,503,504,505; setarray .AM[0],1,2,3,4,5; for ( .@i = 0; .@i < 5; .@i++ ) { if (countitem(.ID[.@i]) < .AM[.@i]) .@missing$ += (.AM[.@i] - countitem(.ID[.@i])) + " x " + getitemname(.ID[.@i]) + "\n"; } if (.@missing$ != "") { mes "You are missing the following items:"; mes .@missing$; close; } 1 Quote
0 Radian Posted July 7, 2017 Author Posted July 7, 2017 6 minutes ago, Capuche said: setarray .ID[0],501,502,503,504,505; setarray .AM[0],1,2,3,4,5; for ( .@i = 0; .@i < 5; .@i++ ) { if (countitem(.ID[.@i]) < .AM[.@i]) .@missing$ += (.AM[.@i] - countitem(.ID[.@i])) + " x " + getitemname(.ID[.@i]) + "\n"; } if (.@missing$ != "") { mes "You are missing the following items:"; mes .@missing$; close; } Thanks @Capuche it worked! Quote
Question
Radian
Hey guys so I have this script and Im having issues with it when displaying the required amount and the item names.
Can someone give me an example on how to do it?
setarray .ID,501,502,503,504,505; setarray .AM,1,2,3,4,5;
And it will display like this when the player dont have enough of the requirements.
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.