Raised This Month: $51 Target: $400
 12% 

Dead ALL Talk


Post New Thread Reply   
 
Thread Tools Display Modes
fatal_nl
Member
Join Date: Apr 2017
Old 05-14-2017 , 15:04   Re: Dead ALL Talk
Reply With Quote #11

I think this one works (almost) exactly as I wanted! Need to do a few more tests when I have some friends around on Steam. Thank you JusTGo!

Where exactly do I put the client_print and sound? I got some errors while compiling with that.

Is it also possible that dead or spectating admins are still allowed to use the mic? I didn't think about that when I initially posted this plugin request. Admin level is set at ADMIN_LEVEL_G. (flag s)

Last edited by fatal_nl; 05-14-2017 at 15:09. Reason: admin flag added
fatal_nl is offline
JusTGo
Veteran Member
Join Date: Mar 2013
Old 05-14-2017 , 16:10   Re: Dead ALL Talk
Reply With Quote #12

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

#define PLUGIN "Voice"
#define AUTHOR "JustGo"
#define VERSION "0.0.1"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_forward(FM_Voice_SetClientListening"FakeMeta_Voice_SetListening"false);
    
    
set_cvar_num("sv_alltalk",1);
}

public 
FakeMeta_Voice_SetListening(iReceiveriSenderbool:bListen)
{
    if((
is_user_alive(iSender) && get_user_team(iSender) < 3) || get_user_flags(iSender) & ADMIN_LEVEL_G)
    {
        
engfunc(EngFunc_SetClientListeningiReceiveriSendertrue);
        return 
FMRES_SUPERCEDE;
    }
    
client_print(iSenderprint_center"You can't use your voice while dead.")
    
engfunc(EngFunc_SetClientListeningiReceiveriSenderfalse);
    return 
FMRES_SUPERCEDE;

__________________
JusTGo is offline
fatal_nl
Member
Join Date: Apr 2017
Old 05-14-2017 , 17:07   Re: Dead ALL Talk
Reply With Quote #13

The message "You can't use your voice while dead." got printed as soon you die and it stays there until next round. Even without using the mic.

It would be nice if it only shows up when someone press the mic key.


Edit:

I did some more tests: dead players and spectators can't hear alive players. I assume this plugin manages who can listen with FM_Voice_SetClientListening. Isn't there another (more easy) way to just hook +voicerecord when dead or in spec?

Last edited by fatal_nl; 05-14-2017 at 18:44.
fatal_nl is offline
JusTGo
Veteran Member
Join Date: Mar 2013
Old 05-15-2017 , 02:35   Re: Dead ALL Talk
Reply With Quote #14

Quote:
Originally Posted by fatal_nl View Post
The message "You can't use your voice while dead." got printed as soon you die and it stays there until next round. Even without using the mic.

It would be nice if it only shows up when someone press the mic key.


Edit:

I did some more tests: dead players and spectators can't hear alive players. I assume this plugin manages who can listen with FM_Voice_SetClientListening. Isn't there another (more easy) way to just hook +voicerecord when dead or in spec?
there is if you are using rehlds + reapi
__________________
JusTGo is offline
fatal_nl
Member
Join Date: Apr 2017
Old 05-15-2017 , 10:00   Re: Dead ALL Talk
Reply With Quote #15

4 out of 5 servers I manage are running on rehlds with reapi module installed.

I'm trying to understand the fakemeta SetClientListening function. It would be nice if it's possible to only let alive players talk on mic, while everyone (even dead or in spec) can listen. Plus client_print a message as soon a dead player or spectator use the mic.
fatal_nl is offline
JusTGo
Veteran Member
Join Date: Mar 2013
Old 05-15-2017 , 11:13   Re: Dead ALL Talk
Reply With Quote #16

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

#define PLUGIN "Voice"
#define AUTHOR "JustGo"
#define VERSION "0.0.1"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_forward(FM_Voice_SetClientListening"FakeMeta_Voice_SetListening"false);
    
    
set_cvar_num("sv_alltalk",1);
}

public 
FakeMeta_Voice_SetListening(iReceiveriSenderbool:bListen)
{
    if((
is_user_alive(iSender) && (get_user_team(iSender) < 3)) || get_user_flags(iSender) & ADMIN_LEVEL_G)
    {
        
engfunc(EngFunc_SetClientListeningiReceiveriSendertrue);
        return 
FMRES_SUPERCEDE;
    }
    
engfunc(EngFunc_SetClientListeningiReceiveriSenderfalse);
    return 
FMRES_SUPERCEDE;

for printing the message i guess it can't be done in this forward.
__________________
JusTGo is offline
fatal_nl
Member
Join Date: Apr 2017
Old 05-15-2017 , 11:53   Re: Dead ALL Talk
Reply With Quote #17

Thank you JusTGo.

Isn't it the same code as before without the client_print? I did some tests with it yesterday and people in spectator can't hear alive players.

Is it possible to print a message to dead players or spectators when they press the mic button with ReAPI?
fatal_nl is offline
JusTGo
Veteran Member
Join Date: Mar 2013
Old 05-15-2017 , 14:05   Re: Dead ALL Talk
Reply With Quote #18

yes, you should have both reapi + vtc (last version) installed and then you have these 2 forwards :

PHP Code:
/*
* Called when player started talking
*
* @param index        Client index
* @noreturn
*/
forward VTC_OnClientStartSpeak(const index);

/*
* Called when player stopped talking
*
* @param index        Client index
* @noreturn
*/
forward VTC_OnClientStopSpeak(const index); 
__________________
JusTGo is offline
fatal_nl
Member
Join Date: Apr 2017
Old 05-15-2017 , 15:27   Re: Dead ALL Talk
Reply With Quote #19

From meta list:

ReAPI, v5.1.0.110-dev, 2017-05-02
VoiceTranscoder, v2017 RC2, 2017.02.03

I still have no clue how to start and stop these forwards. Does it need to be reset every round start?
fatal_nl is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 05-15-2017 , 20:59   Re: Dead ALL Talk
Reply With Quote #20

Quote:
Originally Posted by fatal_nl View Post
Sorry for bumping this old topic.

I need a stripped down version of the Exolent[jNr]'s code. None of the other plugins on this website (not even ConnorMcLeod's plugin) does the following:

(Keep in mind sv_alltalk is on)

Currently every player, dead or alive can hear each other. We have to enforce a rule in the server that the dead don't talk..

What plugin I want: alive CT's and T's can talk with each other. As soon a player dies they are unable to use their mic until next round. (same for spectators: they can't use their mic unless they're joining a team)

When a dead player or spectator try to talk, client_print a message and play a default sound. (from valve/sound library).
You can use Connor's plugin for this.
Take a look at this
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.

Last edited by wickedd; 05-15-2017 at 21:00.
wickedd 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 06:54.


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