
Help
Command Reference
You can enter CS2D script commands in the console, save them in cfg-files or bind them to keys. CS2D script commands are no Lua commands but they can still be executed in Lua scripts by using the Lua parse-function!
Commands
Lua Reference
Lua scripting (server-sided) allows server hosters and mappers to modify the game and to add new elements.
Lua Hooks
Lua Commands
Category: all (66)
player
Categories
Player
Parameters
- id
- "value"
Info
Returns a value of a player:
Moreover there is:
Sample 1: Using the player table to list the names of all players
- exists: boolean, true if player with this ID exists, false otherwise
- name: name of the player
- ip: IP address of the player
- port: Port of the player
- usgn: Unreal Software Gaming Network / UnrealSoftware.de user ID
- ping: current ping (ms)
- idle: idle time (no movement) in seconds
- bot: boolean, true if player is a bot, false otherwise
- team: 0 for spec, 1 for t, 2 for ct, 3 for VIP (ct)
- look: player look (0-3) = selected skin
- 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)
- health: health value
- armor: armor value
- money: money value
- score: score (kills+mission goals)
- deaths: number of deaths
- teamkills: teammates killed
- hostagekills: hostages killed
- teambuildingkills: buildings of own team killed
- weapontype: type of current weapon
- nightvision: boolean, true if has a nightvision, false otherwise
- defusekit: boolean, true if has a defusekit, false otherwise
- gasmask: boolean, true if has a gasmask, false otherwise
- bomb: boolean, true if has bomb, false otherwise
- flag: boolean, true if has a flag, false otherwise
- reloading: boolean, true if is currently reloading, false otherwise
- process: current process (internal id for reloading/planting/defusing...)
- sprayname: name of spaylogo
- spraycolor: color of spraylogo
- votekick: current vote for kicking (player id or 0 for none)
- votemap: current vote for map change (or empty string for none)
- favteam: favorite team
- speedmod: speedmod value
- maxhealth: maximum health
- rcon: boolean, true if logged in with correct RCon password, false otherwise
- ai_flash: how long (in seconds) is this bot flashed by a flashbang (0 for not flashed)
Moreover there is:
- player(0,"table"): a Lua table with all player IDs
- player(0,"tableliving"): a Lua table with all living player IDs
- player(0,"team1"): a Lua table with all terrorist IDs
- player(0,"team2"): a Lua table with all counter-terrorist IDs
- player(0,"team1living"): a Lua table with all living terrorist IDs
- player(0,"team2living"): a Lua table with all living counter-terrorist IDs
Sample 1: Using the player table to list the names of all players
local playerlist=player(0,"table")
for _,id in pairs(playerlist) do
print(player(id,"name"))
end
for _,id in pairs(playerlist) do
print(player(id,"name"))
end






