Create a VoiceMask?
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:
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? |
Re: Create a VoiceMask?
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. |
Re: Create a VoiceMask?
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?
|
Re: Create a VoiceMask?
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. |
Re: Create a VoiceMask?
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 |
Re: Create a VoiceMask?
Nevermind, I figured it out. Add together (1<<playerNum-1) for each player you want in the list. Example:
Code:
|
Re: Create a VoiceMask?
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:
It doesn't mute anyone at all, but the client_print does return 0 and 15 so the stock is returning value. |
Re: Create a VoiceMask?
Just try sending this to a single player and see if he can hear anyone or not:
Code:
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. |
Re: Create a VoiceMask?
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?
|
Re: Create a VoiceMask?
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.
|
| All times are GMT -4. The time now is 04:54. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.