I wanted to create an array menu where the choices in that array will only show if the player have the item in his inventory.
To make it simple I wanted to make a script where player can store a list of cards from the list I made in an array. However since there's a lot of card in the list I would like to reduce the choices in the menu by only showing the cards that they have in the inventory. If they don't have the cards in the inventory I don't want it to show in the menu.
I am a complete newbie in this so your help will be greatly appreciated.
This is currently the one I am using but it show every card.
query_sql( "SELECT `card_id`, `card_name`, `card_type` FROM `card_list` WHERE `card_race` = 'monster' ORDER BY `card_name` ASC limit 500 ",.@iid,.@in$,.@tp$);
.@size = getarraysize( .@iid );
for( .@i = 0; .@i < .@size; .@i++ )
set .@menu$,.@menu$ + .@in$[.@i] +" - " + .@tp$[.@i] + ":";
.@i = select( .@menu$ ) - 1;
set .itemid,.@iid[.@i];
At one point I managed through trial and error to make it only show the card name in the list if they have one in the inventory but when I check the ID of their choice it's different on the menu they clicked.
ex. They clicked Poring Card but the item id is Pupa Card...
I would really appreciate any help because I don't understand what I am doing and I am completely newbie in this. Thank you in advanace.
Question
Xellyehria
I wanted to create an array menu where the choices in that array will only show if the player have the item in his inventory.
To make it simple I wanted to make a script where player can store a list of cards from the list I made in an array. However since there's a lot of card in the list I would like to reduce the choices in the menu by only showing the cards that they have in the inventory. If they don't have the cards in the inventory I don't want it to show in the menu.
I am a complete newbie in this so your help will be greatly appreciated.
This is currently the one I am using but it show every card.
query_sql( "SELECT `card_id`, `card_name`, `card_type` FROM `card_list` WHERE `card_race` = 'monster' ORDER BY `card_name` ASC limit 500 ",.@iid,.@in$,.@tp$);
.@size = getarraysize( .@iid );
for( .@i = 0; .@i < .@size; .@i++ )
set .@menu$,.@menu$ + .@in$[.@i] +" - " + .@tp$[.@i] + ":";
.@i = select( .@menu$ ) - 1;
set .itemid,.@iid[.@i];
At one point I managed through trial and error to make it only show the card name in the list if they have one in the inventory but when I check the ID of their choice it's different on the menu they clicked.
ex. They clicked Poring Card but the item id is Pupa Card...
I would really appreciate any help because I don't understand what I am doing and I am completely newbie in this. Thank you in advanace.
Link to comment
Share on other sites
5 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.