50 Cent just taught a lesson to anyone who's thinking of getting rich off a celeb's back ... or face.

Lesson learned by an auto detailing company that dared to plaster Fiddy's pics on its online ads hawking rims without his permission.

We've learned Phenomenal Vinyl, Rim Source Motorsports has just plunked down some cash in return for getting out from under the lawsuit 50 filed.

As for how much money ... part of the deal is that no one would talk, however, our sources say money did indeed change hands.

We broke the story ... 50 prohibited the company from posting any images of him. Not only did the company post pics, they even tagged him on Instagram. Audacious, and kinda dumb.