AlliedModders

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

VarmVaffel 03-27-2005 11:41

Emit sound at origin
 
Is it possible to play a a sound effect at a certain origin, and in that case how?

- VV

Ced 03-28-2005 00:03

make an invisible entity at your origin and play the sound from it

VarmVaffel 03-28-2005 06:11

But musn't the index be a player entity between 1 and 32 ?

Code:
emit_sound ( index, channel, sample[], Float:vol, Float:att,flags, pitch ) Notes: index,is a player index from 1 to 32.

Twilight Suzuka 03-28-2005 10:50

The id does not hve to be a player.

I like to do it like this though:

Code:
public overhear(Float:startor[3],Float:dist,Sound[]) {     for(new i=0; i < get_maxplayers(); i++)     {         new Float:Porigin[3]         entity_get_vector(i,EV_VEC_origin,Porigin)         if(dist > vector_distance(Porigin,startor) ) emit_sound ( i, channel, Sound, Float:vol, Float:att,flags, pitch ) // fill in this     }     return 1; }

Or something similar.

XxAvalanchexX 03-28-2005 17:27

That'll come up with player not in-game errors and will cause one version of the sound to emit from every single player, causing players to hear multiple versions if other users are nearby.


All times are GMT -4. The time now is 09:56.

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