I'm not sure why in the ham_strip_weapon stock get_weaponid is used.. You can simply use the weapon name (weapon_).
In strip_weapons get_weaponname is used to get the weapon name in weapon_ method (weapon_ak47) because get_user_weapons returns weapon name in CSW_ form (CSW_AK47).