AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   HLSS Block (https://forums.alliedmods.net/showthread.php?t=66267)

v13ttweaker 01-27-2008 05:04

HLSS Block
 
1 Attachment(s)
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. :mrgreen:

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
}


Dric Laar 01-28-2008 04:09

Re: HLSS Block
 
Nice...looks pretty good...

I will test in tomarrow though, getting late now :\

EDIT: Skratch that, I tested it on my server, and it seems to work fine for me. I don't see any problems with it, but I didn't test it extensively.

Pro Patria Finland 01-30-2008 14:27

Re: HLSS Block
 
Don't include a compiled .amxx with your post, the forum will compile the .sma for you.

Brad 01-30-2008 17:09

Re: HLSS Block
 
I removed the compiled version. Like Pro Patria Finland said, do not include the compiled version.

Vm|Mayhem 01-31-2008 13:20

Re: HLSS Block
 
Nice, works nicely.

v13ttweaker 02-02-2008 20:58

Re: HLSS Block
 
Thanks.

Shad0wZ 03-09-2008 13:16

Re: HLSS Block
 
Hey,

Recently i discovered about this, but i have a question:

I'd like to block most people from using HLSS, but i'd really like to see an exception list for people who still can use HLSS.
If its not too much of work, could someone add an exception list per steam id for this script?

Thanks,
- Shad0wZ

Battousai-sama 03-21-2008 13:29

Re: HLSS Block
 
good idea shadowz, if u can put like an .ini to read from so it lets some people to play hlss (cuz some servers has official dj :])
If it is impossible, still nice work on the plugin :]

Tr3c3 03-29-2008 16:26

Re: HLSS Block
 
I wanna apologize, 'cause I'm from Argentina, so my english isn't the best you have ever seen...

The persons that don't get blocked by the plugin, probably don't use HLSS, simply they put the music on their media player software or component system.

About the idea of excluding from the block people that is the "Official DJ of the server", means to check if the player is allowed to play music on the server before each block, so I think it can be done.

Regards.

Tr3c3

v13ttweaker 03-29-2008 23:50

Re: HLSS Block
 
Actually it does detect hlss some how.


All times are GMT -4. The time now is 15:51.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.