As social creatures, I think friends are very important, but when it comes right down to it, I think the biggest factor that determines a person's ability to resist temptation is a persons strength of will, personality, and quality of values.
Many people find their temptations are harder to resist when they are around others who willingly submit to those temptations. I myself have an obsessive compulsion to not give into peer pressure, so when everyone is encouraging me to do something I know I shouldn't, then it pretty much boils down to the more people trying to make me do something, the less likely I will be to do it. LOL
Some people are wired in a way that they can go into situations that others can't as to be a witness in those situations, but when people who aren't meant to be that way try to, it ends up badly for them... Some people need less support than others.
Yet, even so, it's healthier for a person to have at least one good friend to relax with and vent to. We all need an outlet, and we need all support at some point.
I think that is part of the reason we are here.