PDA

View Full Version : For server plugin programer: Interfaces


bugbait2
12-08-2004, 03:05
This thread shows how to use new interfaces and as example emitsound and some fx effects in a server plugin.

http://www.hl2coding.com/forums/viewtopic.php?t=31

I hope to see funny results :)

Geesu
12-08-2004, 13:52
too bad there are only like 8 effects :(

imported_pyr0
02-03-2005, 23:52
Does anyone know what the flags are for emitsound. I would ask over there but am too lazy to register for the forums :D.

What I'm trying to do is emit the sound at the location of the player but when they move away from that spot they move away from the sound too. Right now the sound follows the player wherever they go.

imported_pyr0
02-03-2005, 23:54
doh...maybe it would help to do a little research BEFORE asking. soundflags.h seems to define the flags :P

Didn't help me accomplish what I wanted though. :(

theqizmo
02-04-2005, 00:35
Posted: Tue Dec 07, 2004 12:56 pm


Welcome to last year.

sslice
02-20-2005, 21:07
It would still be nice to know how to use EmitSound. :D

I've been trying to learn how to use it, and even make some basic functions to make it easier, but it always crashes the server when I either use PrecacheSound, or EmitSound.


void EmitSound(int index, const char *soundfile)
{
MRecipientFilter mrf;
IEngineSound *esound = NULL;
mrf.AddPlayer(index);
bool play;
if (esound->IsSoundPrecached(soundfile) == true) {
play = true;
}
else {
play = esound->PrecacheSound(soundfile, true);
}
if (play == true) {
esound->EmitSound((IRecipientFilter &)mrf, index, CHAN_AUTO, soundfile, 0.7, ATTN_NORM, 0, 100);
}
}

vancelorgin
02-21-2005, 00:26
too bad there are only like 8 effects :(
http://www.sourcemod.net/~sourcemod/forums/viewtopic.php?t=360

And don't neglect DispatchEffect