AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Print a message when player starts using +voicerecord (https://forums.alliedmods.net/showthread.php?t=317671)

Adomaz1 07-23-2019 14:26

Print a message when player starts using +voicerecord
 
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.

iceeedr 07-23-2019 15:52

Re: Print a message when player starts using +voicerecord
 
https://www.amxmodx.org/api/amxmodx/client_print_color

Natsheh 07-23-2019 17:34

Re: Print a message when player starts using +voicerecord
 
Use hudmessage instead with delay

JocAnis 07-24-2019 02:27

Re: Print a message when player starts using +voicerecord
 
Or simply, bool with get_gametime ?

Krtola 07-24-2019 05:55

Re: Print a message when player starts using +voicerecord
 
You can not achieve this in this way.
Try with opheu.
Look here
https://forums.alliedmods.net/showthread.php?t=138497

Adomaz1 07-24-2019 06:09

Re: Print a message when player starts using +voicerecord
 
Thank you everyone. Will try to do it with orpheu. :)

Natsheh 07-24-2019 11:14

Re: Print a message when player starts using +voicerecord
 
Quote:

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


Yes , he can.

Krtola 07-24-2019 11:49

Re: Print a message when player starts using +voicerecord
 
Quote:

Originally Posted by Natsheh (Post 2660415)
Yes , he can.


Then show us how.
Im sure this can be done only with orpheu.

EFFx 07-24-2019 18:43

Re: Print a message when player starts using +voicerecord
 
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.

Krtola 07-25-2019 03:49

Re: Print a message when player starts using +voicerecord
 
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".


All times are GMT -4. The time now is 17:29.

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