Update entWatch-core.sp
This commit is contained in:
parent
1c79b8941d
commit
52b5cb0586
@ -18,6 +18,7 @@
|
||||
/* BOOLS */
|
||||
bool g_bLate;
|
||||
bool g_bLoaded;
|
||||
bool g_bLoadPending;
|
||||
bool g_bIntermission;
|
||||
|
||||
/* ARRAYS */
|
||||
@ -102,6 +103,23 @@ public void OnPluginStart()
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
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();
|
||||
|
||||
if (g_bLoaded)
|
||||
@ -114,6 +132,7 @@ public Action Command_ReloadConfig(int client, int args)
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user