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
Category: all (79)
- always
- assist
- attack
- attack2
- bombdefuse
- bombexplode
- bombplant
- break
- build
- buildattempt
- buy
- clientdata
- clientsetting
- collect
- connect
- connect_attempt
- connect_initplayer
- die
- disconnect
- dominate
- drop
- endround
- flagcapture
- flagtake
- flashlight
- hit
- hitzone
- hostagedamage
- hostagekill
- hostagerescue
- hostageuse
- httpdata
- itemfadeout
- join
- key
- kill
- leave
- log
- mapchange
- menu
- minute
- move
- movetile
- ms100
- name
- objectdamage
- objectkill
- objectupgrade
- parse
- projectile
- projectile_impact
- radio
- rcon
- reload
- say
- sayteam
- sayteamutf8
- sayutf8
- second
- select
- serveraction
- shieldhit
- shutdown
- spawn
- specswitch
- spray
- startround
- startround_prespawn
- suicide
- team
- trigger
- triggerentity
- turretscan
- use
- usebutton
- vipescape
- voice
- vote
- walkover
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