There is no straight analog for "fun" and its usage.
By itself, "have fun" is rather "повеселись". But if in English you are having something fun, in Russian you rather doing something fun. Which make a big difference in grammatical constructions.
However, as far as I understand, in English it's okay to have a conversation like:
- I'm going to cinema.
- Great, have fun!
But in Russian you usually will not see something like:
- Я иду в кино.
- Здорово, повеселись!
Although it is not incorrect in any terms of grammar (if only the movie is not a horror or a lachrymose romance), it is just not like people are actually talking. In that case, if you don't want to expose yourself as a foreign spy, you should rather answer something like "приятного просмотра" or "приятно провести время".
In general, "to have fun" is not the thing Russians are wish to each other in conversations too often. Although this is not means they aren't wish it at all. :)
So if to translate "Did you have a fun night?" - I would say it is "Ты хорошо провёл вечер/ночь?". Depends on what the night actually was, 6PM - 0AM, or 0AM - 6AM.
"Have fun" is very general, but in Russian, in such cases, it is more specific to context:
Приятного просмотра - have fun [in cinema]
Приятно посидеть - have fun [in pub]
Приятно покататься - have fun [in any activity involving driving]
And so on. General phrase "приятно провести время" covers almost all cases, I believe, but as you see it is much longer than just "have fun", and thus a bit formal phrase.
Also, if I'm correct, you could say "have fun" just like "good luck" (удачи) in some cases. "Приятно провести время" doesn't cover this, it is bound to an ongoing event that suggests having actual fun.