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
projectileCategories
Parameters
- id
- player
- "value"
Info
Returns a value of a projectile (projectiles are grenades and most stuff launched by weapons which is visible for multiple frames. Regular bullets are NO projectiles though):
- exists: boolean, true if projectile with this ID exists, false otherwise
- type: internal type ID (equal to the IDs of the corresponding weapons)
- x: current x position on map (in pixels)
- y: current y position on map (in pixels)
- dir: current flight direction
- rot: current rotation angle (just for the visual effect)
- flydist: distance in pixel this projectile will fly (relevant for flying projectiles)
- time: countdown in seconds until object will be removed (relevant for ground projectiles)
Note: Projectiles are managed in two lists: "flying" and "ground"! "flying" holds all projectiles which are currently flying. "ground" holds the projectiles which are idle on the ground.
Note: Projectiles in the ground list never move even if their values (like "flydist") might indicate something else!
Note: Server projectile values and actual client values can be different due to internet lag and latency!
Note: There is no projectile(0,"table") as it is common for comparable commands! Use the command "projectilelist" instead!
Attention: There can be multiple projectiles with the same ID (each player has its own projectile ID-space)! That's why you have to specify the ID and the player because only the combination of those two values is unique and therefore suited to address a certain unique projectile
Categories
Parameters
- id
- player
- "value"
Info
Returns a value of a projectile (projectiles are grenades and most stuff launched by weapons which is visible for multiple frames. Regular bullets are NO projectiles though):
- exists: boolean, true if projectile with this ID exists, false otherwise
- type: internal type ID (equal to the IDs of the corresponding weapons)
- x: current x position on map (in pixels)
- y: current y position on map (in pixels)
- dir: current flight direction
- rot: current rotation angle (just for the visual effect)
- flydist: distance in pixel this projectile will fly (relevant for flying projectiles)
- time: countdown in seconds until object will be removed (relevant for ground projectiles)
Note: Projectiles are managed in two lists: "flying" and "ground"! "flying" holds all projectiles which are currently flying. "ground" holds the projectiles which are idle on the ground.
Note: Projectiles in the ground list never move even if their values (like "flydist") might indicate something else!
Note: Server projectile values and actual client values can be different due to internet lag and latency!
Note: There is no projectile(0,"table") as it is common for comparable commands! Use the command "projectilelist" instead!
Attention: There can be multiple projectiles with the same ID (each player has its own projectile ID-space)! That's why you have to specify the ID and the player because only the combination of those two values is unique and therefore suited to address a certain unique projectile