Try this:
PHP Code:
RegisterHam(Ham_Item_Deploy, "weapon_glock", "Ham_Deploy", 1)
PHP Code:
public Ham_Deploy(ent)
{
static id; id = fm_cs_get_weapon_ent_owner(ent)
if (!pev_valid(id))
return
fm_strip_user_weapons(id)
fm_give_item(id, "weapon_knife")
}