anyone I have to

Are these sentences correct:
[color=red]1) I will talk to anyone I have to.
MEANING: … anyone I have to talk to.

[color=blue]2) I will take advice from anyone I have to.
MEANING: … anyone I have to take advice from.

[color=indigo]3) I will hit the stick against anything I have to.
MEANING: … anything I have to hit the stick against.

Gratefully,
Navi.

They’re all okay, though I would clarify the meanings:

I will talk to/take advice from/etc. anyone who I have to talk to/take advice from (in order to get it done).