Make sure that your player is named "player". Place this line of code at the beginning of your player action:

action my_player
{
player = my;
// the rest of your playercode would go here
............
}