Kevin Hart wasn't just a close friend of his alleged sex tape extortionist, J.T. Jackson -- he acted like a devoted agent for the guy ... getting him roles in commercials and a lot more.

Sources close to Kevin say case in point ... a 2013 Coke Zero commercial. Hart showed up the day of filming with J.T. and demanded he be given one of the principle acting roles -- with no advance warning.

We're told a call sheet change was made, J.T. was fitted for clothes, and one of the 2 actors who was set to play Kevin's buddy in the spot was replaced and bumped to a background actor. As you can see ... J.T. got his speaking role instead.

Our sources say this wasn't a one-time deal, either ... Kevin worked on at least 3 other projects where he made sure J.T. was given principle roles to star alongside him.

The 2 were extremely close friends for years ...  which makes it all the more shocking that J.T.'s now facing 2 felony extortion counts for allegedly trying to coerce Hart into paying for a sex video.