Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #include "cbase.h"
  8. #include "gamevars_shared.h"
  9. // memdbgon must be the last include file in a .cpp file!!!
  10. #include "tier0/memdbgon.h"
  11. #ifdef GAME_DLL
  12. void MPForceCameraCallback( IConVar *var, const char *pOldString, float flOldValue )
  13. {
  14. if ( mp_forcecamera.GetInt() < OBS_ALLOW_ALL || mp_forcecamera.GetInt() >= OBS_ALLOW_NUM_MODES )
  15. {
  16. mp_forcecamera.SetValue( OBS_ALLOW_TEAM );
  17. }
  18. }
  19. #endif
  20. // some shared cvars used by game rules
  21. ConVar mp_forcecamera(
  22. "mp_forcecamera",
  23. #ifdef CSTRIKE
  24. "0",
  25. #else
  26. "1",
  27. #endif
  28. FCVAR_REPLICATED,
  29. "Restricts spectator modes for dead players"
  30. #ifdef GAME_DLL
  31. , MPForceCameraCallback
  32. #endif
  33. );
  34. ConVar mp_allowspectators(
  35. "mp_allowspectators",
  36. "1.0",
  37. FCVAR_REPLICATED,
  38. "toggles whether the server allows spectator mode or not" );
  39. ConVar friendlyfire(
  40. "mp_friendlyfire",
  41. "0",
  42. FCVAR_REPLICATED | FCVAR_NOTIFY,
  43. "Allows team members to injure other members of their team"
  44. );
  45. ConVar mp_fadetoblack(
  46. "mp_fadetoblack",
  47. "0",
  48. FCVAR_REPLICATED | FCVAR_NOTIFY,
  49. "fade a player's screen to black when he dies" );
  50. ConVar sv_hudhint_sound( "sv_hudhint_sound", "1", FCVAR_REPLICATED );