Raised This Month: $ Target: $400
 0% 

Mic Proximity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 04-08-2007 , 00:04   Mic Proximity
Reply With Quote #1

Okay, there is an approved plugin called Mic Proximity. I have it on my server but people cut in and out. Why?
Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN "Voice Proximity"
#define VERSION "1.0"
#define AUTHOR "29th ID"

new g_enabled, g_distance

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	g_enabled  = register_cvar("amx_voiceprox", "0")
	g_distance = register_cvar("amx_voiceprox_distance", "600")
	
	register_forward(FM_PlayerPreThink, "forward_player_prethink")
}

public forward_player_prethink(id) {
	if( (get_pcvar_num(g_enabled)) && (is_user_alive(id)) )
		check_area(id)
}

public check_area(id) {
	new players[32]
	new i, pNum
	get_players(players, pNum, "a")
	for (i=0; i < pNum; i++) {
		if(players[i] == id) continue
		
		engfunc(EngFunc_SetClientListening, id, players[i], (entity_distance_stock(id, players[i]) <= get_pcvar_num(g_distance)) ? 1 : 0)
	}
}

stock Float:vecdist(Float:vec1[3], Float:vec2[3])
{
        new Float:x = vec1[0] - vec2[0]
        new Float:y = vec1[1] - vec2[1]
        new Float:z = vec1[2] - vec2[2]
        x*=x;
        y*=y;
        z*=z;
        return floatsqroot(x+y+z);
}
 
stock Float:entity_distance_stock(ent1, ent2)
{
        new Float:orig1[3]
        new Float:orig2[3]
 
        pev(ent1, pev_origin, orig1)
        pev(ent2, pev_origin, orig2)
 
        return vecdist(orig1, orig2)
}
Styles is offline
Send a message via AIM to Styles
Nican
Veteran Member
Join Date: Jan 2006
Location: NY
Old 04-08-2007 , 00:40   Re: Mic Proximity
Reply With Quote #2

What do you mean by "people cut in and out"
__________________
http://www.nican132.com
I require reputation!
Nican is offline
Send a message via ICQ to Nican Send a message via MSN to Nican
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 04-08-2007 , 00:53   Re: Mic Proximity
Reply With Quote #3

like the mic turns on and off really fast then finally it works right and perfectly.
Styles is offline
Send a message via AIM to Styles
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 04-08-2007 , 19:00   Re: Mic Proximity
Reply With Quote #4

Yes, I made Voice Proximity. The reason they are cutting out is because they're not supposed to be heard. The plugin basically catches up with the server/voice codec and that's why they get cut off.

I reccomend turning off "All Talk" for the plugin - that decreases the cut out to the point where it's hardly noticable. You will still be able to hear your enemies talking if they are near you - the plugin overrides "all talk" but the server stops transmitting signals from those far away so it cuts those "cut outs" in half.
__________________

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]
Voi
Veteran Member
Join Date: Sep 2006
Location: Gdansk, Poland
Old 04-08-2007 , 19:47   Re: Mic Proximity
Reply With Quote #5

does it makes u hear enemy radio(microphone) ?
__________________
Voi is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 04-08-2007 , 19:50   Re: Mic Proximity
Reply With Quote #6

yeah
__________________

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]
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:44.


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