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
imagehitzoneCategories
Parameters
- id
- mode
- [x-offset] (optional)
- [y-offset] (optional)
- [width] (optional)
- [height] (optional)
Info
Adds, removes or modifies a hit zone for an image which reacts to shots/attacks
Each hit zone will trigger the hitzone-hook when it is hit by a shot/attack.
Available modes are:
Non-Blocking Modes (<=100, shots will pass through)
- 0 - no hit zone (this removes existing hit zones, other parameters don't matter)
- 1 - hit zone without effects (just register)
- 2 - wall effect
- 3 - blood effect
- 4 - green blood effect
Blocking Modes (>100, shots will get stopped)
- 101 - hit zone without effects + stop shot
- 102 - wall effect + stop shot
- 103 - blood effect + stop shot
- 104 - green blood effect + stop shot
All hit zones with modes which are higher than 100 will block the shots (objects behind them will not be damaged). They basically behave like walls but they have no influence on player movement or vision.
Note: Images are normally centered. So a hit zone for a 100x100 pixel image should have the values:
x-offset: -50
y-offset: -50
width: 100
height: 100
So x-offset is commonly -width/2 and y-offset -height/2
Note: Each image can have only one hit zone. If you call imagehitzone multiple times on the same image, the existing hit zone will be modified!
Note: You can call imagehitzone with mode 0 on an image which already has a hit zone to remove the hit zone completely.
Attention: The hit zone is always rectangular without rotation. Image rotation does NOT affect the hit zone in any way.
Attention: Defining a big number of hit zones can have a bad impact on the game performance (when shooting)!
Attention: Hit zones do not work with images which are drawn as HUD (image mode 2)!
Attention: Very thin hit zones might not react properly to all shots. A minimum width/height of 10 pixels is recommended!
Categories
Parameters
- id
- mode
- [x-offset] (optional)
- [y-offset] (optional)
- [width] (optional)
- [height] (optional)
Info
Adds, removes or modifies a hit zone for an image which reacts to shots/attacks
Each hit zone will trigger the hitzone-hook when it is hit by a shot/attack.
Available modes are:
Non-Blocking Modes (<=100, shots will pass through)
Blocking Modes (>100, shots will get stopped)
All hit zones with modes which are higher than 100 will block the shots (objects behind them will not be damaged). They basically behave like walls but they have no influence on player movement or vision.
Each hit zone will trigger the hitzone-hook when it is hit by a shot/attack.
Available modes are:
Non-Blocking Modes (<=100, shots will pass through)
- 0 - no hit zone (this removes existing hit zones, other parameters don't matter)
- 1 - hit zone without effects (just register)
- 2 - wall effect
- 3 - blood effect
- 4 - green blood effect
Blocking Modes (>100, shots will get stopped)
- 101 - hit zone without effects + stop shot
- 102 - wall effect + stop shot
- 103 - blood effect + stop shot
- 104 - green blood effect + stop shot
All hit zones with modes which are higher than 100 will block the shots (objects behind them will not be damaged). They basically behave like walls but they have no influence on player movement or vision.
Note: Images are normally centered. So a hit zone for a 100x100 pixel image should have the values:
x-offset: -50
y-offset: -50
width: 100
height: 100
So x-offset is commonly -width/2 and y-offset -height/2
x-offset: -50
y-offset: -50
width: 100
height: 100
So x-offset is commonly -width/2 and y-offset -height/2
Note: Each image can have only one hit zone. If you call imagehitzone multiple times on the same image, the existing hit zone will be modified!
Note: You can call imagehitzone with mode 0 on an image which already has a hit zone to remove the hit zone completely.
Attention: The hit zone is always rectangular without rotation. Image rotation does NOT affect the hit zone in any way.
Attention: Defining a big number of hit zones can have a bad impact on the game performance (when shooting)!
Attention: Hit zones do not work with images which are drawn as HUD (image mode 2)!
Attention: Very thin hit zones might not react properly to all shots. A minimum width/height of 10 pixels is recommended!