Counter-Strike: Source/Scripting/Script Functions/Constants

From Valve Developer Community
Jump to navigation Jump to search
VScript

Unofficial constants

Note.pngNote:The following constants are not included in the VScript API, but these might still be useful for reference. Define these manually as constants in the scripts' global scope.

Hostages

Name Value Notes
MAX_HOSTAGES 12 Soft limit, but exceeding it causes the game to crash if bots are enabled.
MAX_HOSTAGE_RESCUES 4 Soft limit, only affects minimap.

Player classes

See also #PLAYER_CLASS.

Name Value
FIRST_T_CLASS 1
LAST_T_CLASS 4
FIRST_CT_CLASS 5
LAST_CT_CLASS 8

Unofficial enums

Note.pngNote:The following enums are not included in the VScript API, but these might still be useful for reference. Define these manually as constants in the scripts' global scope.

PLAYER_CLASS

This is the m_iClass NetProp on player.

Name Value
CS_CLASS_NONE 0
CS_CLASS_PHOENIX_CONNNECTION 1
CS_CLASS_L337_KREW 2
CS_CLASS_ARCTIC_AVENGERS 3
CS_CLASS_GUERILLA_WARFARE 4
CS_CLASS_SEAL_TEAM_6 5
CS_CLASS_GSG_9 6
CS_CLASS_SAS 7
CS_CLASS_GIGN 8
CS_NUM_CLASSES 9

PLAYER_STATE

This is the m_iPlayerState NetProp on player.

Name Value
STATE_ACTIVE 0
STATE_WELCOME 1
STATE_PICKINGTEAM 2
STATE_PICKINGCLASS 3
STATE_DEATH_ANIM 4
STATE_DEATH_WAIT_FOR_KEY 5
STATE_OBSERVER_MODE 6
NUM_PLAYER_STATES 7

MVP_REASON

This is used with the round_mvp GameEvent.

Name Value
CSMVP_UNDEFINED 0
CSMVP_ELIMINATION 1
CSMVP_BOMBPLANT 2
CSMVP_BOMBDEFUSE 3
CSMVP_HOSTAGERESCUE 4

ROUND_END_REASON

These are used with the round_end GameEvent, as well as the FireWinCondition input for info_map_parameters. See the latter's page for which reasons result in which team winning.

Name Value
Invalid_Round_End_Reason -1
Target_Bombed 0
VIP_Escaped 1
VIP_Assassinated 2
Terrorists_Escaped 3
CTs_PreventEscape 4
Escaping_Terrorists_Neutralized 5
Bomb_Defused 6
CTs_Win 7
Terrorists_Win 8
Round_Draw 9
All_Hostages_Rescued 10
Target_Saved 11
Hostages_Not_Rescued 12
Terrorists_Not_Escaped 13
VIP_Not_Escaped 14
Game_Commencing 15
RoundEndReason_Count 16