API reference
API reference
The CS2 scripting API: 35 namespaces and 292 entries, one page per group. Each entry gives its signature, what it does, its arguments and what it returns, with a short example where one helps.
Pages
| Page | What it covers | Namespaces |
|---|---|---|
| Events, the script and globals | Callbacks, the script object, time, logging and the global helpers. | events, script, Globals, time, log |
| Drawing and colours | Shapes, text and images on the overlay, colours, and the old render aliases. | draw, color, render (compat) |
| Settings UI and config | Your script's own settings, and evasive's settings and profiles. | ui, config, Control |
| Input and keys | Keys, the mouse and the user's CS2 binds. | input, vk |
| Aim, attack and keys | Acting through approved scripts. | keys, aim, attack, act |
| Game, entities and players | The match, players, the local player and the constants that go with them. | game, entities, Player, LocalPlayer, bone, hitgroup, weapon_type |
| World and combat | Map traces, smokes, grenades and combat. | world, combat |
| Custom shaders | Chams materials with your own HLSL. | scene, Material |
| Storage, files, JSON and HTTP | Saving data, files, JSON, web requests and maths helpers. | storage, files, json, http, math |
| Media | What is playing on the PC, and its controls. | media, MediaSession |
Permissions
Some entries need a switch in Scripts > Security. Their entry says which. Permissions explains them.
| Switch | Starts | What it allows |
|---|---|---|
| Allow game scripting | on | game.*, entities.*, world.* and combat.*: players, the bomb, the camera, map traces and what aim and trigger do. Read-only. |
| Allow internet connections | off | http.*: 4 requests at once, 10 s timeout, 2 MiB responses. |
| Allow scripts to edit cfg files | off | config.*: read and change evasive's own settings and configs. |
| Allow insecure FFI | off | Full io, os and debug libraries. Gives a script your files and processes; keep it off unless you wrote the script. |
| Allow custom shaders | off | scene.* and Player:set_material: chams materials with the script's own HLSL pixel shader, run on your GPU. A slow one is switched off by itself. While the switch is off, scene is nil. |
| Allow scripts to aim, shoot and press keys | off | aim.*, attack.*, keys.*, act.status and input.press / down / up / hold / release_all: move your view, fire and press keys, only through the Aim and Trigger safety gates and never while the menu is open or CS2 is in the background. Each version of a script also needs your approval. Off while Allow insecure FFI is on. |