PDA

View Full Version : AMX TeamTalk


Wilson [29th ID]
03-10-2008, 01:25 PM
I wrote this plugin today for my server but figured you would all enjoy it as well. My server always has AllTalk on during public play, but sometimes people want to use teamwork. Teamwork + AllTalk = the enemy hearing your plans.

Now there is a bind for teamtalk. Basically, it's like turning alltalk off just for a second while you transmit your message.

bind KEY +teamtalk

Holding this button will transmit your voice to your team only.

The only cvar is amx_teamtalk <0/1>
This plugin is compatible with AMX VoiceProx (if voiceprox is enabled, this plugin is disabled).

diamond-optic
03-10-2008, 02:12 PM
ahhh great! lol

i always wanted to convert the admin voice chat plugin i have to allow team only voice chat while alltalk is on.. but since i dont have a mic i never really motivated myself

so thanks! lol this is gonna be great :)

rhodge32
05-11-2008, 07:49 AM
How did this plugin work for you guys. I wasnt so fortunate. IT just comes up in console with this...

"amx_teamtalk.amxx") (native "get_pcvar_num") - debug not enabled!
L 05/11/2008 - 19:47:11: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 05/11/2008 - 19:47:11: Invalid CVAR pointer
L 05/11/2008 - 19:47:11: [AMXX] Run time error 10 (plugin "amx_teamtalk.amxx") (native "get_pcvar_num") - debug not enabled!
L 05/11/2008 - 19:47:11: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 05/11/2008 - 19:47:11: Invalid CVAR pointer
L 05/11/2008 - 19:47:11: [AMXX] Run time error 10 (plugin "amx_teamtalk.amxx") (native "get_pcvar_num") - debug not enabled!
L 05/11/2008 - 19:47:11: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 05/11/2008 - 19:47:11: Invalid CVAR pointer
L 05/11/2008 - 19:47:11: [AMXX] Run time error 10 (plugin "amx_teamtalk.amxx") (native "get_pcvar_num") - debug not enabled!
L 05/11/2008 - 19:47:11: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 05/11/2008 - 19:47:11: Invalid CVAR pointer
L 05/11/2008 - 19:47:11: [AMXX] Run time error 10 (plugin "amx_teamtalk.amxx") (native "get_pcvar_num") - debug not enabled!
L 05/11/2008 - 19:47:11: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 05/11/2008 - 19:47:11: Invalid CVAR pointer
L 05/11/2008 - 19:47:11: [AMXX] Run time error 10 (plugin "amx_teamtalk.amxx") (native "get_pcvar_num") - debug not enabled!
L 05/11/2008 - 19:47:11: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 05/11/2008 - 19:47:11: Invalid CVAR pointer
L 05/11/2008 - 19:47:11: [AMXX] Run time error 10 (plugin "amx_teamtalk.amxx") (native "get_pcvar_num") - debug not enabled!
L 05/11/2008 - 19:47:11: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).



Any ideas?? or have i stuffed up.

[SOL] Psycho
05-11-2008, 10:57 AM
Cool, This will be very useful. Thanks Wilson

d-o doesn't have a mic? wow

rhodge32
05-13-2008, 08:55 AM
Im just ever so greatful if it ends up working and i will still be greatful for the effort made!!! as i would NEVER be able to do any of this.

ps. Psycho - could you please reply back to say if it worked fro you or not.

Thanks
Hodgie

[SOL] Psycho
05-13-2008, 09:10 AM
Actually it did not work, I tried it on a Linux and a Windows server. Both were sent into an error spiral. Creating huge error logs. I haven't had time to debug it yet. But maybe you could. [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes). Then post the results.

If you would do this it would narrow down the problem. If you don't get around to it I will this weekend.

rhodge32
05-13-2008, 09:31 AM
Ahh ok thanks.
I done waht you said and here is the log. I dont know where it starts and ends so i hope this is enough.

EDIT: (ahh looking at it.... it is repetitive.

[QUOTE="LOG"]
L 05/13/2008 - 21:24:50: Invalid CVAR pointer
L 05/13/2008 - 21:24:50: [AMXX] Displaying debug trace (plugin "amx_teamtalk.amxx")
L 05/13/2008 - 21:24:50: [AMXX] Run time error 10: native error (native "get_pcvar_num")
L 05/13/2008 - 21:24:50: [AMXX] [0] phppYHcow.sma::plugin_enabled (line 62)
L 05/13/2008 - 21:24:50: [AMXX] [1] phppYHcow.sma::fwd_SetClientListening (line 45)
L 05/13/2008 - 21:24:50: Invalid CVAR pointer
L 05/13/2008 - 21:24:50: [AMXX] Displaying debug trace (plugin "amx_teamtalk.amxx")
L 05/13/2008 - 21:24:50: [AMXX] Run time error 10: native error (native "get_pcvar_num")
L 05/13/2008 - 21:24:50: [AMXX] [0] phppYHcow.sma::plugin_enabled (line 62)
L 05/13/2008 - 21:24:50: [AMXX] [1] phppYHcow.sma::fwd_SetClientListening (line 45)
L 05/13/2008 - 21:24:50: Invalid CVAR pointer
L 05/13/2008 - 21:24:50: [AMXX] Displaying debug trace (plugin "amx_teamtalk.amxx")
L 05/13/2008 - 21:24:50: [AMXX] Run time error 10: native error (native "get_pcvar_num")
L 05/13/2008 - 21:24:50: [AMXX] [0] phppYHcow.sma::plugin_enabled (line 62)
L 05/13/2008 - 21:24:50: [AMXX] [1] phppYHcow.sma::fwd_SetClientListening (line 45)
L 05/13/2008 - 21:24:50: Invalid CVAR pointer
L 05/13/2008 - 21:24:50: [AMXX] Displaying debug trace (plugin "amx_teamtalk.amxx")
L 05/13/2008 - 21:24:50: [AMXX] Run time error 10: native error (native "get_pcvar_num")
L 05/13/2008 - 21:24:50: [AMXX] [0] phppYHcow.sma::plugin_enabled (line 62)
L 05/13/2008 - 21:24:50: [AMXX] [1] phppYHcow.sma::fwd_SetClientListening (line 45)
L 05/13/2008 - 21:24:50: Invalid CVAR pointer
L 05/13/2008 - 21:24:50: [AMXX] Displaying debug trace (plugin "amx_teamtalk.amxx")
L 05/13/2008 - 21:24:50: [AMXX] Run time error 10: native error QUOTE]

diamond-optic
05-13-2008, 01:45 PM
my guess would be it might be from this line:
p_voiceprox = get_cvar_pointer( "amx_voiceprox" );

when that cvar doesnt exist and it trys to get its pointer.. not sure tho, would have to see what wilson says

{DwP} 325th ABN
05-13-2008, 09:33 PM
man wilson if you can get this one going it is the best one ive seen in along time. my clan always has all talk on and alot of the guys would love to be able to raise hell and run as a team. great concept man here are my errors from loading


META] WARNING: Plugin didn't set meta_result: fakemeta_amxx_i386.so:Voice_SetClientListening()
[META] WARNING: Plugin didn't set meta_result: fakemeta_amxx_i386.so:Voice_SetClientListening()
[META] WARNING: Plugin didn't set meta_result: fakemeta_amxx_i386.so:Voice_SetClientListening()
[META] WARNING: Plugin didn't set meta_result: fakemeta_amxx_i386.so:Voice_SetClientListening()
[META] WARNING: Plugin didn't set meta_result: fakemeta_amxx_i386.so:Voice_SetClientListening()

Wilson [29th ID]
05-14-2008, 01:51 AM
have you got the DLL enabled in modules.ini and all? that's an odd error...seems like a problem in the fakemeta linux dll...

{DwP} 325th ABN
05-14-2008, 03:17 AM
well i took the comma out of fakemeta still the same result. sucks i would so love to have this

Wilson [29th ID]
05-14-2008, 08:52 PM
Posted at amxx scripting help (http://forums.alliedmods.net/showthread.php?t=71370)

rhodge32
05-15-2008, 06:46 AM
do we need amx_voiceprox plugin aswell. Ill do some experimenting :)


Cheers
Ryan

Wilson [29th ID]
05-17-2008, 03:22 AM
no that's a totally separate plugin

{DwP} 325th ABN
05-17-2008, 04:24 PM
does anyone have this running, i am still trying to figure out what im doing wrong to get this to work.

[SOL] Psycho
05-17-2008, 04:48 PM
I can't get it to run, I have the same errors that rhodge32 has. I tried removing the line that d-o mentioned and it still goes into an error spiral. Creating huge error logs and making the server unresponsive.

I am wondering if it is in conflict with any of the other plugins I am running.

rhodge32
06-06-2008, 08:18 AM
Well i had no other custom plugins enabled so that counts that out?

Price [508th PIR]
06-12-2008, 02:02 PM
Its using the wrong CVAR for the plugin. It is searching through and then it just gets confused. You have to go into the plugin and specify the CVAR pointer for the plugin. Wilson correct me if i wrong... But i think i got it?

=|[76AD]|= TatsuSaisei
06-14-2008, 02:09 AM
;9851']no that's a totally separate plugin

and yet you are trying to set a pointer to a cvar that IS created in the proximity plugin... and NOT in this plugin....

the error is plainly visible in your code...


p_voiceprox = get_cvar_pointer( "amx_voiceprox" );


this REQUIRES a cvar named amx_voiceprox otherwise you get those errors everyone is mentioning... YOU try commenting out the voice prox. plugin and discover yourself this is the truth...

all others... try this...


#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#define PLUGIN "Team Talk"
#define AUTHOR "Captain Wilson"
#define VERSION "1.1"
//fixed by TatsuSaisei
new teamtalking[33];
new p_enabled;
public plugin_init()
{
register_plugin( PLUGIN, VERSION, AUTHOR );
register_clcmd( "+teamtalk", "clcmd_teamtalk" );
register_clcmd( "-teamtalk", "clcmd_teamtalk" );
register_forward( FM_Voice_SetClientListening, "fwd_SetClientListening" );

p_enabled = register_cvar( "amx_teamtalk", "1" );
}
public clcmd_teamtalk( id ) {
if( get_pcvar_num(p_enabled))
{
new cmd[16];
read_argv( 0, cmd, 15 );

if( equal(cmd, "+", 1) )
{
teamtalking[id] = true;
client_cmd( id, "+voicerecord" );
}
else
{
teamtalking[id] = false;
client_cmd( id, "-voicerecord" );
}
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
public fwd_SetClientListening( receiver, sender, listen ) {
if( get_pcvar_num(p_enabled))
{
if( is_user_connected(sender) && is_user_connected(receiver) && teamtalking[sender] )
{
new team_sender = get_user_team( sender );
new team_receiver = get_user_team( receiver );

if( team_sender != team_receiver )
{
engfunc( EngFunc_SetClientListening, receiver, sender, false );
return FMRES_SUPERCEDE;
}
}
}
return FMRES_IGNORED;
}

=|[76AD]|= TatsuSaisei
06-14-2008, 02:49 PM
btw, just for shits and giggles I tried the code, and while it compiles without error and it doesn't throw out any errors (ran in debug) during runtime, but it simply doesn't seem to work ...

Tank
06-15-2008, 09:36 AM
If what you say is right Tatsu, would it work if you use both plugins? Since it sets a pointer to a cvar in the proximity plugin? If this is true tomorrow I can put both plugins on a server and see if they work then without spitting our errors or whatsoever.

Wilson [29th ID]
06-20-2008, 05:55 PM
Yeah it worked with me and I had both plugins. I must have wrote this and then released it months later, blatantly forgetting about the "compatibility fix" I added for voiceprox :P

Tank
06-30-2008, 08:28 PM
After working for a long time on the server everything is finally working fine. Before cause downtime A-gain to the server, I would like to run this through with you guys and perhaps enlighten me if it would work or not.

Ok, if both plugins are on, it should work. If I put the voice proximity plugin on, when I use the cvar amx_voiceprox 0 (being disabled that is). Would it amx_teamtalk still get this line
p_voiceprox = get_cvar_pointer( "amx_voiceprox" );

from the voice proximity plugin?

If not, I kinda understand from your former posts that the proximity plugin would not disable alltalk? This is true?

Wilson [29th ID]
07-09-2008, 12:52 AM
yes. you can also just remove all the voiceprox stuff from the plugin and you won't need voiceprox.

Tank
11-22-2008, 01:47 PM
For people interested in the plugin without the voice prox. code, here it is. Tested on an amxmodx 1.81 Linux server and worked flawlessly for me.

When using the plugin remember people need to break habits. So use a chat/hud message plugin or implement it into the plugin to get the fastest results.