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
 
 
 leave
Categories
Parameters
- id: player id
 
- reason: reason id (0 normal, >0 kick/ban/timeout)
 
Info
When a player leaves the game. Either manually by disconnecting or forced by server (kick/ban).
Possible reason IDs:
Possible reason IDs:
- 0 - normal leave (player left game manually)
 - 1 - ping timeout
 - 2 - kicked (without reason text)
 - 3 - kicked because a cheat was detected
 - 4 - server shutdown
 - 5 - client confirmed server shutdown (each client sends this when the server is being shut down)
 - 6 - banned
 - 7 - error during join process
 - 8 - client failed to load map
 - 9 - join process cancelled by user
 - 10 - ping too high (mp_pinglimit)
 - 11 - kicked for too many team kills (mp_teamkillpenalty)
 - 12 - kicked for too many hostage kills (mp_hostagepenalty)
 - 13 - kicked via voting of other players (mp_kickpercent, vote)
 - 14 - kicked for reservation system (mp_reservations)
 - 15 - kicked because a speedhack was detected
 - 16 - kicked (with reason text)
 - 17 - player has been rerouted to another server (reroute)
 - 18 - kicked for being idle (mp_idletime, mp_idlekick, mp_idleaction)
 - 19 - kicked for flooding chat with messages
 
Note: When this hook is executed, the player data is still available. It will be removed directly afterwards. If you want to run a script AFTER the player has been fully removed, use disconnect.
Return Values
none - related action(s) [if there are any] performed by CS2D cannot be altered/omitted