In most cases, you will want to exit your vehicle to engage your attacker. Fighting from inside a car greatly limits your mobility and options. Also, if your attacker begins shooting at you, the passenger compartment of a vehicle is basically a coffin.
Use the door as a barrier. Keep your off-hand low to protect it and move toward the rear of the vehicle. If you have to fire, you can fire right through the auto glass as you seek cover.
Look for Accomplices
Anytime you engage an attacker, make sure you scan the area for other threats. Remember, bad guys run in packs. Use your vehicle for cover but be on the lookout for anyone else coming at you.