A:
First I should reassure you that dreams like these very rarely come true in a literal way, and it's not possible for another person to literally attack you in your dreams. Even though the dream was quite frightening and may have made you feel scared even after it was over, I don't think your dream literally means that you're going to be shot. However, dreams can be taken metaphorically to help understand your current feelings about some aspect of your waking life, which may in fact shape your future (making dreams seem prescient).
Was the school in your dream somewhere you go to school (or used to go?). In dreams, buildings often represent the dreamer's mind. Let's think about the significance of your mind's choice of a school to represent itself: schools are a place of growth and learning, but also a place of conformity, discipline, and insecurity.
Couple those aspects with the chaos and violence of the dream, and I would say the dream indicates some conflict that needs to be resolved among your peers. In the dream, your friends seemed oblivious to the danger but YOU were the one trying to get them to take notice. As in the dream, you must also be the agent of change in your waking life.
Note also that you were the one who was harmed, presumably for taking action and helping your friends. Isn't it a sad fact of life that the people who try to change things are the ones who often get hurt? Take this as a sign to proceed carefully once you've identified the issue in your waking life that this dream is trying to call attention to.
Violence in a dream, and even dreaming of one's own death, are not uncommon. They should be taken metaphorically and applied to more mundane issues in your life. I hope this helps!