[Half-Life AMXX] / hlss_blocker.sma Repository:
ViewVC logotype

View of /hlss_blocker.sma

Parent Directory Parent Directory | Revision Log Revision Log


Revision 25 - (download) (annotate)
Tue Nov 20 22:36:56 2007 UTC (13 years ago) by ian
File size: 2067 byte(s)
Applied AGPLv3 license.
/*
HLSS Blocker v0.1
Copyright (C) 2005-2007 Ian (Juan) Cammarata

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------------

http://ian.cammarata.us
For AMXX 1.71 or higher
*/

/*
*Cvars:
* voice_inputfromfile
* voice_forcemicrecord
*/

#include <amxmodx>

#define VERSION "0.1"

new p_enabled

public hlss_query( )
{
	if( get_pcvar_num( p_enabled ) )
	{
		new clnt[32], num
		get_players( clnt, num, "c" )
		for( new i = 0; i < num; i++ )
		{
			query_client_cvar( clnt[i], "voice_inputfromfile", "hlss_block" )
			query_client_cvar( clnt[i], "voice_forcemicrecord", "hlss_block" )
		}
	}
	return PLUGIN_HANDLED
}

public hlss_block( id, cvar[], value[] )
{
	if( get_pcvar_num( p_enabled ) > 0 )
	{
		new intval = str_to_num( value )
		if( equal( cvar, "voice_inputfromfile" ) && intval != 0 )
		{
			client_cmd( id, "voice_inputfromfile 0" )
			client_cmd( id, "-voicerecord" )
		}
		if( equal( cvar, "voice_forcemicrecord" ) && intval != 1 )
		{
			client_cmd( id, "voice_forcemicrecord 1" )
			client_cmd( id, "-voicerecord" )
		}
	}
	return PLUGIN_HANDLED
}
 
public plugin_init( )
{
	register_plugin( "HLSS Blocker", VERSION, "Ian Cammarata" )
	register_cvar( "HLSS Blocker", VERSION, FCVAR_SERVER )
	
	p_enabled = register_cvar( "amx_block_hlss", "1" )
	
	set_task( 1.0, "hlss_query",_,_,_,"b" )
	
	return PLUGIN_CONTINUE
}

Contact
ViewVC Help
Powered by ViewVC 1.0.4