You need an integer array keeping income for every player.
A trigger that detects buying the sent units, that will increase the array value for the buying player.
And another trigger, that will give gold to each player equal to the value in the array every x seconds.