View Single Post
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 12-16-2018 , 08:50   Re: [L4D & L4D2] Super Tanks++ (v8.49, 12-06-2018)
Reply With Quote #413

I managed to found sound path and possible reason, but I was unsuccessful in attempt to fix it without using hook.

Your culprit is:
Code:
#define SOUND_THROWN_MISSILE 		"player/tank/attack/thrown_missile_loop_1.wav"
I didn't touch your plugin. Instead I cracked panxiaohai's.
When he destroys rock's entity, game engine does not stop automatically the sound of rock thrown.
Code:
RemoveEdict(ent);
Interception show:
Quote:
L 12/16/2018 - 16:16:11: [l4d_tankhelper_hook.smx] player/tank/attack/thrown_missile_loop_1.wav
L 12/16/2018 - 16:16:11: [l4d_tankhelper_hook.smx] numClients: 5, entity: 1, channel: 0, volume: 0.000000, level: 0, pitch: 100, flags: 4, soundEntry: , seed: 0
L 12/16/2018 - 16:16:11: [l4d_tankhelper_hook.smx] numClients: 5, entity: 1, channel: 1, volume: 0.000000, level: 0, pitch: 100, flags: 4, soundEntry: , seed: 0
L 12/16/2018 - 16:16:11: [l4d_tankhelper_hook.smx] numClients: 5, entity: 1, channel: 2, volume: 0.000000, level: 0, pitch: 100, flags: 4, soundEntry: , seed: 0
L 12/16/2018 - 16:16:11: [l4d_tankhelper_hook.smx] numClients: 5, entity: 1, channel: 3, volume: 0.000000, level: 0, pitch: 100, flags: 4, soundEntry: , seed: 0
L 12/16/2018 - 16:16:11: [l4d_tankhelper_hook.smx] numClients: 5, entity: 1, channel: 4, volume: 0.000000, level: 0, pitch: 100, flags: 4, soundEntry: , seed: 0
L 12/16/2018 - 16:16:11: [l4d_tankhelper_hook.smx] numClients: 5, entity: 1, channel: 5, volume: 0.000000, level: 0, pitch: 100, flags: 4, soundEntry: , seed: 0
L 12/16/2018 - 16:16:11: [l4d_tankhelper_hook.smx] numClients: 5, entity: 1, channel: 6, volume: 0.000000, level: 0, pitch: 100, flags: 4, soundEntry: , seed: 0
L 12/16/2018 - 16:16:11: [l4d_tankhelper_hook.smx] numClients: 5, entity: 1, channel: 7, volume: 0.000000, level: 0, pitch: 100, flags: 4, soundEntry: , seed: 0
L 12/16/2018 - 16:16:11: [l4d_tankhelper_hook.smx] numClients: 5, entity: 1, channel: 135, volume: 0.000000, level: 0, pitch: 100, flags: 4, soundEntry: , seed: 0
I tried:

PHP Code:
public Action:Timer_StopSoundDelayed(Handle:timerany:thetank)
{

    
// method 1
    // not work
    
    
for (int i 1<= MaxClientsi++)
    {
        if (
IsClientInGame(i)) //&& GetClientTeam(i) == 2)
        
{
            for (
int channel 0channel <= 7channel++)
            {
                
StopSound(ichannelSOUND_THROWN_MISSILE);
            }
            
StopSound(iSNDCHAN_USER_BASESOUND_THROWN_MISSILE); // 135
        
}
    }
    
    
// method 2
    // not work
    //EmitSoundToAll(SOUND_THROWN_MISSILE, _, _, _, SND_STOPLOOPING, _, _, _, _, _, _, _); 

as well as a delay (3 sec.) before stop, but without success.

As expected, sound blocked ok using:
Code:
public Action OnNormalSoundPlay(int clients[MAXPLAYERS], int &numClients,
		char sample[PLATFORM_MAX_PATH], int &entity, int &channel, float &volume, int &level,
		int &pitch, int &flags, char soundEntry[PLATFORM_MAX_PATH], int &seed)
{
	if (StrEqual(sample, SOUND_THROWN_MISSILE, false)) {
		numClients = 0;
		return Plugin_Changed;
	}
	return Plugin_Continue;
}
If you want to continue experiment, here is a plugin with those several methods.
As for me, I prefer to block that sound forever, if another methods will be unsuccess.
Attached Files
File Type: sp Get Plugin or Get Source (l4d_tankhelper_hook.sp - 367 views - 11.9 KB)
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline