void main() { object oItem = GetFirstItemInInventory(); if(GetIsObjectValid(oItem)) { DestroyObject(oItem); oItem = GetNextItemInInventory(); } }