Commands/Lua

Reference for console commands, Lua hooks and Lua commands in CS2D.

CS2D Command CS2D Console Commands

Lua Hook Lua Hooks

Lua Hook startround_prespawn

Categories

Parameters

  • mode: start/end mode id

Info

Whenever a new round begins (before actually spawning all players).

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: Hook order when starting a new round is:

Attention: This hook is executed BEFORE spawning all players! Do NOT use the player positions and other player values in this hook! They will be changed by the game afterwards!

Attention: This hook can lead to problems with certain commands due to its early execution (especially when playing online). This is because many things will actually be initialized by the game AFTER calling this hook. Try to execute problematic commands later (in another hook or delayed with a timer) in case they do not work properly. Especially commands which change players/hostages/NPCs/items/entities might be affected.

Return Values

none - related action(s) [if there are any] performed by CS2D cannot be altered/omitted

Lua Command Lua Commands