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 */
bool g_bLate;
bool g_bLoaded;
bool g_bLoadPending;
bool g_bIntermission;
/* ARRAYS */
@ -102,17 +103,35 @@ public void OnPluginStart()
//----------------------------------------------------------------------------------------------------
public Action Command_ReloadConfig(int client, int args)
{
g_bLoaded = LoadConfig();
if (g_bLoaded)
{
CReplyToCommand(client, "\x07%s[entWatch] \x07%sConfig load successfull.", "E01B5D", "F16767");
return Plugin_Handled;
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
{
CReplyToCommand(client, "\x07%s[entWatch] \x07%sConfig load failed!", "E01B5D", "F16767");
return Plugin_Handled;
g_bLoaded = LoadConfig();
if (g_bLoaded)
{
CReplyToCommand(client, "\x07%s[entWatch] \x07%sConfig load successfull.", "E01B5D", "F16767");
return Plugin_Handled;
}
else
{
CReplyToCommand(client, "\x07%s[entWatch] \x07%sConfig load failed!", "E01B5D", "F16767");
return Plugin_Handled;
}
}
}
@ -219,6 +238,17 @@ stock bool LoadConfig()
//----------------------------------------------------------------------------------------------------
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;
}