yes, but if im set this code in guards ai, guards dont attack evil monsters and etc??
If you set this in your script Guards won't attack anything except for players.
The question is: Why do the guards attack player vendors.
A normal guard script checks for criminals. I don't know what your guard script looks, but if it checks for criminals --> How does the player vendors get criminal
If you don't know yet a small code in the guard script can solve this problem as long as you find the real problem (opponent and playervendor must perhaps be changed to your script):