Make a copy of the "Harvest Gold/Lumber" ability and set the fields for lumber all to 0.
Its all there in the ability.
You can check whether a player is playing via triggers.
There are conditions for whether the player is in the game and if it is an actual "human" player or an AI controlled player slot.