Commands/Lua

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

CS2D Command CS2D Console Commands

Lua Hook Lua Hooks

Lua Hook hit

Categories

Parameters

  • id: player id (the victim)
  • source: source player id or 0 (the attacker)
  • weapon: weapon type / source type id
  • hpdmg: caused damage (health)
  • apdmg: caused damage (armor)
  • rawdmg: original damage without armor calculations
  • object id: id of dynamic object that caused the hit (or 0 if not hit by object)

Info

Whenever a player is hit/damaged.
weapon can be a weapon type ID or a special source ID.

Weapon and item type IDs:
items

Special source IDs:
killids

Return Values

  • 0: proceed normally
  • 1: ignore this hit (no damage)

Lua Command Lua Commands