MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / EmitAmbientSound

Function EmitAmbientSound

extensions/sdktools/vsound.cpp:744–778  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

742}
743
744static cell_t EmitAmbientSound(IPluginContext *pContext, const cell_t *params)
745{
746 cell_t entity;
747 Vector pos;
748 char *name;
749 float vol, delay;
750 int pitch, flags, level;
751
752 entity = SoundReferenceToIndex(params[3]);
753
754 cell_t *addr;
755 pContext->LocalToPhysAddr(params[2], &addr);
756 pos.x = sp_ctof(addr[0]);
757 pos.y = sp_ctof(addr[1]);
758 pos.z = sp_ctof(addr[2]);
759
760 pContext->LocalToString(params[1], &name);
761
762 vol = sp_ctof(params[6]);
763 level = params[4];
764 flags = params[5];
765 pitch = params[7];
766 delay = sp_ctof(params[8]);
767
768 if (g_InSoundHook)
769 {
770 ENGINE_CALL(EmitAmbientSound)(entity, pos, name, vol, (soundlevel_t)level, flags, pitch, delay);
771 }
772 else
773 {
774 engine->EmitAmbientSound(entity, pos, name, vol, (soundlevel_t)level, flags, pitch, delay);
775 }
776
777 return 1;
778}
779
780static cell_t FadeClientVolume(IPluginContext *pContext, const cell_t *params)
781{

Callers

nothing calls this directly

Calls 1

SoundReferenceToIndexFunction · 0.85

Tested by

no test coverage detected