> 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-warriorslib-de/warriorslib-functions/warriorslib.recruitwarriors.md).

# WarriorsLib.RecruitWarriors

## `WarriorsLib.RecruitWarriors(`buildingid, warriortype, amount, party`)`

Geben sie sie dem angegeben Gebäude (meistens eine Kaserne) den Befehl die Rekrutierung von angegebenem Einheitentyp zu starten.&#x20;

\
`amount` ist dabei die Anzahl der Einheiten, die Sie für die Rekrutierung in die Warteschlange stellen möchten. Dieser Wert ist bis auf einige Ausnahmen additiv. Sie können negative Werte übergeben, um die Anzahl der Einheiten in der Warteschlange zu reduzieren. Das Spiel verwendet nur die folgenden Werte.

| Value | Description                                                                                          |
| ----- | ---------------------------------------------------------------------------------------------------- |
| -5    | Subtrahieren Sie fünf Einheiten von der Warteschlange.                                               |
| -1    | Subtrahieren Sie eine Einheit von der Warteschlange                                                  |
| 0     | Löscht die Warteschlange. Dadurch wird das Gebäude daran gehindert, weitere Einheiten zu produzieren |
| 1     | Fügen Sie der Warteschlange eine Einheit hinzu.                                                      |
| 5     | Fügen Sie der Warteschlange fünf Einheiten hinzu                                                     |
| 100   | Das Spiel wird dies als unendlich interpretieren und die Warteschlange niemals verkleinern.          |

#### Rückgabewert

* **Ab Version 1.5.0**: success \[0, 1]
* Davor: none

```lua
WarriorsLib.RecruitWarriors(Buildings.GetFirstBuilding(1, Buildings.BARRACKS), Settlers.BOWMAN_03, 5, 1)
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.settlers-united.com/s4-warriorslib-de/warriorslib-functions/warriorslib.recruitwarriors.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
