Young Man,
Being a nice guy (and/or a nice girl/woman) doesn't say you allow people using you as a door-mat every-which-way.
Being 'nice' is saying you're always attempting seeing the better side of any person and situation, that you're always opened in discovering how more respecting yourself and others..You're saying you've hope, have dreams for a better world to/of some extent; perhaps just in your neck the woods not going beyound your turf..Because you've likely sideline seen and personally gone thru some tough experiences that've drawn you to being kinder/nicer to whomever.
Being nice hurts when not balancing it out---as said, but more interpretively--by sticking to rules you've decided to follow/practice while being opened to see what the other side (or person/people) are really saying, go it from there as an arbitrator, et cetera. And defending a situation/yourself when warranting..You just cannot allow things/people running against what's universally decent/appropriate mannerisms from heartfelt thinking.
We all hurt, can easily be hurt, and there're still many girls/women who'll recognise and goodly react to a nice guy(from this to that level)---perhaps not in your environment, however, as you more live life will be seen who and who you cannot hang with. Or, you go thru less raw/bad relationships, and certainly will deeply learn how understanding yourself and others from emotionally/spiritually living thru and continuing onwardly from a not-so-good relating (as long as having kept to morals of being nice w/fairness to as much can be said and demonstrated from who you are (and continually learning to be).
Nice people finish last, to some percentile, true, due from most nice people either became too much a door-mat (for others) or saw themself as a sacrificial lamb---too much a pacifist.
We all learn many paths on this one journey,most nice people normally end up with a lasting relationship, and those that don't, well,
those nice people have allowed being turned into pessimistic, negative people who've buried their niceness wayyyy deep---then it takes someone who sees that deep to bring them around---possibly after much sacrifice and tremulous history--when succeeding, normally another lasting relationship for the records.
There're bunches of nice people---you hafta recognise them, and they who don't want acknowledging a nice person, well, isn't ready within (themselves) to furtherly understanding what love is and can be---you can't save the entire world.
Blessings to you.