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

View of /hlss_blocker.sma

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (download) (annotate)
Tue Oct 30 09:08:11 2007 UTC (16 years, 5 months ago) by ian
File size: 1504 byte(s)
/*
*===============================================================================
*	HLSS Blocker v0.1
*	Created by Don Juan-jello
*	http://www.jello-net.com
*	For AMXX 1.71
*	5/21/2005 4:22:27 AM
*===============================================================================
*/

/*
*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