Hmm. It looks right to me... not sure why it won't work. Try putting:
Code:
SendMessageToPC(GetFirstPC(), IntToString(iI));
after the ActionEquipItem line, to see if that part is running properly.
And yeah, clearing the inventory was really just a safety precaution. You probably don't need it.