Is it true that was the real jim lovell in the movie apollo 13 based on the following text?

In 1995, actor Tom Hanks portrayed Lovell in the hit movie Apollo 13, based on Lovell's book Lost Moon. Lovell himself makes a cameo in this movie, playing the captain of the USS Iwo Jima at the end of the film. In 1998, actor Tim Daly portrayed Lovell in portions of the HBO miniseries From the Earth to the Moon. The film depicts Lovell during his missions aboard Gemini 12, Apollo 8, and Apollo 13, though he is not seen on screen during the latter mission.
yes