How to emit sound without entity?
Tried to find out about svc_sound, but i failed.
I want to emit a sound at position xyz, but without spawning an entity there. Help pls :) |
Re: How to emit sound without entity?
emit_sound
|
Re: How to emit sound without entity?
Oh really ?:)
emit_sound will not work for me cause I would need an entity there to emit it. As I said, i've got an origin and I wanted to play a sound from there without spawning additional entity to use it for emiting_sound. To your information I would be playing sound only once in given origin. |
Re: How to emit sound without entity?
Why can't you use an entity?
|
Re: How to emit sound without entity?
Because the function itseft is already cpu intensive and I wanted to avoid spawning additional entities, cause it *may* lead to a server crash.
If thats impossible, I would just have to leave it as it is - spawning entity, emiting sound and instantly removing it. |
Re: How to emit sound without entity?
The counter-strike engine can handle a ridiculous amount of function calls and operations at one time. Don't let people's whining about optimization and cpu intensity affect your opinion on the engine's capabilities.
Servers have thousands of lines of code being executed every frame on things like PreThink and constant function calls. Things like LJ stats and BlockMaker do virtually all of their (virtual) physical calculations and checks on PreThink and PostThink. Don't worry about optimization and cpu intensity when you're creating something. Optimizations should come after you reach your objective. |
Re: How to emit sound without entity?
Ok, thanks.
|
Re: How to emit sound without entity?
Use EngFunc_EmitAmbientSound with entity = 0
Code:
EngFunc_EmitAmbientSound, // void ) (edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); |
Re: How to emit sound without entity?
Oh damn. I didnt saw there was position param there. :D
Im trying it now :P |
| All times are GMT -4. The time now is 05:22. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.