diff --git a/_entWatch4/scripting/entWatch-core.sp b/_entWatch4/scripting/entWatch-core.sp index 6fe9c7b0..0dee4658 100644 --- a/_entWatch4/scripting/entWatch-core.sp +++ b/_entWatch4/scripting/entWatch-core.sp @@ -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; }