Update entWatch-core.sp

This commit is contained in:
zaCade 2019-05-20 01:58:14 +02:00
parent 1c79b8941d
commit 52b5cb0586

View File

@ -18,6 +18,7 @@
/* BOOLS */ /* BOOLS */
bool g_bLate; bool g_bLate;
bool g_bLoaded; bool g_bLoaded;
bool g_bLoadPending;
bool g_bIntermission; bool g_bIntermission;
/* ARRAYS */ /* ARRAYS */
@ -101,6 +102,23 @@ public void OnPluginStart()
// Purpose: // Purpose:
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------
public Action Command_ReloadConfig(int client, int args) public Action Command_ReloadConfig(int client, int args)
{
if (g_bLoaded)
{
g_bLoadPending = !g_bLoadPending;
if (g_bLoadPending)
{
CReplyToCommand(client, "\x07%s[entWatch] \x07%sConfig load pending, loading at roundstart.", "E01B5D", "F16767");
return Plugin_Handled;
}
else
{
CReplyToCommand(client, "\x07%s[entWatch] \x07%sPending config load cancelled!", "E01B5D", "F16767");
return Plugin_Handled;
}
}
else
{ {
g_bLoaded = LoadConfig(); g_bLoaded = LoadConfig();
@ -115,6 +133,7 @@ public Action Command_ReloadConfig(int client, int args)
return Plugin_Handled; return Plugin_Handled;
} }
} }
}
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------
// Purpose: // Purpose:
@ -219,6 +238,17 @@ stock bool LoadConfig()
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------
public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast) public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast)
{ {
if (g_bLoadPending)
{
g_bLoaded = LoadConfig();
if (g_bLoaded)
{
CPrintToChatAll("\x07%s[entWatch] \x07%sPending config load successfull.", "E01B5D", "F16767");
}
}
g_bLoadPending = false;
g_bIntermission = false; g_bIntermission = false;
} }