Commands/Lua

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

CS2D Command CS2D Console Commands

Lua Hook Lua Hooks

Lua Command Lua Commands

Lua Command hostage

Categories

Parameters

  • id
  • "value"

Info

Returns a value of a hostage:

  • exists: boolean, true if hostage with this ID exists, false otherwise

  • health: hostage health (0-100)

  • follow: is hostage following a player? Player ID if yes, 0 otherwise.

  • used: boolean, true if hostage has been used by a counter-terrorist this round, false otherwise

  • look: hostage look (skin frame)

  • x: current x position on map (in pixels)

  • y: current y position on map (in pixels)

  • rot: current rotation angle

  • tilex: current x position on map (in tiles)

  • tiley: current y position on map (in tiles)



Moreover there is:
hostage(0,"table"): a Lua table with all hostage IDs

Sample 1: Using the hostage table to list the IDs of all hostages
local hostagelist=hostage(0,"table")
for _,id in pairs(hostagelist) do
   print(id)
end