
-- 	MISC FUNCTIONS/DEFINITIONS





-- Used to make the PrintMessageAll and PrintMessage functions more readable

	HUD_PRINTNOTIFY		=	1
	HUD_PRINTCONSOLE	=	2
	HUD_PRINTTALK		=	3
	HUD_PRINTCENTER		=	4



-- When a player doesn't have a model this is reported as their model
-- YOU SHOULD NEVER CHANGE THIS VALUE IT'S JUST USED AS A MACRO SO WE
-- DON'T HAVE TO TYPE OUT THE FILENAME ALL THE TIME!

	DEFAULT_PLAYER_MODEL =	"models/player.mdl"


-- Team names so we don't have to remember numbers


	TEAM_UNASSIGNED	=	0 -- When there are no teams all players should be this
	TEAM_SPECTATOR	=	1 -- Not used

	TEAM_BLUE		=	2
	TEAM_YELLOW		=	3
	TEAM_GREEN		=	4
	TEAM_RED		=	5
	
-- Target ID Rules  ( for use with _GameSetTargetIDRules )

	TRGTID_NOENEMYHEALTH 	= 0
	TRGTID_ENEMYHEALTH 		= 1
	TRGTID_ENEMYONLY 		= 2
	TRGTID_TEAMONLY 		= 3
	TRGTID_ALL 				= 4
	TRGTID_ALLNOHEALTH 		= 5
	TRGTID_NONE 			= 6




-- Prints current game rules to player

	function AddRule( rulename )
		
		local retstring = rulename .. ": "
		
		if ( _GetRule( rulename ) ) then
			retstring = retstring .. "TRUE"
		else
			retstring = retstring .. "FALSE"
		end
			
		retstring = retstring .. "\n"
		
		return retstring
		
	end
		
	function CC_GameRules ( fromplayer, args )
		
		--_Msg("What What\n"); -- _Msg prints to the server console, we want to message the user

		_PrintMessage( fromplayer, HUD_PRINTCONSOLE, "\nGamerules:\n" );
		_PrintMessage( fromplayer, HUD_PRINTCONSOLE, AddRule( "Teamplay" ) );
		_PrintMessage( fromplayer, HUD_PRINTCONSOLE, AddRule( "AllowTeamDamage" ));
		_PrintMessage( fromplayer, HUD_PRINTCONSOLE, AddRule( "AllowPvPDamage" ) );
		_PrintMessage( fromplayer, HUD_PRINTCONSOLE, AddRule( "AllowPlayerDamage" ) );
		_PrintMessage( fromplayer, HUD_PRINTCONSOLE, AddRule( "AllowObjectSpawning" ) );
		_PrintMessage( fromplayer, HUD_PRINTCONSOLE, AddRule( "AllowMultigun" ) );
		_PrintMessage( fromplayer, HUD_PRINTCONSOLE, AddRule( "AllowPhysgun" ) );
		_PrintMessage( fromplayer, HUD_PRINTCONSOLE, AddRule( "AllowNoClip" ) );
		_PrintMessage( fromplayer, HUD_PRINTCONSOLE, AddRule( "AllowNPCSpawn" ) );
		_PrintMessage( fromplayer, HUD_PRINTCONSOLE, AddRule( "SpawnWithAllWeapons" ) );
		_PrintMessage( fromplayer, HUD_PRINTCONSOLE, "\n" );
		
		
	end
	
	-- After making the function like above you need to register the console command
	-- so that it can receive messages from the engine. You do this using the function below
	-- The first parameter is the name of the console command, the second is the name of the function to
	-- call when the engine gets that command.
	CONCOMMAND( "gamerules", CC_GameRules )
	
	
	
	
	
	
	
	

  
