/* The Evasion Version 2.0 Script
by Outerbeast */
#include "anti_rush"

#include "beast/checkpoint_spawner"
#include "beast/game_hudsprite"
#include "beast/monster_protector"

//#include "opfor/nvision"
#include "opfor/weapon_knife"

const bool blAntiRushEnabled = false; // You can change this to have AntiRush mode enabled or disabled
const float flSurvivalVoteAllow = g_EngineFuncs.CVarGetFloat( "mp_survival_voteallow" );

void MapInit()
{
	// Register Opposing Force knife weapon
	RegisterKnife();
	// Register AntiRush(if AntiRush mode is enabled)
	//ANTI_RUSH::EntityRegister( blAntiRushEnabled );
	// Global CVars
	g_EngineFuncs.CVarSetFloat( "mp_hevsuit_voice", 0 );

	if( g_Engine.mapname == "evasion_1" )
	{
		g_SurvivalMode.SetStartOn( false );

		if( flSurvivalVoteAllow > 0 )
			g_EngineFuncs.CVarSetFloat( "mp_survival_voteallow", 0 );
	}

	g_EngineFuncs.ServerPrint( "The Evasion Version 2.0 by Forsete - Download this campaign from scmapdb.com\n" );
}
// Trigger Script for Survival Mode
void TurnOnSurvival(CBaseEntity@ pActivator, CBaseEntity@ pCaller, USE_TYPE useType, float flValue)
{
	g_EngineFuncs.CVarSetFloat( "mp_survival_voteallow", flSurvivalVoteAllow ); // Revert to the original cvar setting as per server

	if( g_SurvivalMode.IsEnabled() && g_SurvivalMode.MapSupportEnabled() && !g_SurvivalMode.IsActive() )
		g_SurvivalMode.Activate( true );
}
