Let's look at the context:
Jonah3:4 Jonah began by going a day’s journey into the city, proclaiming, “Forty more days and Nineveh will be overthrown.” 5The Ninevites believed God. A fast was proclaimed, and all of them, from the greatest to the least, put on sackcloth.
6When Jonah’s warning reached the king of Nineveh, he rose from his throne, took off his royal robes, covered himself with sackcloth and sat down in the dust.
The Ninevites reacted specifically to Jonah's message of destruction. Eternal salvation was not formally introduced until the time of Jesus. However, little beknown to them, they would reap the benefit just the same as announced by Jesus in
Matthew 12:41 The men of Nineveh will stand up at the judgment with this generation and condemn it; for they repented at the preaching of Jonah, and now something greater than Jonah is here.
Whether they knew it or not, those who believed God and repented would inherit eternal salvation.