Hey guys, on question

I want to add a feature to my modification. If you near to a burning car or explosive tank i don't want to get any damage when they explodes..
But how?