Since SlotItemChanged cannot be used for items in the attachment slots of a weapon, something like WeaponSlotItemChanged could be used to determine when a player changes attachments or loads/unloads a magazine.
(Since loading a magazine already has a specific EventHandler (Reloaded), and magazines change a lot more often than attachments typically will, it may be wise to keep magazines separate and just include an Unloaded type event handler.)
this addEventHandler ["WeaponSlotItemChanged", { params ["_unit", "_weapon", "_name", "_slot", "_assigned"]; }];
unit: Object - unit EH assigned to.
weapon: String - class name of the weapon whose slot item changed.
name: String - name of the item (see getSlotItemName).
slot: Number - slot id (see getSlotItemName).
assigned: Boolean - true assign action, false unassign action.