Raised This Month: $ Target: $400
 0% 

Create a VoiceMask?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 10-16-2006 , 15:30   Create a VoiceMask?
Reply With Quote #1

Gentlemen, I have a way of blocking the voice icon from showing up above players heads. I know many said it could not be done because it's client sided, etc. But I did it.

It's not as efficient as just, say, blocking a message, but the point is it works and it's a trail.

Using my Voice Proximity plugin, which sets SetClientListening to 1 when you are standing near someone, you mute that person in the player list. Then when they talk, their name still shows up and you hear them (due to SetClientListening) but their speaker icon does not show up above their head.

Bingo.

But my question is how can I create the VoiceMask that replicates "everyone on the other team is muted, but everyone on my team is not muted"?

Code:
message_begin(MSG_ONE, get_user_msgid("VoiceMask"), {0,0,0}, id); write_long(); // Bitmask of who client is listening to write_long(); // Bitmask of who client is blocking message_end();

I have to do a test of who is on the client's team and who isn't, then add them to each appropriate bitmask (33 line array)

The problem is I can't even get it to work regardless of the team.
I tried sending a message where the first arg was 0 and the second arg was 4294967295 (block everyone), but that didn't even block them.

Any idea what I'm doing wrong here?
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 10-16-2006 , 18:15   Re: Create a VoiceMask?
Reply With Quote #2

You could do a crappy hack: save the value of sv_alltalk and set it whenever it's needed, then set it back to the saved copy.

I'm not sure if that would bypass what you're doing or not though, that's the only real problem.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 10-17-2006 , 02:51   Re: Create a VoiceMask?
Reply With Quote #3

When I log the arguments set when all talk is turned on and off it depends on how many players are there but with 2 players including myself it shows up usually 1 and 2 or 3, nothing higher. How can i replicate this based on the players? How can I create this bitmask?
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 12-22-2006 , 23:43   Re: Create a VoiceMask?
Reply With Quote #4

Was about to create a post about this and realised I made one a while back. Bumping this.

I just need to know how to create the bitmask sums and it'll be good to go.
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-23-2006 , 01:28   Re: Create a VoiceMask?
Reply With Quote #5

I couldn't tell you (I am terrible with C/C++), but you can examine the source code and see what you get.

EDIT: cut out to save space, see below post
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS

Last edited by XxAvalanchexX; 12-23-2006 at 04:35.
XxAvalanchexX is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-23-2006 , 01:38   Re: Create a VoiceMask?
Reply With Quote #6

Nevermind, I figured it out. Add together (1<<playerNum-1) for each player you want in the list. Example:

Code:
// players 1, 2, and 3 new voiceMask = (1<<0) | (1<<1) | (1<<2); // players 3, 7, 12, and 26 new voiceMask = (1<<2) | (1<<6) | (1<<11) | (1<<25); // create a voicemask based on players array stock create_voicemask(players[33]) {     new i, voiceMask;     for(i=1;i<=32;i++)     {         if(players[i]) voiceMask |= (1<<(i-1));     }     return voiceMask; }
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS

Last edited by XxAvalanchexX; 12-23-2006 at 01:41.
XxAvalanchexX is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 12-23-2006 , 04:12   Re: Create a VoiceMask?
Reply With Quote #7

Thanks very much for your help! but when I do it, it doesn't seem to mute them.

At first I was going to use get_players() to create the players array, but I had to alter your function to account for the fact that get_players is a 32 size array not 33. I changed the paramter to players[32] and made i=0 and in the voicemask setting i took out -1, but it didn't seem to work.

So I tried simply making an empty array. I figure it doesn't work because the players array doesn't contain the actual player id..was hoping you could go a little more detailed for me?

Code:
public reset_hud(id) {     new players[33];     // This is where I had players a 32 size array and used get_players     // currently using an empty 33 slot array to be compatible with avalanche's function         g_mask_listen[id] = 0;     g_mask_block[id] = create_voicemask(players);         client_print(id, print_chat, "Testing Listen: %i - Block: %i", g_mask_listen[id], g_mask_block[id]);         message_begin(MSG_ONE,gmsgVoiceMask,{0,0,0},id);     write_long(g_mask_listen[id]);     write_long(g_mask_block[id]);     message_end();             return PLUGIN_CONTINUE; }

It doesn't mute anyone at all, but the client_print does return 0 and 15 so the stock is returning value.
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-23-2006 , 04:33   Re: Create a VoiceMask?
Reply With Quote #8

Just try sending this to a single player and see if he can hear anyone or not:

Code:
message_begin(MSG_ONE,gmsgVoiceMask,{0,0,0},id); write_long(1<<(id-1)); write_long(0); message_end();

Note then when any player spawns or dies, the VoiceMask message is sent again, which will override whatever you set it to. I'd just put the above in a say command hook, get you and one other player on your team, and then do a before and after as to if he can hear you or not.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 12-25-2006 , 04:31   Re: Create a VoiceMask?
Reply With Quote #9

Actually, that message isn't being sent properly. I have an echo before it and after it and only the echo before it is printed. Is there an error in the bitmask creation that would prevent it from being completed?
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-26-2006 , 16:54   Re: Create a VoiceMask?
Reply With Quote #10

Try changing the longs to bytes. It's confusing, because potentially the bitsum could go over 255 (with enough players in it), but when I was running message logger, both arguments were bytes and not longs. Maybe it's clever enough to only use the data type required for whatever the value is.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX 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 04:54.


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