Hello!
I'm changing taunt's sounds (and other) on my server with plugin.
Actually i have a little problem cuz i want to change sound of Disco Fever for example but don't know how. It's not the only example of this kind of problem with changing sound for me. I believe i just need a database of their sounds so i will do it myself. (not wiki)
I know 2 methods of changing sounds (it depends on what sound i want to change):
First method for most sounds:
Spoiler
Code:
public OnPluginStart()
{
AddNormalSoundHook(SHook);
}
public Action:SHook(clients[64], &numClients, String:sound[PLATFORM_MAX_PATH], &Ent, &channel, &Float:volume, &level, &pitch, &flags)
{
if (StrContains(sound, "taunt_medic_heroic", false) > -1 ) //Meet the Medic Taunt
{
Format(sound, sizeof(sound), "mtm/drfeelgood.wav");
EmitSoundToClient(Ent, "mtm/drfeelgood.wav");
return Plugin_Changed;
}
}
Second method (for taunts like Conga what works on loops etc.):
Spoiler
Code:
new String:Conga[PLATFORM_MAX_PATH] = "c/feelmagic.wav";
public OnPluginStart()
{
HookUserMessage(GetUserMessageId("PlayerTauntSoundLoopStart"), HookTauntMessage, true);
AddNormalSoundHook(SHook);
}
public Action:HookTauntMessage(UserMsg:msg_id, BfRead msg, const players[], playersNum, bool:reliable, bool:init)
{
int byte = msg.ReadByte(); //The client index sending the sound
char string[PLATFORM_MAX_PATH]; //The sound
msg.ReadString(string, PLATFORM_MAX_PATH);
PrintToServer("%i %s", byte, string);
if (StrEqual(string, "music.conga_loop"))
{
RequestFrame(ReSendWithNewConga, byte);
return Plugin_Handled;
}
}
public void ReSendWithNewConga(int byte)
{
Handle message = StartMessageAll("PlayerTauntSoundLoopStart");
BfWriteByte(message, byte);
BfWriteString(message, Conga);
EndMessage();
}
Like i said i have problems with some like Disco Fever. I believe that i have to use the second method cuz first with "taunt_disco" doesn't work, but i just don't know the command (?) or i don't know. (I m meaning something like this in Conga variant: "music.conga_loop" but for disco fever and other sounds)
There is any list for those sound effects or method to just check them?