unitname hasweapon "weaponname"
thats the condition - but with this you have to check all handguns he could have.
there is a primarweapon and secondaryweapon synthax, so maybe:
unitname hasweapon secondaryweapon
mite work - im not sure.
as for handguns it very very easy:
beretta - berettamag
tokarev - tokarevmag
cz75 - cz75mag
revolver - revolvermag (1.85)
glock - glockmag
glocks - glockmag