> For the complete documentation index, see [llms.txt](https://docs.sasavn.ru/cs2_lua/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sasavn.ru/cs2_lua/documentation/callbacks.md).

# Callbacks

## Creating Callback

To create callback you should create function and then mark program, that you can handle this case. Here a litte example of creating callback

```lua
--our callback name (can be anything, the main thing is to indicate it correctly later)
function MenuOptions()
    Menu.Button("Hello world")
end

--we tell the program that we are processing this case
--first arg its harcoded name, second its your callback function name
CreateCallback("on_menu_options", "MenuOptions")
```

## Available Callbacks

### <mark style="color:green;">on\_create\_move</mark>

Main game function to handle all player movements

Contains 3 arguments:

1. [CCSGOInput](/cs2_lua/documentation/types/ccsgoinput.md)
2. [CUserCmd](/cs2_lua/documentation/types/cusercmd.md)
3. [CBaseUserCmd](/cs2_lua/documentation/types/cbaseusercmd.md)

There is no need to return anything

### <mark style="color:green;">on\_frame\_stage\_notify</mark>

Something like the main tick of the game

Contains 1 argument:

1. int (current stage)

There is no need to return anything

### <mark style="color:green;">on\_menu\_options</mark>

Render some controls (like buttons, toggles, sliders and etc.) in our menu

Contains no arguments

There is no need to return anything

### <mark style="color:green;">on\_render</mark>

There you can render your ui, esp, and others visuals things using our Render class

Contains no arguments

There is no need to return anything

### <mark style="color:green;">on\_rage\_player\_check</mark>

There you can ignore or filter some players, so if you need you can add more checks to rage logic

Contains 2 arguments:

1. int (enemy player index)
2. [CSPlayerController](/cs2_lua/documentation/types/csplayercontroller.md) (enemy player controller)

**Return false** if you need to ignore player and **return true** if everything is OK
