AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Emit sound with exclusion (https://forums.alliedmods.net/showthread.php?t=298781)

eyal282 06-22-2017 13:00

Emit sound with exclusion
 
Is such feature possible to perform? I would like to block a specific player from hearing a sound in emit_sound, while letting the rest hear the sound emitted.

CrazY. 06-22-2017 13:25

Re: Emit sound with exclusion
 
Register a fw_EmitSound, check the played sound, compare the player ID with would you like to block and return a FMRES_SUPERCEDE.

eyal282 06-22-2017 13:32

Re: Emit sound with exclusion
 
Quote:

Originally Posted by CrazY. (Post 2530737)
Register a fw_EmitSound, check the played sound, compare the player ID with would you like to block and return a FMRES_SUPERCEDE.

EmitSound is a sound emitted to all players if I'm not wrong. returning FMRES_SUPERCEDE will block the sound to all players.

CrazY. 06-22-2017 14:24

Re: Emit sound with exclusion
 
No,

Code:
public fw_EmitSound(id, channel, const sample[], Float:volume, Float:attn, flags, pitch)

First parameter is the source of the sound as an prostotema said.

PRoSToTeM@ 06-22-2017 15:10

Re: Emit sound with exclusion
 
Quote:

Originally Posted by CrazY. (Post 2530762)
No,

Code:
public fw_EmitSound(id, channel, const sample[], Float:volume, Float:attn, flags, pitch)

First parameter is the player ID or any entity ID.

First parameter is the source of the sound, not the destination.

baneado 06-22-2017 15:48

Re: Emit sound with exclusion
 
What sound do you want to block?

CrazY. 06-22-2017 15:50

Re: Emit sound with exclusion
 
Quote:

Originally Posted by PRoSToTeM@ (Post 2530780)
First parameter is the source of the sound, not the destination.

Mmm, my mistake.

EFFx 06-22-2017 15:52

Re: Emit sound with exclusion
 
Dudes, he just wanna use emit_sound() to emit a sound but only X player(s) can hear it.

eyal282 06-22-2017 15:56

Re: Emit sound with exclusion
 
Quote:

Originally Posted by EFFx (Post 2530788)
Dudes, he just wanna use emit_sound() to emit a sound but only X player(s) can hear it.

Precisely.

EFFx 06-22-2017 16:00

Re: Emit sound with exclusion
 
Maybe you can use mp3 stop or stopsound if X player ain't able to hear the sound after use the emit_sound().


All times are GMT -4. The time now is 22:45.

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