Here another way of doing it , without sorting the Hash..
Code:
my %turn_ins = (2667 => 3233, 2664 => 3230, 2662 => 3227);
while (($key, $value) = each %turn_ins)
{
if (plugin::check_handin(\%itemcount, $key => 1))
{
quest::summonitem($value);
quest::emote("summons an Item . Here you go $name.");
}
}
I have a special return item that i can add to the end . That will return any item remaining in the itemcount hash after.