Radian Posted July 7, 2017 Group: Members Topic Count: 162 Topics Per Day: 0.04 Content Count: 1546 Reputation: 192 Joined: 07/23/14 Last Seen: June 24, 2024 Share 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 Link to comment Share on other sites More sharing options...
1 Capuche Posted July 7, 2017 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share 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 Link to comment Share on other sites More sharing options...
0 Radian Posted July 7, 2017 Group: Members Topic Count: 162 Topics Per Day: 0.04 Content Count: 1546 Reputation: 192 Joined: 07/23/14 Last Seen: June 24, 2024 Author Share 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 Link to comment Share on other sites More sharing options...
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.
Link to comment
Share on other sites
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.