Пока так работает
Код
#include <sdktools>
#define MAX_STR_LEN 128
new UserMsg:g_umSendAudio;
...
public OnPluginStart()
{
// Um: RadioAudio
if ((g_umSendAudio = GetUserMessageId("SendAudio")) != INVALID_MESSAGE_ID)
HookUserMessage(g_umSendAudio, UserMsgSendAudio, true);
else
SetFailState("GetUserMessageId for SendAudio");
HookEvent("round_end", Round_End, EventHookMode_Pre);
}
// No sound
public Action UserMsgSendAudio(UserMsg:msg_id, Handle:bf, const players[], playersNum, bool:reliable, bool:init)
{
char msg_str[MAX_STR_LEN];
BfReadString(bf, msg_str, sizeof(msg_str));
if (StrEqual(msg_str, "radio.go", false) || StrEqual(msg_str, "radio.locknload", false) || StrEqual(msg_str, "radio.moveout", false) || StrEqual(msg_str, "radio.letsgo", false))
return Plugin_Handled;
return Plugin_Continue;
}
public Action Round_End(Event event, char[] name, bool B_DontBroadcast)
{
for (new i = 1; i < MaxClients; i++)
{
if (IsClientInGame(i) && !IsFakeClient(i))
{
StopSound(i, SNDCHAN_STATIC, "radio/ctwin.wav");
StopSound(i, SNDCHAN_STATIC, "radio/terwin.wav");
}
}
}