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

Annotation of /hlss_blocker.sma

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (view) (download)

1 : ian 1 /*
2 :     *===============================================================================
3 :     * HLSS Blocker v0.1
4 :     * Created by Don Juan-jello
5 :     * http://www.jello-net.com
6 :     * For AMXX 1.71
7 :     * 5/21/2005 4:22:27 AM
8 :     *===============================================================================
9 :     */
10 :    
11 :     /*
12 :     *Cvars:
13 :     * voice_inputfromfile
14 :     * voice_forcemicrecord
15 :     */
16 :    
17 :     #include <amxmodx>
18 :    
19 :     #define VERSION "0.1"
20 :    
21 :     new p_enabled
22 :    
23 :     public hlss_query( )
24 :     {
25 :     if( get_pcvar_num( p_enabled ) )
26 :     {
27 :     new clnt[32], num
28 :     get_players( clnt, num, "c" )
29 :     for( new i = 0; i < num; i++ )
30 :     {
31 :     query_client_cvar( clnt[i], "voice_inputfromfile", "hlss_block" )
32 :     query_client_cvar( clnt[i], "voice_forcemicrecord", "hlss_block" )
33 :     }
34 :     }
35 :     return PLUGIN_HANDLED
36 :     }
37 :    
38 :     public hlss_block( id, cvar[], value[] )
39 :     {
40 :     if( get_pcvar_num( p_enabled ) > 0 )
41 :     {
42 :     new intval = str_to_num( value )
43 :     if( equal( cvar, "voice_inputfromfile" ) && intval != 0 )
44 :     {
45 :     client_cmd( id, "voice_inputfromfile 0" )
46 :     client_cmd( id, "-voicerecord" )
47 :     }
48 :     if( equal( cvar, "voice_forcemicrecord" ) && intval != 1 )
49 :     {
50 :     client_cmd( id, "voice_forcemicrecord 1" )
51 :     client_cmd( id, "-voicerecord" )
52 :     }
53 :     }
54 :     return PLUGIN_HANDLED
55 :     }
56 :    
57 :     public plugin_init( )
58 :     {
59 :     register_plugin( "HLSS Blocker", VERSION, "Ian Cammarata" )
60 :     register_cvar( "HLSS Blocker", VERSION, FCVAR_SERVER )
61 :    
62 :     p_enabled = register_cvar( "amx_block_hlss", "1" )
63 :    
64 :     set_task( 1.0, "hlss_query",_,_,_,"b" )
65 :    
66 :     return PLUGIN_CONTINUE
67 :     }

Contact
ViewVC Help
Powered by ViewVC 1.0.4