That's a really good question!
I used to attract the wrong kind of people as friends as well. I was lucky enough to have 2 good friends who were good people that helped me keep one foot in reality, but the other friends I had used me all the time. It can be very disheartening.
One thing I learned in trying to attract quality people into my life was to open up more...be more outgoing. I don't mean that you have to tell your life story, but to take part in conversations more, actively listen to others and really show confidence in yourself while interacting with others. Laugh heartily at something funny, show great concern for a problem, have eye contact and hold yourself up straight and true. Body language says more than words do.
I used to be the kind of person that would sit there and never say much of anything. I guess I had a fear that I had nothing worthy of contribution. I practiced a little here and a little there and found that I did have something to offer many more times than not.
That's about all I can think of right now....oh, one more thing, stay out of the bars when looking for quality people....too much drama!
Wishing you well!