# Cheat

### **RegisterCallback** <a href="#registercallback" id="registercallback"></a>

#### Registers a callback for a function <a href="#registers-a-callback-for-a-function" id="registers-a-callback-for-a-function"></a>

```lua
Cheat.RegisterCallback('OnRenderer', OnRenderer());
```

| Name              | Type     |
| ----------------- | -------- |
| Callback Name     | String   |
| Callback Function | Function |

{% hint style="success" %}
List of all internal callbacks:

OnMapLoad

OnPreCreateMove

OnPostCreateMove

OnFrameStageNotify

OnRenderer

OnFireGameEvent
{% endhint %}

### **GetUserName** <a href="#getusername" id="getusername"></a>

#### Returns PlagueCheat forum username <a href="#returns-plaguecheat-forum-username" id="returns-plaguecheat-forum-username"></a>

```lua
Cheat.GetUserName()
```

### **GetScriptName** <a href="#getscriptname" id="getscriptname"></a>

#### Returns name of loaded script <a href="#returns-name-of-loaded-script" id="returns-name-of-loaded-script"></a>

```lua
Cheat.GetScriptName()
```

### **GetScriptId** <a href="#getscriptid" id="getscriptid"></a>

#### Returns ID of loaded script <a href="#returns-id-of-loaded-script" id="returns-id-of-loaded-script"></a>

```lua
Cheat.GetScriptId()
```

### **GetPlayerFromUserId** <a href="#getplayerfromuserid" id="getplayerfromuserid"></a>

#### Returns a player object from their ID <a href="#returns-a-player-object-from-their-id" id="returns-a-player-object-from-their-id"></a>

```lua
Cheat.GetPlayerFromUserId()
```

| Name | Type    | Description             |
| ---- | ------- | ----------------------- |
| UID  | Integer | Returns in-game user ID |


---

# 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.plaguecheat.cc/reference/cheat.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.
