Human behavioural patterns exhibit selfish or competitive, as well as selfless or altruistic tendencies, both of which have demonstrable effects on human social and economic activity. In behavioural economics, such effects have traditionally been illustrated experimentally via simple games such as the dictator and the ultimatum games. Experiments with these games suggest that, beyond rational economic thinking, human decision-making processes are influenced by social preferences, such as an inclination to fairness. In this study, we suggest that the apparent gap between competitive and altruistic human tendencies can be bridged by assuming that people are primarily maximizing their status, i.e., a utility function different from simple profit maximization. To this end, we analyse a simple agent-based model, where individuals play the repeated dictator game in a social network they can modify. As model parameters, we consider the living costs and the rate at which agents forget infractions by others. We find that individual strategies used in the game vary greatly, from selfish to selfless, and that both of the above parameters determine when individuals form complex and cohesive social networks.