> For the complete documentation index, see [llms.txt](https://docs.settlers-united.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.settlers-united.com/s4-lua-api-de/su-library-functions/su.game/su.game.getbeds.md).

# SU.Game.GetBeds

## SU.Game.GetBeds(playerID, mode=0)

Gibt die Anzahl der Betten zurück.

#### Parameter

* `playerID [1-8]`: Spieler-ID, **Index 0 ist ungültig!**
* `mode` (optional): 0 Gesamtanzahl, 1 Startbettenanzahl (ohne Wohnhäuser), 2 Bettenanzahl nur von Wohnhäusern

#### Rückgabewert

* Bettenanzahl
* -1 sonst / Fehler

#### Beispiel

```lua
local numBeds = SU.Game.GetBeds(1, 1)    -- so viele Betten hat Spieler 1 *ohne* Wohnhäuser
local numBeds = SU.Game.GetBeds(1, 2)    -- so viele Betten hat Spieler 1 durch Wohnhäuser
local numBeds = SU.Game.GetBeds(1)    -- so viele Betten hat Spieler 1 insgesamt
```
