41 lines
1.6 KiB
Plaintext
41 lines
1.6 KiB
Plaintext
|
|
//----------------------------------------------------------------------------------------------------
|
|
// Purpose:
|
|
//----------------------------------------------------------------------------------------------------
|
|
public void OnPluginStart()
|
|
{
|
|
if ((g_hGameConf = LoadGameConfigFile("entWatch.games")) == INVALID_HANDLE)
|
|
SetFailState("Couldn't load \"entWatch.games\" game config!");
|
|
|
|
...
|
|
}
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
// Purpose:
|
|
//----------------------------------------------------------------------------------------------------
|
|
public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast)
|
|
{
|
|
g_fRestartTime = 0.0;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
// Purpose:
|
|
//----------------------------------------------------------------------------------------------------
|
|
public void OnRoundEnding(Event hEvent, const char[] sEvent, bool bDontBroadcast)
|
|
{
|
|
g_fRestartTime = view_as<float>(LoadFromAddress(GetGameRulesAddress() + view_as<Address>(GameConfGetOffset(g_hGameConf, "RoundRestartTime")), NumberType_Int32));
|
|
}
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
// Purpose:
|
|
//----------------------------------------------------------------------------------------------------
|
|
public void OnGameFrame()
|
|
{
|
|
if (g_fRestartTime && g_fRestartTime <= GetGameTime())
|
|
{
|
|
if (g_hArray_Items.Length)
|
|
g_hArray_Items.Clear();
|
|
|
|
g_fRestartTime = 0.0;
|
|
}
|
|
} |