Commands/Lua
Reference for console commands, Lua hooks and Lua commands in CS2D.
- Console Commands are entered in console, executed with key-binds, cfg-files or with Lua parse
- Lua Hooks execute Lua when events occur - some have a return value which can change the game behavior
- Lua Commands are used to retrieve game data or to perform actions in Lua scripts
CS2D Console Commands
Lua Hooks
httpdata
Categories
Parameters
- requestid: The ID of the TCP request the data belongs to
- state: The result state (1 data received, 0 failed)
- data: The received data (string or byte table)
Info
Called when HTTP data is received after requesting it with reqhttp.
requestid matches the ID which is also returned by the reqhttp command. This way you can match the request with the response.
state will be 0 if the request failed for whatever reason (data will be an empty string in that case) or 1 if data was received.
data can either be a simple string or a table with bytes/numbers. The type of data depends on what you requested with reqhttp.
requestid matches the ID which is also returned by the reqhttp command. This way you can match the request with the response.
state will be 0 if the request failed for whatever reason (data will be an empty string in that case) or 1 if data was received.
data can either be a simple string or a table with bytes/numbers. The type of data depends on what you requested with reqhttp.
Attention: Many/big HTTP requests can influence the performance of the server in a negative way and can lead to ping spikes for connected players. Use with care!
Return Values
none - related action(s) [if there are any] performed by CS2D cannot be altered/omitted