PHP Code:
public Action OnPlayerRunCmd(int client, int& buttons)
{
int pressedButtons = GetEntProp(client, Prop_Data, "m_afButtonPressed");
if(pressedButtons & IN_ATTACK2)
{
//Code
}
return Plugin_Continue;
}
This would tell you when +attack2 was initially pressed. The prop exists in CS:GO, you'll have to check if it exists in CS:S. If not you can always just keep track of last buttons to find out when the button is pressed.
EDIT: After thinking about it this might not be the most accurate method since clicking the button might not always correspond to the secondary attack happening, might need a different method.