umm try something like when construction is completed on building1 add +1 to a variable named Income, then whatever you have as your income trigger, just make it add <Income> gold to player <whatever>
Counting every building on each tick is a waste of computer resources(IMO) i would just use a variable to hold how much each player gets, or even an array so you have only 1 variable for all players.
function Trig_Animals_Spawn_Func001002 takes nothing returns nothing
call CreateNUnitsAtLoc( 1, 'nshe', GetOwningPlayer(GetEnumUnit()), GetUnitLoc(GetEnumUnit()), bj_UNIT_FACING )
endfunction
function Trig_Animals_Spawn_Func002002 takes nothing returns nothing
call CreateNUnitsAtLoc( 1, 'npig', GetOwningPlayer(GetEnumUnit()), GetUnitLoc(GetEnumUnit()), bj_UNIT_FACING )
endfunction
function Trig_Animals_Spawn_Func003002 takes nothing returns nothing
call CreateNUnitsAtLoc( 1, 'n00D', GetOwningPlayer(GetEnumUnit()), GetUnitLoc(GetEnumUnit()), bj_UNIT_FACING )
endfunction
function Trig_Animals_Spawn_Actions takes nothing returns nothing
call ForGroupBJ( GetUnitsOfTypeIdAll('h002'), function Trig_Animals_Spawn_Func001002 )
call ForGroupBJ( GetUnitsOfTypeIdAll('h001'), function Trig_Animals_Spawn_Func002002 )
call ForGroupBJ( GetUnitsOfTypeIdAll('n00C'), function Trig_Animals_Spawn_Func003002 )
endfunction
//===========================================================================
function InitTrig_Animals_Spawn_Copy takes nothing returns nothing
set gg_trg_Animals_Spawn_Copy = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Animals_Spawn_Copy, 60.00 )
call TriggerAddAction( gg_trg_Animals_Spawn_Copy, function Trig_Animals_Spawn_Actions )
endfunction
function Trig_Farming_Gold_Func001002 takes nothing returns nothing
call AdjustPlayerStateBJ( 2, GetOwningPlayer(GetEnumUnit()), PLAYER_STATE_RESOURCE_GOLD )
endfunction
function Trig_Farming_Gold_Func002002 takes nothing returns nothing
call AdjustPlayerStateBJ( 4, GetOwningPlayer(GetEnumUnit()), PLAYER_STATE_RESOURCE_GOLD )
endfunction
function Trig_Farming_Gold_Actions takes nothing returns nothing
call ForGroupBJ( GetUnitsOfTypeIdAll('nshe'), function Trig_Farming_Gold_Func001002 )
call ForGroupBJ( GetUnitsOfTypeIdAll('npig'), function Trig_Farming_Gold_Func002002 )
endfunction
//===========================================================================
function InitTrig_Farming_Gold_Copy takes nothing returns nothing
set gg_trg_Farming_Gold_Copy = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Farming_Gold_Copy, [B][COLOR="Red"]30[/COLOR][/B].00 )
call TriggerAddAction( gg_trg_Farming_Gold_Copy, function Trig_Farming_Gold_Actions )
endfunction