AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Microphone Restrictions 1.2 (https://forums.alliedmods.net/showthread.php?t=73609)

Jon 07-02-2008 17:15

Microphone Restrictions 1.2
 
1 Attachment(s)
Microphone Restrictions

Purpose:

Ever felt pissed when 10 players use their microphone at the same time? When this plugin is activated only a certain amount of players can use microphone at the same time, using a client command first to activate his/her microphone for use. This is a great plugin when someone wants to play music using HLSS or similar. You can also switch on admin only mode, then only admins can use their microphone (without the use of /mic).


Cvars:

mic_enabled 1

- 0 disables the plugin, 1 enables it.
mic_max 5
- Sets maximum amount of players that can use their mic at the same time.
mic_adminonly 0
- 0 disables admin only, 1 enables it.
mic_banplayer <player>
- Bans seperate players from using their microphone.
mic_time 60
- How long players get to use their microphone each time in seconds.
mic_delay 120
- How long players have to wait before they can use their microphone again.
mic_autocvars 1
- If set to 1, plugin automatically changes server cvars for better voicequality.


Client Commands:

/mic
- Activate microphone


Notes:

The voiceicon will still be visible when players attempt to use their microphone without using /mic command first, but the other players can't hear them.

Quote:

1.1 - 1.2
Rewrote the whole plugin and made it much more simple
Added mic_max cvar

Exolent[jNr] 07-02-2008 17:30

Re: Microphone Restrictions 1.0
 
Quote:

Originally Posted by Jon (Post 646941)
Notes:
I didn't find any more efficent way to do this, if there is one, please tell me.


PHP Code:

public plugin_init()
{
    
register_forward(FM_Voice_SetClientListening"fwdSetVoice"0);
}

public 
fwdSetVoice(receiversender)
{
    if( !
is_user_connected(receiver)
    || !
is_user_connected(sender)
    || 
receiver == sender )
    {
        return 
FMRES_IGNORED;
    }
    
    if( 
/* sender cannot talk */ )
    {
        
engfunc(EngFunc_SetClientListeningreceiversender0);
        return 
FMRES_SUPERCEDE;
    }
    
    return 
FMRES_IGNORED;



Jon 07-03-2008 10:01

Re: Microphone Restrictions 1.0
 
Thanks, updated :)

AntiBots 07-03-2008 12:36

Re: Microphone Restrictions 1.0
 
Good Idea. Now I test. :D

bmann_420 07-03-2008 23:48

Re: Microphone Restrictions 1.1
 
I might put the default cvars in the post (just so we all know) :D

Looks good

Zenith77 07-05-2008 14:37

Re: Microphone Restrictions 1.1
 
You should make a cvar so server administrators can change how many people they want to be able to speak at a time, not just hardcode it to one.

Stixsmaster 07-06-2008 18:03

Re: Microphone Restrictions 1.1
 
anyway to edit this so this also restricts normal users from being able to use a mic and makes it so only admins may use mics?

---Stixsmaster

Jon 07-06-2008 18:15

Re: Microphone Restrictions 1.1
 
Quote:

Originally Posted by Zenith77 (Post 648244)
You should make a cvar so server administrators can change how many people they want to be able to speak at a time, not just hardcode it to one.

Agreed. I will.

Quote:

Originally Posted by Stixsmaster (Post 648766)
anyway to edit this so this also restricts normal users from being able to use a mic and makes it so only admins may use mics?

---Stixsmaster

mic_adminmode 1

Jon 07-16-2008 16:03

Re: Microphone Restrictions 1.2
 
Updated, check main post.

grimvh2 07-17-2008 10:38

Re: Microphone Restrictions 1.2
 
Nice , I like this :D


All times are GMT -4. The time now is 13:10.

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