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
hudtxtCategories
Parameters
- id (0-199): internal text id
- text (text): the text you want to display
- x (0-850): x position
- y (0-480): y position
- [align] (0,1,2)(optional): horizontal alignment
- [valign] (0,1,2)(optional): vertical alignment
- [size] (10-100)(optional): font size/height in pixels, 13 by default
Info
Display or hide a text on the screen of EVERY player (as server only).
Just enter the first parameter (id) and leave out all other parameters in order to hide an existing text.
The position (x, y) is in pixels and defines the text position on the screen.
The horizontal alignment parameters mean:
- 0 - left alignment (normal)
- 1 - center alignment
- 2 - right alignment
The vertical alignment parameters mean:
- 0 - top alignment (normal, text will be UNDER the y coordinate)
- 1 - center alignment
- 2 - bottom alignment (text will be OVER the y coordinate)
You can also use color codes (use a colorpicker to get the values) at the beginning and in-line! Colors are encoded as RGB values.
Format: ©RRRGGGBBB (with each part RRR, GGG and BB ranging from 000 to 255)
For example: "©255000000This is a red text" or "The following text is ©000000255blue"
Note: Each color component, R, G and B always has to have 3 digits. Add leading zeros if necessary!
Note: Use hudtxt2 instead if you only want to display a text for a specific player!
Note: The texts/IDs are shared with the hudtxt2 command!
Note: Affected by mp_hudscale
Lua Hooks
Lua Commands
Categories
Parameters
- id (0-199): internal text id
- text (text): the text you want to display
- x (0-850): x position
- y (0-480): y position
- [align] (0,1,2)(optional): horizontal alignment
- [valign] (0,1,2)(optional): vertical alignment
- [size] (10-100)(optional): font size/height in pixels, 13 by default
Info
Display or hide a text on the screen of EVERY player (as server only).
Just enter the first parameter (id) and leave out all other parameters in order to hide an existing text.
The position (x, y) is in pixels and defines the text position on the screen.
The horizontal alignment parameters mean:
The vertical alignment parameters mean:
You can also use color codes (use a colorpicker to get the values) at the beginning and in-line! Colors are encoded as RGB values.
Format: ©RRRGGGBBB (with each part RRR, GGG and BB ranging from 000 to 255)
For example: "©255000000This is a red text" or "The following text is ©000000255blue"
Just enter the first parameter (id) and leave out all other parameters in order to hide an existing text.
The position (x, y) is in pixels and defines the text position on the screen.
The horizontal alignment parameters mean:
- 0 - left alignment (normal)
- 1 - center alignment
- 2 - right alignment
The vertical alignment parameters mean:
- 0 - top alignment (normal, text will be UNDER the y coordinate)
- 1 - center alignment
- 2 - bottom alignment (text will be OVER the y coordinate)
You can also use color codes (use a colorpicker to get the values) at the beginning and in-line! Colors are encoded as RGB values.
Format: ©RRRGGGBBB (with each part RRR, GGG and BB ranging from 000 to 255)
For example: "©255000000This is a red text" or "The following text is ©000000255blue"
Note: Each color component, R, G and B always has to have 3 digits. Add leading zeros if necessary!
Note: Use hudtxt2 instead if you only want to display a text for a specific player!
Note: The texts/IDs are shared with the hudtxt2 command!
Note: Affected by mp_hudscale