Raised This Month: $ Target: $400
 0% 

catching player using voice


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
aaarnas
Veteran Member
Join Date: Jun 2008
Location: Lithuania
Old 03-06-2010 , 07:12   catching player using voice
Reply With Quote #1

Hello. Is it possible, to catch, when player is speaking with his microphone?
I need to set time to pcvar, when he doing it.
aaarnas is offline
Kryzu
Senior Member
Join Date: Feb 2009
Old 03-06-2010 , 10:02   Re: catching player using voice
Reply With Quote #2

Use search:
http://forums.alliedmods.net/showthr...&highlight=mic
__________________
Kryzu is offline
aaarnas
Veteran Member
Join Date: Jun 2008
Location: Lithuania
Old 03-10-2010 , 08:14   Re: catching player using voice
Reply With Quote #3

I knew about this, bus couldn't realise how to use it.

I need to get when player push speak button or speaking at the moment. That only checks players speak flags.
aaarnas is offline
Old 03-10-2010, 08:49
Bugsy
This message has been deleted by Bugsy. Reason: delete
worldspawn
Senior Member
Join Date: Aug 2009
Location: Russia, Yekaterinburg
Old 03-10-2010 , 13:18   Re: catching player using voice
Reply With Quote #4

http://forums.alliedmods.net/showthread.php?t=89409
if_it_can_help
worldspawn is offline
Send a message via ICQ to worldspawn Send a message via Skype™ to worldspawn
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-10-2010 , 13:29   Re: catching player using voice
Reply With Quote #5

Same thread as #2, and doesn't help.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
aaarnas
Veteran Member
Join Date: Jun 2008
Location: Lithuania
Old 03-10-2010 , 13:50   Re: catching player using voice
Reply With Quote #6

I was found a better tutorial about that, but this isn't what I need. I think it isn't possible to do.

Or maybe is possible to catch that icon, witch appear when player is talking ?
aaarnas is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 03-10-2010 , 16:27   Re: catching player using voice
Reply With Quote #7

You can't just catch it, because it's handled client-side. I needed this before and I searched a lot, but I found nothing that could easily solve this problem.

Since server is transmitting data to clients, then it must be possible to detect it, but it probably requires messing with memory.

I found a way to detect when player press +voicerecord button (though it's not very good and clients can mess up results if they know how):
client cvar "voice_modenable" is always set to 1 when client press +voicerecord, so you can constantly query it and set it to 0 whenever query returns 1 (client just pressed +voicerecord), but I have no idea how to detect when client stops using it.
__________________
Impossible is Nothing
Sylwester is offline
Old 03-11-2010, 01:18
ConnorMcLeod
This message has been deleted by ConnorMcLeod.
aaarnas
Veteran Member
Join Date: Jun 2008
Location: Lithuania
Old 03-12-2010 , 08:11   Re: catching player using voice
Reply With Quote #8

Thats strange. get_user_info always returns me "voice_modenable" 0, what ever i set it.
aaarnas is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 03-12-2010 , 10:33   Re: catching player using voice
Reply With Quote #9

I guess the only way to do that is to force people to use a custom voicerecord command (+startvoice) and implement at FM_Voice_SetClientListening your own control.

You have to block every voice communication for users not using that command.

PHP Code:
#include <amxmodx>
#include <fakemeta>

#define get_bit(%1,%2)     ( %1 &   1 << ( %2 & 31 ) )
#define set_bit(%1,%2)    %1 |=  ( 1 << ( %2 & 31 ) )
#define clear_bit(%1,%2)    %1 &= ~( 1 << ( %2 & 31 ) )

new g_PlayerVoice

public plugin_init()
{
    
register_clcmd("+startvoice""player_startvoice_on")
    
register_clcmd("-startvoice""player_startvoice_off")

    
register_forward(FM_Voice_SetClientListenting"setclient_listening")
}

public 
player_startvoice_on(id)
{
    
set_bit(g_PlayerVoiceid)
    
client_cmd(id"+voicerecord")
    return 
PLUGIN_HANDLED
}

public 
player_startvoice_off(id)
{
    
clear_bit(g_PlayerVoiceid)
    
client_cmd(id"-voicerecord")
    return 
PLUGIN_HANDLED
}

public 
setclient_listening(receiversenderbool:listen)
{
    if(!
is_user_connected(receiver) || !is_user_connected(sender) || (receiver == sender)
      return 
FMRES_IGNORED

    
if(!get_big(g_PlayerVoicesender))
    {
        
engfunc(EngFunc_SetClientListeningreceiversenderfalse)    // Can't talk because is not using +startvoice
        
return PLUGIN_SUPERCEDE
    
}

/*
      put your code here
      you can modify bool:listen depending on what you want and then call SetClientListening + return SUPERCEDE

      To change behavior (mute, permit, etc)
          engfunc(EngFunc_SetClientListening, receiver, sender, listen)
          return FMRES_SUPERCEDE
*/

    
return FMRES_IGNORED

__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.

Last edited by joropito; 03-12-2010 at 10:36.
joropito is offline
Send a message via MSN to joropito
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 03-13-2010 , 02:44   Re: catching player using voice
Reply With Quote #10

Quote:
Originally Posted by aaarnas View Post
Thats strange. get_user_info always returns me "voice_modenable" 0, what ever i set it.
You must use query_client_cvar to get correct value.
__________________
Impossible is Nothing
Sylwester is offline
Reply



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 07:54.


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