Raised This Month: $40 Target: $400
 10% 

[L4D/L4D2/CS:GO] VoiceHook


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Accelerator74
AlliedModders Donor
Join Date: Dec 2010
Location: Russia
Old 02-18-2016 , 11:18   [L4D/L4D2/CS:GO] VoiceHook
Reply With Quote #1

This extension adds a function of capture events the player who at the moment speak.

Example to use:
Code:
#include <sourcemod>

forward OnClientSpeaking(client);

public Extension:__ext_voice = 
{
	name = "VoiceHook",
	file = "VoiceHook.ext",
	autoload = 1,
	required = 1,
}

bool ClientSpeaking[MAXPLAYERS+1];
int iCount;
char SpeakingPlayers[128];

public void OnPluginStart()
{
	CreateTimer(0.7, UpdateSpeaking, _, TIMER_REPEAT);
}

public OnClientSpeaking(client)
{
	ClientSpeaking[client] = true;
}

public Action UpdateSpeaking(Handle timer)
{
	iCount = 0;
	SpeakingPlayers[0] = '\0';
	for (int i = 1; i <= MaxClients; i++)
	{
		if (ClientSpeaking[i])
		{
			if (!IsClientInGame(i)) continue;
			
			Format(SpeakingPlayers, sizeof(SpeakingPlayers), "%s\n%N", SpeakingPlayers, i);
			iCount++;
		}
		ClientSpeaking[i] = false;
	}
	if (iCount > 0)
	{
		for (int i = 1; i <= MaxClients; i++)
		{
			PrintCenterText(i, "Players Speaking:%s", SpeakingPlayers);
		}
	}
}
https://github.com/Accelerator74/VoiceHook

Last edited by Accelerator74; 12-25-2016 at 05:48.
Accelerator74 is offline
Send a message via ICQ to Accelerator74
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 02-18-2016 , 12:13   Re: [L4D/L4D2/CS:GO] VoiceHook
Reply With Quote #2

This plugin does the same that your extension -> https://forums.alliedmods.net/showthread.php?t=245384

And now I updated the gamedata for update support for L4D and L4D2 -> https://forums.alliedmods.net/showpo...5&postcount=47
__________________
Veteran SourceMod Coder
Taking paid requests -> Add me in TELEGRAM or STEAM
You like my work? donate me

Franc1sco is offline
Send a message via MSN to Franc1sco Send a message via Skype™ to Franc1sco
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:55.


Powered by vBulletin®
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Theme made by Freecode