I need help

I need help on getting this code for my first person character to turn at exact angles with a and d. The only problem is that we want to have a system where we can press the same key and end up looking the exact locations we want. For an example if I wanted to look at door 1 I would press d and to look at door 2 I could also press d, but if I wanted to, I could press a while looking at door 2 to go back to looking at door 1. I know this is kinda confusing but it would help a lot.

try this