some guys just have that kind of personality- they don't really mean any harm or want to hurt your feelings, but they really don't know where to draw the line between flirting and just being nice to a friend.
maybe he doesn't even know that he's flirting with you. try not to blame him for leading you on, 'cuz sometimes it's unintentional. you may think that he's leading you on, because you're hoping that he does like you in that way, which may cause you to read his signals all wrong.
besides, the fact that you only like him when you hang out with him, and don't feel anything when he's not around, may suggest that ... perhaps you appreciate everything he's doing for you, but don't really like him for him? (i mean, who wouldn't appreciate a guy that's so nice to you?

)
on the flipside, maybe he does like you. i guess you won't really know until you ask him about it. and be sure to ask your friend how she found out about him liking somebody else. it may not be true.
take cares~