File tree Expand file tree Collapse file tree 1 file changed +7
-13
lines changed
Expand file tree Collapse file tree 1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change 99#include < utils/utils.h>
1010#include < sdk/components/EmitSound_t.h>
1111#include < sdk/components/CSingleRecipientFilter.h>
12+ #include < network/soundevents/soundevent.h>
1213
1314typedef IGameEventListener2* (*GetLegacyGameEventListener)(CPlayerSlot slot);
1415
15- typedef SndOpEventGuid_t (*CBaseEntity_EmitSoundFilter)(IRecipientFilter& filter, CEntityIndex ent, const EmitSound_t& params);
16-
1716void EmitSoundFilter (int playerid, std::string sound_name, float pitch, float volume)
1817{
1918 auto player = g_playerManager.GetPlayer (playerid);
2019 if (!player) return ;
2120
22- CEntityInstance* instance = (CEntityInstance*)player->GetController ();
23- if (!instance) return ;
24-
25- EmitSound_t params;
26- params.m_pSoundName = sound_name.c_str ();
27- params.m_flVolume = volume;
28- params.m_nPitch = pitch;
29-
30- CBaseEntity_EmitSoundFilter filter = g_GameData.FetchSignature <CBaseEntity_EmitSoundFilter>(" CBaseEntity_EmitSoundFilter" );
21+ Soundevent sound;
22+ sound.SetName (sound_name);
23+ sound.SetFloat (" public.volume" , volume);
24+ sound.SetFloat (" public.pitch" , pitch);
3125
32- CSingleRecipientFilter playerfilter (playerid);
33- filter (playerfilter, instance-> m_pEntity -> m_EHandle . GetEntryIndex (), params );
26+ sound. AddClient (playerid);
27+ sound. Emit ( );
3428}
3529
3630MenuRenderer::MenuRenderer (Player* player)
You can’t perform that action at this time.
0 commit comments