Thread: HLSS Block
View Single Post
Plugin Info:     Modification:          Category:          Approver:   Zenith77 (33)
v13ttweaker
Member
Join Date: May 2007
Location: Honolulu, HI
Old 01-27-2008 , 05:04   HLSS Block
Reply With Quote #1

Some plugin I found that just blocks people from playing music over HLSS or something. Thought it might be useful for somepeople who don't like others spamming music on their server.

Code:
/*
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
}
Attached Files
File Type: sma Get Plugin or Get Source (hlss_blocker.sma - 3406 views - 2.2 KB)
__________________



Check Out My Forums!
http://www.setbb.com/azngamerz

Last edited by Brad; 01-30-2008 at 17:08.
v13ttweaker is offline
Send a message via AIM to v13ttweaker