# PlayerSystem

### Methods

<table data-full-width="true"><thead><tr><th align="right">Name</th><th align="center">Parameters</th><th align="center">Return</th><th>Description</th></tr></thead><tbody><tr><td align="right">GetById</td><td align="center">ulong Id</td><td align="center">Game.Player</td><td>Get a player by their ulong Id. (Game.Player.Id)</td></tr></tbody></table>

### Events

<table data-full-width="true"><thead><tr><th align="right">Name</th><th align="center">Return Type</th><th>Description</th></tr></thead><tbody><tr><td align="right">PlayerJoinEvent</td><td align="center">PlayerSystem.PlayerEvent?</td><td>Signals any time a player connects to the server.</td></tr><tr><td align="right">PlayerLeftEvent</td><td align="center">PlayerSystem.PlayerEvent?</td><td>Signals any time a player disconnects from the server.</td></tr></tbody></table>

### Delegates

<table data-full-width="true"><thead><tr><th align="right">Name</th><th>Parameters</th><th align="center">Return Type</th><th>Description</th></tr></thead><tbody><tr><td align="right">PlayerEvent</td><td>Game.Player Id</td><td align="center">void</td><td>Generic delegate for Player events.</td></tr></tbody></table>

### Variables

<table data-full-width="true"><thead><tr><th align="right">Name</th><th align="center">Type</th><th>Description</th></tr></thead><tbody><tr><td align="right">Players</td><td align="center">IEnumerable&#x3C;Game.Player></td><td>Iterable collection of Players.</td></tr></tbody></table>


---

# Agent Instructions: 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.hogwarp.com/hogwarp/scripting/server-side/api-documentation/server/playersystem.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.
