Finally found a solution by looking in another existing script..
First step : get the inventory and loop on it. In my case I only took the elements having the number 6 (card). We add the ID of the card inside the array and we also create the menu by adding the name of the card.
getinventorylist;
for (; .@i < @inventorylist_count; .@i++) {
if(getiteminfo(@inventorylist_id[.@i],2) == 6){
.@items[.@count] = @inventorylist_id[.@i];
.@menu$ = .@menu$ + getitemname(@inventorylist_id[.@i]) + ":";
.@count++;
}
}
Get the selected element :
.@select = select(.@menu$) - 1;
Delete the selected item and give money :
delitem .@items[.@select],1;
set Zeny, Zeny + 500000;
I hope it will be useful for seomeone else.