It depends on if you're talking about a primaryWeapon (i.e. a rifle, machine gun etc) or a pistol, and if it's to be that particular (type) of weapon or any weapon at all. The easiest method for finding out if the unit has a gun in hand (not a pistol) is to use:
condition: primaryWeapon Player !=""
Basically the primaryWeapon command always returns an empty string ("") while the unit is unarmed, so once it returns something else = unit is armed.
If you have a specific weapon in mind (pistol, rifle, launcher..) then the easiest might be to do something like:
condition: "M16A4" in (weapons Player)
You'll find the weapon classnames over in our comref :
<link>. This one basically works using the "in array" command, which checks the string "M16A4" (or whatever your weapon name is) against the array created by the command "weapons unit" (in this case the weapons of the player).
DaChev's method also works, but then the player can't be carrying any other "weapons", i.e. binoculars or night vision goggles.
Good luck.
Wolfrug out.