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
Category: all (86)
- addbind
- addhook
- ai_aim
- ai_attack
- ai_build
- ai_buy
- ai_debug
- ai_drop
- ai_findtarget
- ai_freeline
- ai_goto
- ai_iattack
- ai_move
- ai_radio
- ai_reload
- ai_respawn
- ai_rotate
- ai_say
- ai_sayteam
- ai_selectweapon
- ai_spray
- ai_use
- checksumfile
- checksumstring
- closehostage
- closeitems
- closeobjects
- closeplayers
- entity
- entitylist
- fow_in
- freehook
- freeimage
- freetimer
- funcs
- game
- hascloseplayers
- hostage
- image
- imagealpha
- imageblend
- imagecolor
- imageframe
- imagehitzone
- imageparam
- imagepos
- imagescale
- inentityzone
- item
- itemtype
- map
- menu
- msg
- msg2
- object
- objectat
- objecttype
- parse
- player
- playerammo
- playerweapons
- projectile
- projectilelist
- randomentity
- randomhostage
- removeallbinds
- removebind
- reqcld
- reqhttp
- setentityaistate
- sethookstate
- stats
- steamstats
- tile
- tileproperty
- timer
- tween_alpha
- tween_animate
- tween_color
- tween_frame
- tween_move
- tween_rotate
- tween_rotateconstantly
- tween_scale
- vars
reqcldCategories
Parameters
- id
- mode
- [parameter] (optional)
Info
reqcld is short for "request client data". This command requests data from a single player client (id=player id) or from all clients (id=0).
Mode specifies which data the server will receive:
- Mode 0: Cursor position (cursor position on screen in pixels, scaled based on mp_hudscale)
Deprecated: It is recommended to use player with parameters "mousex"/"mousey" instead!
- Mode 1: Map scrolling (scrolling offset in pixels)
- Mode 2: Absolute cursor position (cursor position on map in pixels, NOT influenced by mp_hudscale)
Deprecated: It is recommended to use player with parameters "mousemapx"/"mousemapy" instead!
- Mode 3: 1 if the client has the advanced light engine enabled, 0 otherwise (second value always 0)
- Mode 4: 1 if the file specified with parameter (file path relative to the CS2D folder) has been loaded, 0 otherwise; checksum of the file (only if the file is under gfx/ or sfx/) as provided by checksumfile
- Mode 5: Mod info
- Mode 6: 1 if the client has 3D rendering (render3d) enabled, 0 otherwise (second value always 0)
The last parameter is not required for all modes. For some modes (mode 4) it is crucial though. Please read the descriptions of the modes to learn when and how it is used.
The requested data will be received with a delay. This is because it is sent over the network. You have to use the clientdata-hook to handle the incoming data!
Note: reqcld-data is guaranteed to arrive (unless the client is unreachable).
Note: The last parameter is optional and only required/used by some of the modes.
Note: mode 0 / mode 2: Please check if you can use the player Lua command instead. It allows you to get "mousex"/"mousey" or "mousemapx"/"mousemapy" as well without causing additional network traffic!
Attention: This command uses reliable UDP packets. Using it too frequently might lead to lags or ping spikes!
Attention: Keep in mind that all values sent by the client might be manipulated by hacks or other software. You can't trust them 100%!
Categories
Parameters
- id
- mode
- [parameter] (optional)
Info
reqcld is short for "request client data". This command requests data from a single player client (id=player id) or from all clients (id=0).
Mode specifies which data the server will receive:
The last parameter is not required for all modes. For some modes (mode 4) it is crucial though. Please read the descriptions of the modes to learn when and how it is used.
The requested data will be received with a delay. This is because it is sent over the network. You have to use the clientdata-hook to handle the incoming data!
Mode specifies which data the server will receive:
- Mode 0: Cursor position (cursor position on screen in pixels, scaled based on mp_hudscale)Deprecated: It is recommended to use player with parameters "mousex"/"mousey" instead!
- Mode 1: Map scrolling (scrolling offset in pixels)
- Mode 2: Absolute cursor position (cursor position on map in pixels, NOT influenced by mp_hudscale)Deprecated: It is recommended to use player with parameters "mousemapx"/"mousemapy" instead!
- Mode 3: 1 if the client has the advanced light engine enabled, 0 otherwise (second value always 0)
- Mode 4: 1 if the file specified with parameter (file path relative to the CS2D folder) has been loaded, 0 otherwise; checksum of the file (only if the file is under gfx/ or sfx/) as provided by checksumfile
- Mode 5: Mod info
- Mode 6: 1 if the client has 3D rendering (render3d) enabled, 0 otherwise (second value always 0)
The last parameter is not required for all modes. For some modes (mode 4) it is crucial though. Please read the descriptions of the modes to learn when and how it is used.
The requested data will be received with a delay. This is because it is sent over the network. You have to use the clientdata-hook to handle the incoming data!
Note: reqcld-data is guaranteed to arrive (unless the client is unreachable).
Note: The last parameter is optional and only required/used by some of the modes.
Note: mode 0 / mode 2: Please check if you can use the player Lua command instead. It allows you to get "mousex"/"mousey" or "mousemapx"/"mousemapy" as well without causing additional network traffic!
Attention: This command uses reliable UDP packets. Using it too frequently might lead to lags or ping spikes!
Attention: Keep in mind that all values sent by the client might be manipulated by hacks or other software. You can't trust them 100%!