AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How FM_Voice_SetClientListening work ? (https://forums.alliedmods.net/showthread.php?t=229558)

W12 11-09-2013 19:21

How FM_Voice_SetClientListening work ?
 
Hi everybody.
Can somebody tell me detalied how exactly FM_Voice_SetClientListening work?

When is called, who is Receiver, who is Sender and when the third param is true and when is false ?

Thanks anticipated.

fysiks 11-09-2013 20:18

Re: How FM_Voice_SetClientListening work ?
 
This page shows the format of arguments.

Google works wonders.

W12 11-09-2013 20:34

Re: How FM_Voice_SetClientListening work ?
 
I want to know how this forward exactly work.
Code:

When is called, who is Receiver, who is Sender and when the third param is true and when is false ?
I know the type of arguments...

fysiks 11-09-2013 20:40

Re: How FM_Voice_SetClientListening work ?
 
Look at existing plugins to see how you use them. To see when they are called (and the value of the parameters), hook the forward and look for yourself.

simanovich 11-10-2013 00:29

Re: How FM_Voice_SetClientListening work ?
 
Quote:

Originally Posted by fysiks (Post 2058953)
Look at existing plugins to see how you use them. To see when they are called (and the value of the parameters), hook the forward and look for yourself.

Or he just can look at the source code of fakemeta module.

From amxmodx func wiki:
Spoiler

iReceiver is who is listening.
iSender is who is sending voice.
Listen - true if listening, false if not (like iSender don't sending voice).

MPNumB 11-10-2013 00:53

Re: How FM_Voice_SetClientListening work ?
 
iSender // is the PlayerID who is talking
iReceiver // is the PlayerID who is listening
bool Listen // should listener hear what talker is saying or no

ConnorMcLeod 11-10-2013 02:29

Re: How FM_Voice_SetClientListening work ?
 
Every 0.3 seconds, this function is called playersNum * maxPlayers times.
3rd arguments notifies the engine if receiver can hear sender.
If receiver is not connected, function is not called, receiver status doesn't seem to be taken in account.
Return value is not used by game dll but engine returns 0 if sender or receiver is not in range (1 to maxplayer).

W12 11-10-2013 08:31

Re: How FM_Voice_SetClientListening work ?
 
Thank you Connor. This help me a lot.
One more question if I can:
Which is difference between FM_Voice_SetClientListening and FM_Voice_GetClientListening, also when FM_Voice_GetClientListening is called?

ConnorMcLeod 11-10-2013 09:29

Re: How FM_Voice_SetClientListening work ?
 
Get returns the actual status taken in account by the engine, i don't think it is used.

W12 11-10-2013 14:55

Re: How FM_Voice_SetClientListening work ?
 
Thank you very much Connor. :)


All times are GMT -4. The time now is 23:14.

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