const arrays can be declared in pplugin_init to memory is freed after it.
Also, for example i would organize emitsound callback like this, make more sense for me :
PHP Code:
public fw_EmitSound(iEnt, channel, const sound[])
{
if(TrieKeyExists(g_tdoorSnd, sound))
{
if(get_pcvar_num(g_kz_doorsound))
{
return FMRES_SUPERCEDE
}
}
else if(TrieKeyExists(g_tpainSnd, sound))
{
if(get_pcvar_num(g_kz_painsound))
{
return FMRES_SUPERCEDE
}
}
else if(TrieKeyExists(g_twaterSnd, sound))
{
if(get_pcvar_num(g_kz_watersound))
{
return FMRES_SUPERCEDE
}
}
else if(TrieKeyExists(g_tdoorSnd, sound))
{
if(get_pcvar_num(g_kz_doorsound))
{
return FMRES_SUPERCEDE
}
}
return FMRES_IGNORED
}
Last, i don't think water sounds are done with EmitSound, you should check it (try to pass in water, you should hear water sounds whatever the cvar value).
Better than cvars, make a config file in which you put something like remove_doorsounds 1, if 1, fill a Trie called g_trieRemoveSounds with doors sounds names, you could then make only 1 check (trie key exists) in callback.
__________________