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
sv_msg2Categories
Parameters
- player (1-32): ID of a player
- message (text): the message you want to send
Info
Send a message to a certain player on your server.
Use msg or sv_msg instead if you want to show a message to all players.
Add an @C at the end of your text to display the message at the center of the screen.
For example: "Centered text@C"
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 component, R, G and B always has to have 3 digits. Add leading zeros if necessary!
Lua Hooks
Lua Commands
Categories
Parameters
- player (1-32): ID of a player
- message (text): the message you want to send
Info
Send a message to a certain player on your server.
Use msg or sv_msg instead if you want to show a message to all players.
Add an @C at the end of your text to display the message at the center of the screen.
For example: "Centered text@C"
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"
Use msg or sv_msg instead if you want to show a message to all players.
Add an @C at the end of your text to display the message at the center of the screen.
For example: "Centered text@C"
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 component, R, G and B always has to have 3 digits. Add leading zeros if necessary!