Raised This Month: $95 Target: $400
 23% 

Print a message when player starts using +voicerecord


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Adomaz1
Senior Member
Join Date: Feb 2014
Old 07-23-2019 , 15:26   Print a message when player starts using +voicerecord
Reply With Quote #1

Is it possible to print a message to a player when he starts using +voicerecord? I tried to do this with FM_Voice_SetClientListening, but it didn't work, just started spamming the chat.

Code, if needed:
Code:
#include <amxmodx>
#include <fakemeta>

public plugin_init()
{
	register_dictionary("voice.txt");
	register_forward(FM_Voice_SetClientListening, "FwdVoiceSetClientListening");
}

public FwdVoiceSetClientListening(iReceiver, iSender, bool: bListen)
{
	if(iReceiver == iSender)
		return FMRES_SUPERCEDE;

	client_print_color(iSender, iSender, "%L", iSender, "VOICE_WARN");
    
	return FMRES_IGNORED;
}
Thank you.

Last edited by Adomaz1; 07-23-2019 at 15:28.
Adomaz1 is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 07-23-2019 , 16:52   Re: Print a message when player starts using +voicerecord
Reply With Quote #2

https://www.amxmodx.org/api/amxmodx/client_print_color
__________________
iceeedr is offline
Send a message via Skype™ to iceeedr
Natsheh
Veteran Member
Join Date: Sep 2012
Location: Muslim and proud!
Old 07-23-2019 , 18:34   Re: Print a message when player starts using +voicerecord
Reply With Quote #3

Use hudmessage instead with delay
__________________
@Jailbreak MOD [Alot of features + API] 100% done !
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
JocAnis
Veteran Member
Join Date: Jun 2010
Old 07-24-2019 , 03:27   Re: Print a message when player starts using +voicerecord
Reply With Quote #4

Or simply, bool with get_gametime ?
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...)

Quote:
Originally Posted by xRENN1Ex View Post
I'm sorry, I can't try but I didn't
JocAnis is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 07-24-2019 , 06:55   Re: Print a message when player starts using +voicerecord
Reply With Quote #5

You can not achieve this in this way.
Try with opheu.
Look here
https://forums.alliedmods.net/showthread.php?t=138497
__________________
Check my new Zombie Mod (2019)
Look at the video below to see gameplay

https://www.youtube.com/watch?v=U4mf9obA6x0
Krtola is offline
Send a message via Skype™ to Krtola
Adomaz1
Senior Member
Join Date: Feb 2014
Old 07-24-2019 , 07:09   Re: Print a message when player starts using +voicerecord
Reply With Quote #6

Thank you everyone. Will try to do it with orpheu.
Adomaz1 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Location: Muslim and proud!
Old 07-24-2019 , 12:14   Re: Print a message when player starts using +voicerecord
Reply With Quote #7

Quote:
Originally Posted by Krtola View Post
You can not achieve this in this way.
Try with opheu.
Look here
https://forums.alliedmods.net/showthread.php?t=138497

Yes , he can.
__________________
@Jailbreak MOD [Alot of features + API] 100% done !
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 07-24-2019 , 12:49   Re: Print a message when player starts using +voicerecord
Reply With Quote #8

Quote:
Originally Posted by Natsheh View Post
Yes , he can.

Then show us how.
Im sure this can be done only with orpheu.
__________________
Check my new Zombie Mod (2019)
Look at the video below to see gameplay

https://www.youtube.com/watch?v=U4mf9obA6x0

Last edited by Krtola; 07-24-2019 at 12:50.
Krtola is offline
Send a message via Skype™ to Krtola
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 07-24-2019 , 19:43   Re: Print a message when player starts using +voicerecord
Reply With Quote #9

The forward you are using is called every 0.3 seconds + (playersNum * maxPlayers), you need to add a delay with get_systime or get_gametime.
__________________
EFFx is offline
Send a message via Skype™ to EFFx
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 07-25-2019 , 04:49   Re: Print a message when player starts using +voicerecord
Reply With Quote #10

First test,then post something.
He need plugin which will send msg only when player press button for voice( default K ) .
This forward here send msg all the time, no matter if u have push "K" or not.
That's why I say first test then try to "help".
__________________
Check my new Zombie Mod (2019)
Look at the video below to see gameplay

https://www.youtube.com/watch?v=U4mf9obA6x0
Krtola is offline
Send a message via Skype™ to Krtola
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 11:20.


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