Commands/Lua

Reference for console commands, Lua hooks and Lua commands in CS2D.

CS2D Command CS2D Console Commands

Lua Hook Lua Hooks

Category: all (73)

Lua Hook 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 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)

Lua Command Lua Commands