AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Unprecaching map sounds (https://forums.alliedmods.net/showthread.php?t=299771)

baneado 07-25-2017 09:06

Unprecaching map sounds
 
Hi, I'm trying to unprecache some map sounds that are unnecessary and block them for emiting...

So, ok. I'm using this plugin on jb_snow map: http://gamebanana.com/maps/155405
Spoiler


But after start every round, a message spam appear on console:
Spoiler


Why is this happening? Any way to block those spam messages?

EDIT: FM_EmitSound from the plugin was never called. So, how to hook those sounds??

JusTGo 07-25-2017 11:15

Re: Unprecaching map sounds
 
try https://github.com/In-line/metamod_unprecacher

TBagT 07-25-2017 12:42

Re: Unprecaching map sounds
 
Hi I don't know if this will help but I use this code to remove ambient generic sounds from map it also unprecaches them, the code is Connors if I remember correctly. Maybe you'll manage rewrite this code to only remove those sounds which are unnecessary.

PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

public plugin_precache( ) {
        
RegisterHamHam_Spawn"ambient_generic""CAmbientGeneric_Spawn" );
}

public 
CAmbientGeneric_Spawnent ) {
        
set_peventpev_message);
        return 
HAM_HANDLED;



baneado 07-25-2017 13:55

Re: Unprecaching map sounds
 
Quote:

Originally Posted by JusTGo (Post 2537670)

Not tested

Quote:

Originally Posted by TBagT (Post 2537691)
Hi I don't know if this will help but I use this code to remove ambient generic sounds from map it also unprecaches them, the code is Connors if I remember correctly. Maybe you'll manage rewrite this code to only remove those sounds which are unnecessary.

PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

public plugin_precache( ) {
        
// Random sounds in map block //
        
RegisterHamHam_Spawn"ambient_generic""CAmbientGeneric_Spawn" );
}

public 
CAmbientGeneric_Spawnent ) {
        
set_peventpev_message);
        return 
HAM_HANDLED;



Working ^^

Are you 100% sure that sound doesn't precache?

TBagT 07-25-2017 14:00

Re: Unprecaching map sounds
 
It will disable the precache, original post here the only difference is that the registerham should be done in precache.

baneado 07-25-2017 14:04

Re: Unprecaching map sounds
 
Quote:

Originally Posted by TBagT (Post 2537703)
It will disable the precache, original post here the only difference is that the registerham should be done in precache.

Thanks, I love you


All times are GMT -4. The time now is 23:12.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.