# void Settlement::SetPlayer(int)

[Family: Settlement](/en/CKS/familias/settlement/)

## Exact signature

```text
void Settlement::SetPlayer(int)
```

## Description

Changes the settlement's owner. When the player differs from the current one, the stored gold moves to the new owner's statistics and every building of the settlement gets the new owner.

## Usage notes

An object joining a settlement keeps its owner; only this change of the settlement's owner re-owns its buildings. The loop over the buildings was not checked instruction by instruction.

## Parameters and return type

**Return type:** `void`

The member is called on an object. Its receiver is not repeated among this signature’s arguments.

| Position | Type |
| --- | --- |
| 1 | `int` |

## Read and share

- [Markdown](/exports/en/cks/api-776ce598a2c1d5.md)
- [JSON](/CKS/api/entries/api-776ce598a2c1d5?lang=en)

Keep the notes and limitations when reusing this description. Do not infer undocumented parameter meanings, units or effects.
