• pre-existing CSoundPatch control problem
    1 replies, posted
hook.Add("EntityEmitSound", "EntityEmitSound", function(data)     local vdist2 = 1200     local vdist = vdist2*vdist2     local d = data     local ent = d.Entity     local snd = d.SoundName     PrintTable(d)     print("\n"..tostring(ent).."\n\n")     if DistToSqr( GetPos( LocalPlayer() ), GetPos(ent) ) > vdist then         --d:Stop()         --snd:Stop()     end end) using CSoundPatch, how do i stop what returns from that? it gives back a table with the following Ambient Channel DSP Entity Flags OriginalSoundName Pitch Pos SoundLevel SoundName SoundTime Volume i've found no way to stop sounds that i receive from that, why can't I do this? returning does nothing either. does anybody know a non-fuckery way to do this? I've tried a lot of things, I want to do it with THIS hook. so how do i stop CSoundPatch thing that i didn't create? regards
https://wiki.garrysmod.com/page/GM/EntityEmitSound Return false to prevent the sound from playing. Otherwise, try taking the table the hook and changing the values of the Flags to SND_STOP? If not, modify Volume in the table to 0. Be sure to return true after modifying the table so it changes the values.
Sorry, you need to Log In to post a reply to this thread.