// Includes
#include <sourcemod>
new Handle:g_Timer_One = INVALID_HANDLE;
new Handle:g_Timer_Two = INVALID_HANDLE;
new Handle:g_Timer_Thre = INVALID_HANDLE;
new Handle:g_Timer_Res = INVALID_HANDLE;
new Handle:g_Timer_Say = INVALID_HANDLE;
public Plugin:myinfo =
{
name = "pskins_enabler_disabler",
author = "ZacharyV",
description = "Disable and enable SkinChooser",
version = "0.1",
url = "vk.com/zakharv"
};
public OnPluginStart()
{
HookEvent("round_start", round_start, EventHookMode_PostNoCopy);
}
public round_start(Handle:event, const String:name[], bool:dontBroadcast)
{
ServerCommand("sm_pskin_enable 1");
// ServerCommand("sm_play @all buttons/bell1.wav");
g_Timer_One = CreateTimer(2.0, SayExecute1)
}
public Action:SayExecute1(Handle:timer)
{
PrintToChatAll("\x09▸ \x01Скины снова доступны для выбора еще \x06 90\x01 сек.");
g_Timer_Two = CreateTimer(45.0, SayExecute2);
KillTimer(g_Timer_One);
}
public Action:SayExecute2(Handle:timer)
{
PrintToChatAll("\x09▸ \x01Смена скинов будет доступена еще \x06 30\x01 сек.");
g_Timer_Thre = CreateTimer(30.0, SayExecute3);
KillTimer(g_Timer_Two);
}
public Action:SayExecute3(Handle:timer)
{
PrintToChatAll("\x09▸ \x01Смена скинов будет отключена через \x06 10\x01 сек.");
g_Timer_Res = CreateTimer(10.0, ExecuteSayTimer);
KillTimer(g_Timer_Thre);
}
public Action:ExecuteSayTimer(Handle:timer)
{
KillTimer(g_Timer_Res);
g_Timer_Say = CreateTimer(1.0, ExecuteAndFinalSay);
// ServerCommand("sm_umc_randcycle_picknextmapnow");
// ServerCommand("sm_play @all buttons/bell1.wav");
ServerCommand("sm_pskin_enable 0");
}
public Action:ExecuteAndFinalSay(Handle:timer)
{
KillTimer(g_Timer_Say);
PrintToChatAll("\x09▸ \x01Выбор скинов \x02отключен. \x01 Выбор возобновиться в \x06начале \x01раунда.");
// PrintCenterTextAll("* Бугага");
}