Environmental influences on cooperation in social dilemmas on networks