Skip to content
Permalink
Browse files

Move unload check

  • Loading branch information...
Bara committed Mar 15, 2019
1 parent 2bca65c commit 12e93bcdac0f059cc35ab12537e6aaa47fadec98
Showing with 12 additions and 11 deletions.
  1. +2 −2 addons/sourcemod/scripting/ttt/core/config.sp
  2. +10 −9 addons/sourcemod/scripting/ttt/ttt.sp
@@ -146,8 +146,8 @@ void SetupConfig()
g_cStartMelee = AutoExecConfig_CreateConVar("ttt_start_melee_weapon", "fists", "Spawn with which melee weapon?");
g_cAdditionalMeleeRole = AutoExecConfig_CreateConVar("ttt_additional_melee_role", "14", "Who gets the additional melee weapon? (Useful: https://github.com/Bara/TroubleinTerroristTown/wiki/CVAR-Masks )", _, true, 0.0, true, 14.0);
g_cAdditionalMeleeWeapon = AutoExecConfig_CreateConVar("ttt_additional_melee_weapon", "knife", "Which additional weapon?");
g_cUnloadPlugins = AutoExecConfig_CreateConVar("ttt_Unload_plugins", "1", "Unload old/obsolete plugins?", _, true, 0.0, true, 1.0);
g_cRemovePlugins = AutoExecConfig_CreateConVar("ttt_remove_plugins", "1", "Remove old/obsolete plugins?", _, true, 0.0, true, 1.0);
g_cUnloadPlugins = AutoExecConfig_CreateConVar("ttt_unload_plugins", "1", "Unload old/obsolete plugins?", _, true, 0.0, true, 1.0);
g_cRemovePlugins = AutoExecConfig_CreateConVar("ttt_remove_plugins", "1", "Remove old/obsolete plugins (ttt_remove_plugins must be 1)?", _, true, 0.0, true, 1.0);

g_cpluginTag.AddChangeHook(OnConVarChanged);
g_ckickImmunity.AddChangeHook(OnConVarChanged);
@@ -221,7 +221,11 @@ public void OnConfigsExecuted()
}

GetLatestVersion();
CheckCPS();

if (g_cUnloadPlugins.BoolValue)
{
CheckCPS();
}
}

public void TTT_OnSQLConnect(Database db)
@@ -4657,15 +4661,12 @@ void CheckCPS()

if (pStatus == Plugin_Running)
{
if (g_cUnloadPlugins.BoolValue)
{
ServerCommand("sm plugins unload CustomPlayerSkins");
LogMessage("CustomPlayerSkins unloaded, no longer required.");
ServerCommand("sm plugins unload CustomPlayerSkins");
LogMessage("CustomPlayerSkins unloaded, no longer required.");

if (g_cRemovePlugins.BoolValue)
{
DeleteFile(sPath);
}
if (g_cRemovePlugins.BoolValue)
{
DeleteFile(sPath);
}
}
}

0 comments on commit 12e93bc

Please sign in to comment.
You can’t perform that action at this time.