Commands/Lua
Reference for console commands, Lua hooks and Lua commands in CS2D.
- CS2D Console Commands are entered in the console, executed with key-binds, configuration (cfg) files or in Lua with parse
- Lua Hooks are used to execute Lua scripts when events occur in CS2D - 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
startround
Categories
Parameters
- mode: start/end mode id
Info
Whenever a new round begins (after spawning all players).
Possible modes
Possible modes
- 1=Terrorist win (elimination)
- 10=VIP killed (as_ maps)
- 12=VIP did not escape (as_ maps)
- 20=Bomb detonated (de_ maps)
- 30=Hostages protected (cs_ maps)
- 40=Blue flag captured (ctf_ maps)
- 50=All points dominated by T (dom_ maps)
- 60=All humans killed (Zombies! game mode)
- 2=Counter-Terrorist win (elimination)
- 11=VIP escaped (as_ maps)
- 21=Bomb defused (de_ maps)
- 22=Bombsite protected (de_ maps)
- 31=Hostages rescued (cs_ maps)
- 41=Red flag captured (ctf_ maps)
- 51=All points dominated by CT (dom_ maps)
- 61=Survivors survived (Zombies! game mode)
- 3=Round draw
- 4=Game commencing
- 5=Round restart
Note: This hook is executed AFTER spawning all players! So you CAN use the player positions and other values in this hook!
Note: In most cases (but not necessarily all) the endround-hook will be triggered before this hook is triggered.
Attention: Hook order when starting a new round is:
- startround_prespawn
- spawn (once for each player)
- startround
Attention: This hook will be triggered in game modes which have rounds (Standard and Zombies!). It is not necessarily triggered in other game modes but can be triggered by entities which are map goals (domination points for example) and which lead to a win/loss and therefore a new round. It will also be triggered when using one of the commands restart / sv_restart / restartround / sv_restartround (in all game modes, mode-parameter will be 5 then).
Return Values
none - related action(s) [if there are any] performed by CS2D cannot be altered/omitted