Raised This Month: $ Target: $400
 0% 

emit sound to specific player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
crazylf2
Member
Join Date: May 2004
Old 06-24-2007 , 23:10   emit sound to specific player
Reply With Quote #1

should i change the index to do that?
crazylf2 is offline
crazylf2
Member
Join Date: May 2004
Old 06-25-2007 , 00:53   Re: emit sound to specific player
Reply With Quote #2

emit_sound(id,CHAN_AUTO,"1.wav", VOL_NORM, ATTN_NONE, 0, PITCH_NORM)

this is my code
where should i make change on ?


thanks for helping me
crazylf2 is offline
kmal2t
BANNED
Join Date: Apr 2006
Old 06-25-2007 , 01:18   Re: emit sound to specific player
Reply With Quote #3

I use:
Code:
public plugin_precache() {
	precache_sound("misc/sound.wav");
} 

public myFunc(id) {
    emit_sound(id, CHAN_VOICE, "misc/sound.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
kmal2t is offline
crazylf2
Member
Join Date: May 2004
Old 06-25-2007 , 04:10   Re: emit sound to specific player
Reply With Quote #4

Code:
new i 
const a = 33
new mute[a] = {1, ...} 

public aocvoice31(id){
client_print(0,print_chat,"%L",LANG_PLAYER,"ATTACK_ATTACK")
for (i=1; i<=32; i++)
{
	if (mute[i] == 1) {
		emit_sound(i,CHAN_VOICE,"31.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
		} 
		else {
		return PLUGIN_CONTINUE
	}
}
}


public mutevoice(id)
{
mute[id] = 0 
client_print(id,print_chat,"%L",LANG_PLAYER,"YOU_MUTE")
}

public unmutevoice(id)
{
mute[id] = 1 
client_print(id,print_chat,"%L",LANG_PLAYER,"YOU_UNMUTE")
}

i wrote this code suspose to able player to emit sound
they can type "say 11" to emit sound to everyone
and now i want they can type "!mute" to make the sound stop
cannot hear anymore
but these code does no effect when i typed !mute
is there any mistake ?

thank you

Last edited by crazylf2; 06-25-2007 at 04:15.
crazylf2 is offline
mateo10
Veteran Member
Join Date: Jan 2006
Old 06-25-2007 , 05:41   Re: emit sound to specific player
Reply With Quote #5

Change the aocvoice31 function to this:

Code:
public aocvoice31(id){ client_print(0,print_chat,"%L",LANG_PLAYER,"ATTACK_ATTACK") new players[32], num; get_players(players, num); new player; for (i=0; i<num; i++) {     players[i] = player;     if (mute[player] == 1) {         emit_sound(player,CHAN_VOICE,"31.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)         }         else {         return PLUGIN_CONTINUE     } } return PLUGIN_HANDLED; }

Last edited by mateo10; 06-25-2007 at 05:46.
mateo10 is offline
Pro Patria Finland
Senior Member
Join Date: Apr 2006
Location: BaronPub.com
Old 06-26-2007 , 17:41   Re: emit sound to specific player
Reply With Quote #6

nevermind
__________________
I am not a number. I am Gordon Freeman!

Last edited by Pro Patria Finland; 06-26-2007 at 17:42. Reason: nevermind
Pro Patria Finland is offline
Reply


Thread Tools
Display Modes

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 21:25.


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