Все фигня, нормальный sounds тольк от от ws но надо поправки внестиНет,все плагины требуют победу команды,я уже даже какой то abner sound пытался ставить,все кому писал говорят нужно насильно делать победу в раунде одной из команд
#pragma semicolon 1
#include <clientprefs>
#include <csgo_colors>
#include <sourcemod>
#include <emitsoundany>
new Handle:g_Cookie;
new soundPreference[MAXPLAYERS+1];
public Plugin:myinfo =
{
name = "Round End Music",
author = "wS / Schmidt",
version = "1.1",
url = "http://world-source.ru/"
};
new Handle:g_Array;
new g_Sounds_Count;
new g_CurrPos = -1;
new timeconnect[MAXPLAYERS+1];
public OnPluginStart()
{
new Handle:dir = OpenDirectory("sound/indarello/roundend");
if (dir == INVALID_HANDLE)
{
SetFailState("Не удалось открыть");
return;
}
g_Array = CreateArray(150);
decl String:SoundName[150], FileType:type;
while (ReadDirEntry(dir, SoundName, 150, type))
{
if (type == FileType_File && StrContains(SoundName, ".ztmp") == -1)
{
if (StrContains(SoundName, ".mp3") > 0 || StrContains(SoundName, ".wav") > 0)
{
Format(SoundName, 150, "indarello/roundend/%s", SoundName);
PushArrayString(g_Array, SoundName);
}
}
}
CloseHandle(dir);
if ((g_Sounds_Count = GetArraySize(g_Array)) < 1)
{
SetFailState("В indarello/roundend нет звуков");
return;
}
g_Cookie = RegClientCookie("rounend_sounds", "Enable rounend sounds", CookieAccess_Private);
RegConsoleCmd("sm_res", cmd_zzguns);
HookEvent("round_end", round_end, EventHookMode:1);
}
public OnMapStart()
{
decl String:SoundName[150];
for (new i = 0; i < g_Sounds_Count; i++)
{
GetArrayString(g_Array, i, SoundName, 150); PrecacheSoundAny(SoundName, true);
Format(SoundName, 150, "sound/%s", SoundName); AddFileToDownloadsTable(SoundName);
}
}
public OnClientPutInServer(client)
{
timeconnect[client] = GetTime();
}
public Action:cmd_zzguns(client, args)
{
if (client == 0 || !IsClientInGame(client))
{
return Plugin_Handled;
}
if(soundPreference[client] == 0)
{
CGOPrintToChat(client, "{GREEN}[RES]{DEFAULT} Вы {GREEN}включили{DEFAULT} музыку в конце раунда");
soundPreference[client] = 1;
SetClientCookie(client, g_Cookie, "1");
}
else
{
CGOPrintToChat(client, "{GREEN}[RES]{DEFAULT} Вы {GREEN}выключили{DEFAULT} музыку в конце раунда");
soundPreference[client] = 0;
SetClientCookie(client, g_Cookie, "0");
}
return Plugin_Handled;
}
public OnClientCookiesCached(client)
{
if(!IsFakeClient(client))
{
new String:buffer[5];
GetClientCookie(client,g_Cookie,buffer,5);
if(!StrEqual(buffer,""))
{
soundPreference[client] = StringToInt(buffer);
}
else
{
soundPreference[client] = 1;
SetClientCookie(client, g_Cookie, "1");
}
}
}
public round_end(Handle:event, const String:name[], bool:silent)
{
new b = GetTime();
new team = GetEventInt(event, "winner");
if (++g_CurrPos >= g_Sounds_Count) g_CurrPos = 0;
decl String:SoundName[150]; GetArrayString(g_Array, g_CurrPos, SoundName, 150);
for (new i = 1; i < MaxClients; i++)
if(IsClientInGame(i) && !IsFakeClient(i) && b - timeconnect[i] >= 30 && soundPreference[i])
EmitSoundToClientAny(i, SoundName);
for( new i = 1; i < GetMaxClients(); i++ )
{
if(team == 2)
{
StopSound(i, 6, "radio/terwin.wav");
}
else if(team == 3)
{
StopSound(i, 6, "radio/ctwin.wav");
}
else
{
StopSound(i, 6, "radio/rounddraw.wav");
}
}
}[/spoiler]
Все фигня, нормальный sounds тольк от от ws но надо поправки внести
--- Добавлено позже ---
путь к звукам редактируй 26 и 40 строку, !res - вкл/вкл музыка на отдельном клиенте
так же 30 сек после подключения к серверу музыка не работает для килента - для того что бы не накладывалась с музыкой при входе
C-подобный:#pragma semicolon 1 #include <clientprefs> #include <csgo_colors> #include <sourcemod> #include <emitsoundany> new Handle:g_Cookie; new soundPreference[MAXPLAYERS+1]; public Plugin:myinfo = { name = "Round End Music", author = "wS / Schmidt", version = "1.1", url = "http://world-source.ru/" }; new Handle:g_Array; new g_Sounds_Count; new g_CurrPos = -1; new timeconnect[MAXPLAYERS+1]; public OnPluginStart() { new Handle:dir = OpenDirectory("sound/indarello/roundend"); if (dir == INVALID_HANDLE) { SetFailState("Не удалось открыть"); return; } g_Array = CreateArray(150); decl String:SoundName[150], FileType:type; while (ReadDirEntry(dir, SoundName, 150, type)) { if (type == FileType_File && StrContains(SoundName, ".ztmp") == -1) { if (StrContains(SoundName, ".mp3") > 0 || StrContains(SoundName, ".wav") > 0) { Format(SoundName, 150, "indarello/roundend/%s", SoundName); PushArrayString(g_Array, SoundName); } } } CloseHandle(dir); if ((g_Sounds_Count = GetArraySize(g_Array)) < 1) { SetFailState("В indarello/roundend нет звуков"); return; } g_Cookie = RegClientCookie("rounend_sounds", "Enable rounend sounds", CookieAccess_Private); RegConsoleCmd("sm_res", cmd_zzguns); HookEvent("round_end", round_end, EventHookMode:1); } public OnMapStart() { decl String:SoundName[150]; for (new i = 0; i < g_Sounds_Count; i++) { GetArrayString(g_Array, i, SoundName, 150); PrecacheSoundAny(SoundName, true); Format(SoundName, 150, "sound/%s", SoundName); AddFileToDownloadsTable(SoundName); } } public OnClientPutInServer(client) { timeconnect[client] = GetTime(); } public Action:cmd_zzguns(client, args) { if (client == 0 || !IsClientInGame(client)) { return Plugin_Handled; } if(soundPreference[client] == 0) { CGOPrintToChat(client, "{GREEN}[ES]{DEFAULT} Вы {GREEN}включили{DEFAULT} музыку в конце раунда"); soundPreference[client] = 1; SetClientCookie(client, g_Cookie, "1"); } else { CGOPrintToChat(client, "{GREEN}[ES]{DEFAULT} Вы {GREEN}выключили{DEFAULT} музыку в конце раунда"); soundPreference[client] = 0; SetClientCookie(client, g_Cookie, "0"); } return Plugin_Handled; } public OnClientCookiesCached(client) { if(!IsFakeClient(client)) { new String:buffer[5]; GetClientCookie(client,g_Cookie,buffer,5); if(!StrEqual(buffer,"")) { soundPreference[client] = StringToInt(buffer); } else { soundPreference[client] = 1; SetClientCookie(client, g_Cookie, "1"); } } } public round_end(Handle:event, const String:name[], bool:silent) { new b = GetTime(); new team = GetEventInt(event, "winner"); if (++g_CurrPos >= g_Sounds_Count) g_CurrPos = 0; decl String:SoundName[150]; GetArrayString(g_Array, g_CurrPos, SoundName, 150); for (new i = 1; i < MaxClients; i++) if(IsClientInGame(i) && !IsFakeClient(i) && b - timeconnect[i] >= 30 && soundPreference[i]) EmitSoundToClientAny(i, SoundName); for( new i = 1; i < GetMaxClients(); i++ ) { if(team == 2) { StopSound(i, 6, "radio/terwin.wav"); } else if(team == 3) { StopSound(i, 6, "radio/ctwin.wav"); } else { StopSound(i, 6, "radio/rounddraw.wav"); } } }[/spoiler]
раунд енд соунд от арены стоит, при ничьей играет музыка.Нет,все плагины требуют победу команды,я уже даже какой то abner sound пытался ставить,все кому писал говорят нужно насильно делать победу в раунде одной из команд
в тех поддержке (муарена) сказали у их плагина нет такой возможностираунд енд соунд от арены стоит, при ничьей играет музыка.