1. Ham_Weapon_SecondaryAttack is called just for weapons who already have an secondary attack as GabbyIggy told you ( Zoom, USP-Silencer, Glock/Famasa/Galil Shoot burst style, etc. )
2. The good way of dealing with index is doing:
PHP Code:
new OwnerId = pev( ent, pev_owner);
3. You can also make a special command like "+myoption" and users can bind click-right(replacing +attack2) with your command like:
Code:
bind mouse2 "+myoption"
__________________