If he has a wet dream whilst travelling and is not able to do ghusl
Question

I was on a journey and fell asleep on my way. I had a wet dream before Zuhr prayer and was not able to take a shower with my companions there. I prayed Zuhr, ‘Asr, Maghrib and ‘Isha’. When I got back to Riyadh, I made up all the prayers. What should I do in such situations? If I am outside the city and have a wet dream, what should I do?
Praise be to Allah.If someone becomes junub as a result of a wet dream or otherwise, he must do ghusl. If he cannot find water, or he can find it but feels that he may be harmed if he uses it, because it is extremely cold, and he cannot find any means of heating it, then he should do tayammum and pray, even if he is going to stay in that place for several days, because Allah, may He be exalted, says (interpretation of the meaning):
“And if you are ill or on a journey or one of you comes from the place of relieving himself or you have contacted women and find no water, then seek clean earth and wipe over your faces and your hands [with it]” [an-Nisa’ 4:43].
And because of the hadith of ‘Amr ibn al-‘Aas (may Allah be pleased with him), who said: I had a wet dream on a cold night during the campaign of Dhaat al-Salaasil, and I was scared that if I did ghusl I might die. So I did tayammum and prayed, andled my companions in Fajr prayer, then in the morning my companions mentioned that to the Prophet (peace and blessings of Allah be upon him). He said, “‘O ‘Amr, you led your companions in prayer when you were junub.” I told him what had kept me from doing ghusl and I said: I heard that Allah says (interpretation of the meaning): “And do not kill yourselves. Indeed, Allah is to you ever Merciful” [al-Nisa’ 4:29].’ The Messenger of Allah (peace and blessings of Allah be upon him) smiled and did not say anything.
Narrated by Abu Dawood (334); classed as saheeh by al-Albaani in Saheeh Abi Dawood (323).
Al-Haafiz Ibn Hajar (may Allah have mercy on him) said: This hadith indicates that it is permissible to do tayammum for one who expects that using water may lead to his death, whether that is because of cold or other reasons, and that it is permissible for one who has done tayammum to lead in prayer those who have done wudu.
End quote from Fath al-Baari (1/454).
With regard to not doing ghusl and still praying, out of embarrassment and shyness, that is not permissible, and it is a grave evil and is one of the causes of being punished in the grave. This has been explained in the answer to question no. 65731.
Conclusion: if you did not do ghusl out of embarrassment and shyness before your companions, then that is haraam, and you must repent to Allah, regret that, and resolve not to do it again.
But if you did not do ghusl because you could not find water, or you found it but the water was cold and you had no means of heating it, then it is permissible for you not to do ghusl and to do tayammum instead. So if you did tayammum, your prayer was valid, but if you prayed without tayammum then your prayer was not valid, but you repeated it after you returned from your trip. We ask Allah to grant us understanding of His religion.
And Allah knows best.