there are 2 main ways that i have found to do this; either you can have, for example, artifacts represent weapons, so that if a player picks up an artifact and he already has an artifact then he drops the one he just picked up and a message is displayed. or you can have the item's life represent the item type (and disable attacks against items of course) like 1 = weapon, 2 = armor, etc.
a third way would be to just make a list of items that are of a certain type and check to see if a player already has one of those items, but that becomes tedious. i would only recommend this if for some reason the other 2 methods are not an option (like you have already used them to represent something else).