AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Emit Sound or Ambient Sound question (https://forums.alliedmods.net/showthread.php?t=253140)

ZASTRELIS 12-15-2014 21:44

Emit Sound or Ambient Sound question
 
How I can emit sound for individual player in ent radius? I use:
Code:
engfunc(EngFunc_EmitAmbientSound, g_point_entuty, fOrigin, g_szBombSounds[0], 0.5, ATTN_NORM, 0, PITCH_NORM);
but it's works for all players..

fysiks 12-15-2014 22:28

Re: Emit Sound question
 
emit_sound() does what you are asking except you can't choose the radius. I'm not sure how it chooses a radius but not everybody can hear it.

Also, it looks like what you are doing there is an inefficient method of implementing emit_sound().

ZASTRELIS 12-15-2014 23:09

Re: Emit Sound question
 
I use EmitAmbientSound for playing sample when player has reaches radius where sample can play
but it works for all players in rad, I want do it for each player.

ZASTRELIS 12-15-2014 23:27

Re: Emit Sound question
 
Code:

engfunc(EngFunc_EmitAmbientSound, PLAYER_id, ENTITY_fOrigin, g_szBombSounds[0], 0.5, ATTN_NORM, 0, PITCH_NORM);
Individual Player hear sample everywhere. ENTITY_fOrigin not works.

Code:

engfunc(EngFunc_EmitAmbientSound, ENTYTY_id, ENTITY_fOrigin, g_szBombSounds[0], 0.5, ATTN_NORM, 0, PITCH_NORM);
All players hear sample only in ENTITY radius. ENTITY_fOrigin works.

ZASTRELIS 12-15-2014 23:30

Re: Emit Sound question
 
Why i need this? Because when player goes on from samples' radius and back up sound not played.

RateX 12-16-2014 02:13

Re: Emit Sound or Ambient Sound question
 
Why not check the radius and use client_cmd?

ZASTRELIS 12-16-2014 02:14

Re: Emit Sound or Ambient Sound question
 
Quote:

Originally Posted by RateX (Post 2235921)
Why not check the radius and use client_cmd?

attenuation radius :bee:

Natsheh 12-16-2014 13:17

Re: Emit Sound or Ambient Sound question
 
here any example [S:]-

PHP Code:

                     emit_sound(entity_idCHAN_BODY"Sound"VOL_NORMATTN_NORM0PITCH_NORM

i think it dose start sound, if a player near the entity will hear it....

fysiks 12-16-2014 18:50

Re: Emit Sound or Ambient Sound question
 
It's possible to restrict who hears player voices but not sounds that are played in the map AFAIK.

NiHiLaNTh 12-17-2014 05:13

Re: Emit Sound or Ambient Sound question
 
and what about SVC_SPAWNSTATICSOUND? It might be what you need.


All times are GMT -4. The time now is 15:29.

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