is this not what you are searching for?
Code:
BOOL TextCmd_InvenRemove( CScanner& scanner )
{
#ifdef __WORLDSERVER
CUser* pUser = (CUser*)scanner.dwValue;
if( IsValidObj( pUser ) )
{
int nSize = pUser->m_Inventory.GetMax();
for( int i = 0 ; i < nSize; ++i )
{
CItemElem* pItemElem = pUser->m_Inventory.GetAtId( i );
if( IsUsableItem( pItemElem ) && !pUser->m_Inventory.IsEquip( pItemElem->m_dwObjId ) && !pItemElem->IsPet() && !pItemElem->IsEatPet() )
pUser->UpdateItem( i, UI_NUM, 0 );
}
}
#endif // __WORLDSERVER
return TRUE;
}
If i recall it correctly you only need the slot from the inventory where the item is located. I could be wrong though