But it doesn't work. When the pin 12 is high i have 0v at the pin when the DFPlayer mini is connected. But when he is not connected i have 3V to pin 12.
I'm not sure I understand... You write a high to pin 12 with nothing connected and it works - you get 3V.
Then, you connect the 1K resistor and the transistor and pin 12 drops to zero?
In that case, your 1K resistor is shorted (or it's way lower than 1K).
...Or your Arduino is bad, or maybe you're not really writing a high to pon 12. (If pin 12 is configured as an input with the internal pull-up enabled, that would give you a "weak" high that would be pulled-down with a 1K resistor.)
...Under normal conditions, a 1K resistor can't change an output state.