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
hostagekill
Categories
Parameters
- id: player id
- hostageid: hostage id
- damage: the damage that led to the kill
Info
When the player with the specified id kills the hostage with ID hostageid.
damage is the damage which led to this kill. Right before the kill hostagedamage is run with exactly the same parameters and damage.
When a hostage is killed, the following things will happen (in addition to the kill itself):
The actual kill can't be prevented in this hook.
If you want to prevent the kill you can use hostagedamage to do so.
You can however prevent the fine, the kicking and the radio message.
Return 1 to prevent the punishment (fine and kicking). The radio message will still be sent.
Return 2 to prevent the punishment AND the radio message.
damage is the damage which led to this kill. Right before the kill hostagedamage is run with exactly the same parameters and damage.
When a hostage is killed, the following things will happen (in addition to the kill itself):
- The killer has to pay a fine of 1500$ (if he has enough money, otherwise his money will just be set to 0$)
- The internal hostage kill counter of the killer will be increased by 1. The player may be auto-kicked after killing too many hostages. See mp_hostagepenalty.
- The killer will send the radio message "hostage down!"
The actual kill can't be prevented in this hook.
If you want to prevent the kill you can use hostagedamage to do so.
You can however prevent the fine, the kicking and the radio message.
Return 1 to prevent the punishment (fine and kicking). The radio message will still be sent.
Return 2 to prevent the punishment AND the radio message.
Note: The hostagedamage hook is always executed right before hostagekill!
Return Values
- 0: proceed normally (kill hostage with punishment and radio message)
- 1: no punishment but radio (kill hostage with radio message but no fine/punishment)
- 2: no punishment and no radio (kill hostage but without radio message and without fine/punishment)