In my experience, I don't think the "nice guy" thing actually exists.
Younger guys often have a hard time understanding girls (and visa versa, but I've not experienced that side of things so can't really talk) so we make we make up "rules" about women to try and explain their behaviour wherein it doesn't immediately make sense, the "nice guy" thing is one of those.
Of course, It doesn't hurt that guys who see themselves as rough and tumble alpha male types can use this myth to basically hype their own self image and turn themselves into high school celebrities, but that's not what is really going on.
Girls and women are not cyphers, they don't follow these bizarre rules about who they're "meant" to be attracted to any more than guys are only ever attracted to magazine models. They are individual people who happen to have vaginas, and in my experience the more capable you are of treating them as such the more they will respect you and get on with you.
That said, let me suggest some alternative "rules". They aren't really rules, of course, they're generalizations. But they might help.
You actually are trying to get into girls' pants.
Every so often on this site you'll see someone say "why do girls always treat me like I'm trying to come onto them?" Well, it's probably because you are, and you need to have the courage to admit that you are.
Having someone hit on you in and of itself is not scary. It's often quite a nice experience even if you don't feel like reciprocating it. If people are responding badly to you when you do it, it's probably because you're doing something wrong. The most likely candidate is that you're doing it too awkwardly. Like I said, women are people, they can spot a forced compliment or a fake smile as easily as you could (probably easier). Another possible candidate is that you aren't taking the hint. People very seldom say outright "sorry, I'm not attracted to you", because they know it would hurt you to hear it. If someone doesn't respond to you hitting on them, it's not because they haven't noticed (not unless you're being ridiculously subtle yourself).
I'm not being mean. I can only afford to say this because I'm 27 and I've learned the hard way. Noone teaches you how to approach people you're attracted to, it's something you have to learn, and the only way you can learn is by not being ashamed of what you're doing. You don't automatically look desperate or needy for hitting on someone or dropping an early compliment, it's precisely how you behave which will determine whether it's a pleasant experience for the object of your affections. Don't be afraid to learn.
Sex is not a commodity.
I know that's quite a dramatic heading, but what I'm basically saying is that you're not going to win someone's heart or get between their legs by doing favours for them.
If you do things for people, or help them out, you aren't automatically sending the message that you're attracted to them, and you certainly aren't favourably predisposing them to see you as a potential sex partner. Their attraction to you or otherwise is it's own thing, it's generally not based on what you do for them. Again, it's something which will come across in how you behave, not what you do.
Maybe you are just trying to be friendly, in which case remember that friendships between men and women are just like any other friendship. They're built on shared interests, and they need a reason to exist. If you have a few awkward conversations and the other person doesn't find what you're saying interesting, they're not likely to see you as a friend, no matter what you do for them.
Which brings me to..
Friendships don't have to go anywhere.
You'll often hear people talk about the "friend zone". Having only generally had relationships with people I've already been friends with, I don't think there's really such a thing.
What I would say is that friendship is not an automatic way into anything more. Most people decide quite quickly whether they're attracted to someone. Yes, there are moments like on every soap opera ever when you suddenly realize you have a thing for someone you've known for ages, but generally I think it's something you always knew anyway and probably would have responded to. Attraction doesn't grow out of just being close friends for a long period of time, people have preferences, and you'll have an easier time if you respect them and don't expect anything just because you're "emotionally close" to someone through friendship.