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
Lua Commands
hostageCategories
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
Categories
Parameters
- id
- "value"
Info
Returns a value of a hostage:
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
- 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
for _,id in pairs(hostagelist) do
print(id)
end