Is it possible to restrict a player's input so that they can only perform certain tasks?

Additionally, I now have the problem that if both players are near the ball, the ball will always kick in the direction that player 1 is looking because the branch to see if player 1 is close happens to be first in the order of things.