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

Annotation of /hlss_blocker.sma

Parent Directory Parent Directory | Revision Log Revision Log


Revision 25 - (view) (download)

1 : ian 1 /*
2 : ian 25 HLSS Blocker v0.1
3 :     Copyright (C) 2005-2007 Ian (Juan) Cammarata
4 :    
5 :     This program is free software: you can redistribute it and/or modify
6 :     it under the terms of the GNU Affero General Public License as
7 :     published by the Free Software Foundation, either version 3 of the
8 :     License, or (at your option) any later version.
9 :    
10 :     This program is distributed in the hope that it will be useful,
11 :     but WITHOUT ANY WARRANTY; without even the implied warranty of
12 :     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 :     GNU Affero General Public License for more details.
14 :    
15 :     You should have received a copy of the GNU Affero General Public License
16 :     along with this program. If not, see <http://www.gnu.org/licenses/>.
17 :     --------------------------------------------------------------------------------
18 :    
19 :     http://ian.cammarata.us
20 :     For AMXX 1.71 or higher
21 : ian 1 */
22 :    
23 :     /*
24 :     *Cvars:
25 :     * voice_inputfromfile
26 :     * voice_forcemicrecord
27 :     */
28 :    
29 :     #include <amxmodx>
30 :    
31 :     #define VERSION "0.1"
32 :    
33 :     new p_enabled
34 :    
35 :     public hlss_query( )
36 :     {
37 :     if( get_pcvar_num( p_enabled ) )
38 :     {
39 :     new clnt[32], num
40 :     get_players( clnt, num, "c" )
41 :     for( new i = 0; i < num; i++ )
42 :     {
43 :     query_client_cvar( clnt[i], "voice_inputfromfile", "hlss_block" )
44 :     query_client_cvar( clnt[i], "voice_forcemicrecord", "hlss_block" )
45 :     }
46 :     }
47 :     return PLUGIN_HANDLED
48 :     }
49 :    
50 :     public hlss_block( id, cvar[], value[] )
51 :     {
52 :     if( get_pcvar_num( p_enabled ) > 0 )
53 :     {
54 :     new intval = str_to_num( value )
55 :     if( equal( cvar, "voice_inputfromfile" ) && intval != 0 )
56 :     {
57 :     client_cmd( id, "voice_inputfromfile 0" )
58 :     client_cmd( id, "-voicerecord" )
59 :     }
60 :     if( equal( cvar, "voice_forcemicrecord" ) && intval != 1 )
61 :     {
62 :     client_cmd( id, "voice_forcemicrecord 1" )
63 :     client_cmd( id, "-voicerecord" )
64 :     }
65 :     }
66 :     return PLUGIN_HANDLED
67 :     }
68 :    
69 :     public plugin_init( )
70 :     {
71 :     register_plugin( "HLSS Blocker", VERSION, "Ian Cammarata" )
72 :     register_cvar( "HLSS Blocker", VERSION, FCVAR_SERVER )
73 :    
74 :     p_enabled = register_cvar( "amx_block_hlss", "1" )
75 :    
76 :     set_task( 1.0, "hlss_query",_,_,_,"b" )
77 :    
78 :     return PLUGIN_CONTINUE
79 :     }

Contact
ViewVC Help
Powered by ViewVC 1.0.4