I'm assuming your problem is that you want the enemy only to be aware of you as their enemy if they see you have a knife? If not, then a variation on the following may still be useful.
As there is no real way to check in hand weapons you have to cheat the computer by actually removing and recovering the weapon. So start with your player as setcaptive false and here goes....
;This is headed "reveal.sqs"
;Put player addaction ["Take out knife","reveal.sqs"] in players init field
player addweapon "knife"
;(or whatever it's called)
player removeaction "Take out knife"
player addaction ["conceal knife", "conceal.sqs"]
exit
;Then create the conceal.sqs
player removeweapon "knife"
player removeaction "conceal knife"
player addaction ["reveal knife", "reveal.sqs"]
Then you create a trigger that will activate if the enemy knows about the player and he has a knife and in the activation box you can switch the players captive status.
This may all require some fiddling but you get the idea. If the person who was asking about a similar problem earlier on is out there, then this is yet another alternative to your problem!
I hope this helps
M