mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-09-19 20:16:10 +08:00
Added original SDK code for Alien Swarm.
This commit is contained in:
51
game/shared/gamevars_shared.cpp
Normal file
51
game/shared/gamevars_shared.cpp
Normal file
@ -0,0 +1,51 @@
|
||||
//========= Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
#include "cbase.h"
|
||||
#include "gamevars_shared.h"
|
||||
|
||||
// memdbgon must be the last include file in a .cpp file!!!
|
||||
#include "tier0/memdbgon.h"
|
||||
|
||||
#ifdef GAME_DLL
|
||||
void MPForceCameraCallback( IConVar *var, const char *pOldString, float flOldValue )
|
||||
{
|
||||
if ( mp_forcecamera.GetInt() < OBS_ALLOW_ALL || mp_forcecamera.GetInt() >= OBS_ALLOW_NUM_MODES )
|
||||
{
|
||||
mp_forcecamera.SetValue( OBS_ALLOW_TEAM );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// some shared cvars used by game rules
|
||||
ConVar mp_forcecamera(
|
||||
"mp_forcecamera",
|
||||
"1",
|
||||
FCVAR_REPLICATED,
|
||||
"Restricts spectator modes for dead players"
|
||||
#ifdef GAME_DLL
|
||||
, MPForceCameraCallback
|
||||
#endif
|
||||
);
|
||||
|
||||
ConVar mp_allowspectators(
|
||||
"mp_allowspectators",
|
||||
"1.0",
|
||||
FCVAR_REPLICATED,
|
||||
"toggles whether the server allows spectator mode or not" );
|
||||
|
||||
ConVar friendlyfire(
|
||||
"mp_friendlyfire",
|
||||
"0",
|
||||
FCVAR_REPLICATED | FCVAR_NOTIFY,
|
||||
"Allows team members to injure other members of their team"
|
||||
);
|
||||
|
||||
ConVar mp_fadetoblack(
|
||||
"mp_fadetoblack",
|
||||
"0",
|
||||
FCVAR_REPLICATED | FCVAR_NOTIFY,
|
||||
"fade a player's screen to black when he dies" );
|
Reference in New Issue
Block a user