You could use RFID (put the RFID tag on the gun, reader connected to the Arduino, sensor "near" the tag on the gun - definition of "near" would depend on the specs of the tag and reader (it might be inches, it might be feet).
You could use RFID (put the RFID tag on the gun, reader connected to the Arduino, sensor "near" the tag on the gun - definition of "near" would depend on the specs of the tag and reader (it might be inches, it might be feet).