About events with pre-defined sounds, like
teamplay_round_win.
My noobish brain talks me that need to use
AmbientSHook or
NormalSHook instead of
HookEvent. All we need is to modify one parameter (sound file to play at this event).
And i think that we need to configurate server's
pure_server_whitelist.txt, if sv_pure != 0.
/UPD
AmbientSHook or
NormalSHook impossible to use, server don't send winning sound to client. I'm use SAMURAI's modified plugin to hook sounds send to client, but win/lose sound don't appear in console and chat.
PHP Code:
#include <sourcemod>
#include <sdktools>
public Plugin:myinfo = {
name = "Hook sounds",
author = "SAMURAI",
description = "",
version = "1.0",
url = "oh"
}
public OnPluginStart()
{
AddNormalSoundHook(NormalSHook:HookSound_Callback);
AddAmbientSoundHook(AmbientSHook:HookAmbientSound_Callback);
}
public Action:HookSound_Callback(clients[64], &numClients, String:sample[PLATFORM_MAX_PATH], &entity)
{
PrintToChatAll("normal sound : %s",sample);
PrintToServer("normal sound: %s", sample);
}
public Action:HookAmbientSound_Callback(String:sample[PLATFORM_MAX_PATH], &entity)
{
PrintToChatAll("ambient sound : %s",sample);
PrintToServer("ambient sound: %s", sample);
}
It means that client's gameinfo_sounds.txt set file to event. And how to replace it - this is a problem. But solution may be to supress default sound by custom, using parameters such as volume, pitch etc.
/
UPD 2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
How HWG says, "Stupid, stupid, stupid!!" I'm talk with myself. %)
Just send command PLAY file to client. But you should allow_from_disk in
pure_server_whitelist.txt all your sound files, if sv_pure = 1